/* =========================================================
   TOKENS
   ========================================================= */
/* =========================================================
   CUSTOM FONTS
   Drop your font files into assets/fonts/ using these exact
   filenames (or edit the url() paths below to match yours).
   Until real files exist here, the browser just skips to the
   fallback fonts below — nothing will look broken either way.
   Recommended format: .woff2 (smallest, best browser support).
   Free converter if you only have .ttf/.otf: https://transfonter.org
   ========================================================= */
@font-face {
  font-family: "CustomDisplay";
  src: url("../assets/fonts/Display-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CustomDisplay";
  src: url("../assets/fonts/Display-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CustomBody";
  src: url("../assets/fonts/Body-Regular.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CustomMono";
  src: url("../assets/fonts/Mono-Regular.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --text: #161a00;
  --background: #fcfff0;
  --primary: #677a33;
  --secondary: #f8f4b4;
  --accent: #efb46d;

  --primary-dark: #4d5c26;
  --accent-dark: #d9924f;
  --text-soft: rgba(22, 26, 0, 0.62);
  --text-faint: rgba(22, 26, 0, 0.38);
  --border: rgba(22, 26, 0, 0.14);
  --card: #ffffff;

  --font-display: "CustomDisplay", "Fraunces", "Georgia", serif;
  --font-body: "CustomBody", "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "CustomMono", "JetBrains Mono", ui-monospace, monospace;
  --font-numeric: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --frame: 1px solid var(--border);
  --radius: 10px;
  --max-width: 1180px;
}

/* =========================================================
   RESET
   ========================================================= */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
#top, #services, #about, #contact, #featured {
  scroll-margin-top: 96px;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; color: var(--text-soft); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { padding: 0; margin: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 32px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

/* =========================================================
   NAV
   ========================================================= */
/* =========================================================
   NAV (Mobile Overlay & Spacing Fixes)
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100; /* High z-index keeps header above everything */
  background: var(--background);
  border-bottom: var(--frame);
}
.nav {
  position: relative; /* Anchor for absolute mobile menu */
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 18px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo img {
  height: 46px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-soft);
  transition: background 0.15s ease, color 0.15s ease;
  display: block;
}
.nav-links a:hover { background: var(--secondary); color: var(--text); }
.nav-links a.active { background: var(--primary); color: var(--background); }

.nav-toggle {
  display: none;
  background: none;
  border: var(--frame);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-mono);
}

/* --- Mobile Breakpoint --- */
@media (max-width: 720px) {
  .wrap {
    padding: 0 20px !important; /* Forces 20px padding from screen edges */
  }

  .nav {
    padding: 14px 20px;
  }
  
  .nav-toggle { 
    display: block; 
  }

  .nav-links {
    display: none; /* Hidden until menu toggled */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%; /* Spans full width of screen */
    background: var(--background);
    border-bottom: var(--frame);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    
    /* Stacks menu items neatly below one another */
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 20px;
    gap: 8px;
    z-index: 101;
  }

  .nav-links.open { 
    display: flex; 
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a { 
    padding: 12px 16px;
    width: 100%;
    text-align: left;
  }
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 13px 24px;
  border-radius: 999px;
  border: 2px solid var(--text);
  background: var(--text);
  color: var(--background);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}
.btn.btn-ghost:hover { background: var(--text); color: var(--background); }
.btn.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text);
}
.btn.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* =========================================================
   SCENE / SECTION LABELS
   Content is genuinely sequential (a reel), so numbering
   the sections as "scenes" carries real meaning.
   ========================================================= */
.scene {
  padding: 96px 0;
  border-bottom: var(--frame);
}
.scene:last-of-type { border-bottom: none; }
#work { border-bottom: none; }
.scene-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.scene-number {
  font-family: var(--font-numeric);
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* =========================================================
   INTRO SPACE (home page only)
   A big, quiet space below the nav before the visitor scrolls —
   just two headings, one bold, one normal weight.
   ========================================================= */
.intro-hero {
  position: relative;
  height: calc(100svh - 84px);
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  text-align: left;
  background-image: url('../assets/olive.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
.intro-hero-content {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}
.intro-hero-content h1 {
  font-weight: 700;
  font-size: clamp(1.2rem, 2.8vw, 2.2rem);
  line-height: 1.4;
  margin: 0;
  white-space: normal;
}
.intro-hero-content h2 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.85rem, 1.5vw, 1.05rem);
  color: var(--text-soft);
  margin: 28px 0 0;
  letter-spacing: 0.01em;
}

.scroll-cue {
  position: absolute;
  z-index: 2;
  right: 32px;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
}
.scroll-cue svg { animation: scrollBounce 1.8s ease-in-out infinite; }
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue svg { animation: none; }
}

@media (max-width: 720px) {
  .intro-hero { height: calc(100svh - 70px); min-height: 380px; }
  .intro-hero-content { padding: 0 24px; }
  .scroll-cue { right: 20px; bottom: 20px; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  padding: 72px 0 88px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
.hero .lede { font-size: 1.05rem; max-width: 46ch; }
.hero-cta { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

.hero-stage {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 24px;
  background: var(--secondary);
  border: var(--frame);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-stage svg { width: 78%; height: 78%; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stage { order: -1; max-width: 360px; margin: 0 auto; }
}

/* =========================================================
   ONION-SKIN CARDS (signature interaction)
   Three stacked "frames" per card. On hover they cycle,
   mimicking an animator flipping through onion-skin layers.
   ========================================================= */
.grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.onion-card {
  display: block;
  border: var(--frame);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.onion-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(22, 26, 0, 0.08);
}
.onion-stage {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.onion-frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-numeric);
  font-weight: 700;
  font-size: 3.2rem;
  color: var(--text);
  opacity: 0;
  transform: scale(1.02) rotate(0deg);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.onion-frame.f1 { background: var(--secondary); opacity: 1; }
.onion-frame.f2 { background: var(--accent); }
.onion-frame.f3 { background: var(--primary); color: var(--background); }

.onion-card:hover .f1 { opacity: 0; transform: scale(1.05) rotate(-3deg); }
.onion-card:hover .f2 { opacity: 1; transition-delay: 0.12s; }
.onion-card .f2 { transition-delay: 0s; }
.onion-card:hover .f3 { opacity: 1; transition-delay: 0.32s; }

.onion-meta { padding: 18px 20px 22px; }
.onion-meta .tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.onion-meta h3 { margin-top: 6px; font-size: 1.15rem; }
.onion-meta p { margin: 6px 0 0; font-size: 0.92rem; }

/* =========================================================
   SERVICE STATEMENT (simple three-line version)
   ========================================================= */
.service-statement p {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 88px;
}
.service-statement p:last-child { margin-bottom: 0; }
.service-statement p strong { font-weight: 700; }

/* =========================================================
   STORYBOARD PANELS (services)
   ========================================================= */
.panel-list { display: flex; flex-direction: column; }
.panel {
  display: grid;
  grid-template-columns: 90px 90px 1fr;
  gap: 24px;
  align-items: start;
  padding: 32px 0;
  border-top: var(--frame);
}
.panel:first-child { border-top: none; }
.panel-frame-no {
  font-family: var(--font-numeric);
  font-size: 0.78rem;
  color: var(--text-faint);
  padding-top: 6px;
}
.panel-thumb {
  width: 90px;
  height: 66px;
  border-radius: 8px;
  border: var(--frame);
}
.panel h3 { font-size: 1.3rem; margin-bottom: 8px; }
.panel p { font-size: 0.95rem; max-width: 62ch; }
@media (max-width: 640px) {
  .panel { grid-template-columns: 56px 1fr; }
  .panel-thumb { display: none; }
}

/* =========================================================
   ABOUT
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 56px;
  align-items: start;
}
.about-portrait {
  aspect-ratio: 3/4;
  border-radius: 20px;
  background: linear-gradient(155deg, var(--secondary), var(--accent));
  border: var(--frame);
}
.skill-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-top: var(--frame);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.skill-row:first-child { border-top: none; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* =========================================================
   CONTACT
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 8px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 8px;
  border: var(--frame);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { border-color: var(--primary); }

.contact-info .item { padding: 12px 0; }
.contact-info .item span.eyebrow { display: block; margin-bottom: 4px; }
.form-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 10px;
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* =========================================================
   PROJECT DETAIL PAGE
   ========================================================= */
.project-hero {
  aspect-ratio: 21/9;
  border-radius: var(--radius);
  border: var(--frame);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
}
.project-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 56px;
  align-items: start;
}
.project-body h2 { font-size: 1.4rem; margin-top: 40px; }
.project-body .frame-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.project-body .frame-strip div {
  aspect-ratio: 4/3;
  border-radius: 8px;
  border: var(--frame);
}
.project-facts {
  border: var(--frame);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 96px;
}
.project-facts .fact { padding: 14px 0; border-top: var(--frame); }
.project-facts .fact:first-child { border-top: none; padding-top: 0; }
.project-facts .fact span.eyebrow { display: block; margin-bottom: 4px; }
.project-facts .fact p { margin: 0; color: var(--text); font-size: 0.92rem; }
@media (max-width: 860px) {
  .project-layout { grid-template-columns: 1fr; }
  .project-facts { position: static; }
}

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 32px;
  margin-top: 16px;
  border-top: var(--frame);
}
.project-nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 10px 0;
}
.project-nav a:hover { color: var(--primary); }
.project-nav .next { margin-left: auto; text-align: right; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  border-top: var(--frame);
  padding: 40px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.site-footer a:hover { color: var(--primary); }
.footer-links { display: flex; gap: 18px; }

.font-numeric { font-family: var(--font-numeric); }
/* =========================================================
   MOBILE SECTION SPACING FIXES
   ========================================================= */
@media (max-width: 720px) {
  /* Gives standard scenes (like #work) healthy top/bottom breathing room */
  .scene {
    padding: 60px 0 !important;
  }

  /* Ensures sections with inline padding scale down nicely on phones */
  #services {
    padding: 60px 0 !important;
  }

  #about, 
  #contact {
    padding: 48px 0 16px !important;
  }

  /* Fixes spacing inside the service statement text */
  .service-statement p {
    margin-bottom: 36px !important;
  }

  /* Adds breathing room between contact form and info block */
  .contact-grid {
    gap: 40px !important;
  }
}
/* =========================================================
   PROTECT SIDE PADDING ON ALL MOBILE WRAPPERS
   ========================================================= */
@media (max-width: 720px) {
  /* Forces left and right inner padding on every container, 
     overriding any inline style="padding: ..." attributes */
  .wrap,
  section.wrap,
  main .wrap {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}
/* =========================================================
   GLOBAL MOBILE EDGE-PAD FIX
   ========================================================= */
@media (max-width: 720px) {
  /* 1. Force box-sizing across all elements */
  *, *::before, *::after {
    box-sizing: border-box !important;
  }

  /* 2. Prevent horizontal scrolling on the entire page */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  /* 3. Force side padding on all wrappers & heroes */
  .wrap,
  .intro-hero-content,
  .site-header,
  .nav,
  main,
  section {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* 4. Ensure headings and paragraphs scale down without overflowing */
  h1, h2, h3, h4, p {
    max-width: 100% !important;
    word-break: break-word; /* Prevents long words/links from pushing screen out */
  }
}
/* =========================================================
   SECTION BACKGROUND WASHES (Services / Contact)
   ========================================================= */
#services {
  background-image: url('../assets/orange.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
#contact {
  background-image: url('../assets/yellow.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  padding: 160px 0 120px !important;
}
@media (max-width: 720px) {
  #contact {
    padding: 100px 0 60px !important;
  }
}