/* Casey Builds It — brand template from logo */
:root {
  --bg: #0b0e1c;
  --bg-elevated: #12182c;
  --bg-panel: #161c37;
  --grid: #232a52;
  --text: #f4f1ea;
  --muted: #8891c2;
  --amber: #ffab3d;
  --amber-bright: #ffc373;
  --teal: #5eead4;
  --cream: #f4f1ea;
  --border: rgba(136, 145, 194, 0.22);
  --border-strong: rgba(255, 171, 61, 0.45);
  --glow: rgba(94, 234, 212, 0.14);
  --font: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 10px;
  --header-h: 4.5rem;
  /* --max set in base.html from admin “Content box width” */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--glow), transparent 55%),
    linear-gradient(145deg, #161c37 0%, var(--bg) 55%, #090c18 100%);
  background-attachment: fixed;
}

/* Blueprint grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}

body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--teal);
  text-decoration: none;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--amber-bright);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 14, 28, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header__inner {
  position: relative;
  z-index: 1;
  max-width: min(72rem, calc(var(--max, 42rem) + 16rem));
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text);
}

.site-brand:hover {
  color: var(--text);
}

.site-brand__mark {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  display: block;
}

.site-brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.site-brand__name {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-brand__name .accent {
  color: var(--amber);
}

.site-brand__tag {
  font-family: var(--font-mono);
  font-size: clamp(0.58rem, 1.5vw, 0.68rem);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(28rem, 52vw);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--cream);
  border-bottom-color: var(--teal);
}

/* Hamburger — mobile only */
.nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle:hover {
  border-color: var(--amber);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.nav-toggle-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 20px;
  pointer-events: none;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav-main {
  display: flex;
  align-items: center;
}

.site-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 10, 22, 0.72);
}

.site-nav-backdrop.is-visible {
  display: block;
}

body.nav-open {
  overflow: hidden;
}

body.nav-open .site-header__inner {
  z-index: 200;
}

@media (max-width: 767px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-brand__tag {
    display: none;
  }

  .site-nav-main {
    position: fixed;
    top: var(--site-header-offset, 5rem);
    right: 0;
    width: min(20rem, 92vw);
    height: calc(100dvh - var(--site-header-offset, 5rem));
    max-height: calc(100vh - var(--site-header-offset, 5rem));
    margin: 0;
    padding: 0.5rem 0 1.5rem;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 150;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0.25s;
  }

  .site-nav-main.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .site-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    width: 100%;
  }

  .site-nav li {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  .site-nav a {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.15rem;
    font-size: 0.82rem;
    min-height: 48px;
    line-height: 1.3;
    border-bottom: none;
  }

  .site-nav a:hover,
  .site-nav a.is-active {
    background: rgba(94, 234, 212, 0.08);
    color: var(--teal);
    border-bottom: none;
  }
}

@media (min-width: 768px) {
  .site-header__inner {
    align-items: center;
    flex-wrap: wrap;
  }
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.75rem 1.5rem 4rem;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--cream);
}

h1 {
  font-size: clamp(1.85rem, 4.2vw, 2.5rem);
  margin: 0 0 1.25rem;
}

h1::before {
  content: ">_ ";
  font-family: var(--font-mono);
  font-size: 0.72em;
  font-weight: 600;
  color: var(--teal);
  letter-spacing: 0;
}

h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

.prose p {
  margin: 0 0 1rem;
  color: rgba(244, 241, 234, 0.92);
}

.prose a {
  text-decoration: underline;
  text-decoration-color: rgba(94, 234, 212, 0.45);
}

.prose a:hover {
  text-decoration-color: var(--amber);
}

.prose blockquote {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--amber);
  background: rgba(22, 28, 55, 0.65);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--amber-bright);
  background: rgba(255, 171, 61, 0.1);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

.prose pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.post-list a {
  text-decoration: none;
}

.post-list a:hover h2 {
  color: var(--amber-bright);
}

.post-list h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.post-list h2::before {
  content: none;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Blog listing */
.blog-heading {
  font-size: clamp(1.85rem, 4.2vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.blog-sub {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 2rem;
  max-width: 42em;
  line-height: 1.55;
}

.post-grid {
  display: grid;
  gap: 1rem;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-grid--cols-1 { grid-template-columns: minmax(0, 1fr); }
.post-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 720px) {
  .post-grid--cols-2,
  .post-grid--cols-3 { grid-template-columns: 1fr; }
}

@media (min-width: 721px) and (max-width: 960px) {
  .post-grid--cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.post-card {
  background: rgba(22, 28, 55, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.1rem;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.post-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(255, 171, 61, 0.12), 0 12px 32px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.post-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}

.post-card__title::before {
  content: none;
}

.post-card__title a {
  color: var(--cream);
  text-decoration: none;
}

.post-card__title a:hover {
  color: var(--amber-bright);
}

.post-card__excerpt {
  font-size: 0.94rem;
  color: rgba(244, 241, 234, 0.82);
  line-height: 1.6;
  margin: 0.35rem 0 0;
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}

.post-card__more {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}

.post-card__more:hover {
  color: var(--amber-bright);
}

.blog-empty {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.blog-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.blog-pagination a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
}

.blog-pagination a:hover {
  color: var(--amber-bright);
}

.site-footer {
  max-width: min(72rem, calc(var(--max, 42rem) + 16rem));
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--teal);
}

.site-footer-links {
  margin-top: 0.65rem;
}

.flash {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.flash--ok {
  background: rgba(94, 234, 212, 0.1);
  color: var(--teal);
  border-color: rgba(94, 234, 212, 0.35);
}

.flash--error {
  background: rgba(255, 120, 120, 0.1);
  color: #ffb4b4;
  border-color: rgba(255, 120, 120, 0.3);
}

.contact-form {
  font-family: var(--font);
  max-width: 28rem;
  margin-top: 1.5rem;
}

.contact-form label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15);
}

.contact-form button {
  padding: 0.75rem 1.35rem;
  background: linear-gradient(180deg, var(--amber-bright), var(--amber));
  color: #1a1208;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  font-size: 0.88rem;
  text-transform: uppercase;
  transition: filter 0.15s, transform 0.15s;
}

.contact-form button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* ── Home landing ── */
main:has(.home) {
  max-width: none;
  padding: 0;
}

.home {
  overflow-x: clip;
}

.home-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: 0 0 0.85rem;
}

.home-kicker__prompt {
  color: var(--teal);
  margin-right: 0.35rem;
}

.home-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem 2.5rem;
  align-items: center;
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 3.5rem;
}

.home-hero__title {
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem;
  font-weight: 700;
}

.home-hero__title::before {
  content: none;
}

.home-hero__accent {
  color: var(--amber);
}

.home-hero__lede {
  font-size: 1.05rem;
  color: rgba(244, 241, 234, 0.86);
  max-width: 34rem;
  margin: 0 0 1.6rem;
  line-height: 1.6;
}

.home-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.35rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: transform 0.15s, filter 0.15s, border-color 0.15s, color 0.15s;
}

.home-btn--primary {
  background: linear-gradient(180deg, var(--amber-bright), var(--amber));
  color: #1a1208;
}

.home-btn--primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  color: #1a1208;
}

.home-btn--ghost {
  border: 1px solid var(--border);
  color: var(--cream);
  background: rgba(22, 28, 55, 0.5);
}

.home-btn--ghost:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.home-hero__stage {
  position: relative;
}

.home-stage {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.35));
}

.home-cursor {
  animation: home-blink 1.1s steps(1) infinite;
}

.home-float {
  animation: home-float 4.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes home-blink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes home-float {
  0%, 100% { transform: translate(380px, 250px) translateY(0); }
  50% { transform: translate(380px, 250px) translateY(-10px); }
}

.home-section {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.5rem 3.5rem;
}

.home-section__head {
  max-width: 40rem;
  margin-bottom: 1.75rem;
}

.home-section__title {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  margin: 0 0 0.55rem;
  letter-spacing: -0.02em;
}

.home-section__title::before {
  content: none;
}

.home-section__sub {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.home-creations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.home-creation {
  padding: 0;
  border: none;
  background: transparent;
}

.home-creation__art {
  margin-bottom: 1rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(18, 24, 44, 0.65);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.home-creation:hover .home-creation__art {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(255, 171, 61, 0.12), 0 18px 40px rgba(0, 0, 0, 0.28);
  transform: translateY(-3px);
}

.home-creation__art svg {
  display: block;
  width: 100%;
  height: auto;
}

.home-creation h3 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  color: var(--cream);
}

.home-creation h3::before {
  content: none;
}

.home-creation p {
  margin: 0;
  color: rgba(244, 241, 234, 0.82);
  font-size: 0.95rem;
  line-height: 1.55;
}

.home-stack {
  max-width: 72rem;
  margin: 0 auto 1rem;
  padding: 0 1.5rem 3rem;
}

.home-stack__list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.home-stack__list li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--teal);
  border: 1px solid rgba(94, 234, 212, 0.28);
  background: rgba(94, 234, 212, 0.06);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
}

.home-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.home-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(22, 28, 55, 0.55);
}

.home-steps__n {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--amber);
  padding-top: 0.15rem;
}

.home-steps strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--cream);
}

.home-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.home-cta {
  padding: 1rem 1.5rem 4.5rem;
}

.home-cta__inner {
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, rgba(94, 234, 212, 0.12), transparent 60%),
    rgba(22, 28, 55, 0.7);
}

.home-cta__mark {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.home-cta__mark img {
  width: 4rem;
  height: auto;
  animation: home-pulse 3.2s ease-in-out infinite;
}

@keyframes home-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(94, 234, 212, 0)); }
  50% { filter: drop-shadow(0 0 16px rgba(94, 234, 212, 0.35)); }
}

.home-cta h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.home-cta h2::before {
  content: none;
}

.home-cta p {
  margin: 0 0 1.4rem;
  color: var(--muted);
}

@media (max-width: 920px) {
  .home-hero {
    grid-template-columns: 1fr;
    padding-top: 2rem;
  }

  .home-hero__stage {
    order: -1;
    max-width: 28rem;
    margin: 0 auto;
  }

  .home-creations {
    grid-template-columns: 1fr;
  }
}

.home-cms {
  max-width: var(--max, 42rem);
}

.home-cms h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
}

.home-cms h2::before,
.home-cms h3::before {
  content: none;
}

.home-cms .home-creations,
.home-cms .home-steps {
  margin-top: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .home-cursor,
  .home-float,
  .home-cta__mark img {
    animation: none;
  }
}
