/* ============================================================
   TYLER WALTERS — SHARED STYLESHEET  v4
   style.css
============================================================ */

/* ============================================================
   CSS CUSTOM PROPERTIES
============================================================ */
:root {
  --ground:        #140030;
  --ground-dark:   #0e0022;
  --text:          #F0F0F8;
  --text-dim:      rgba(240, 240, 248, 0.38);
  --text-mid:      rgba(240, 240, 248, 0.72);
  --accent:        #4A90D9;
  --accent-dim:    rgba(74, 144, 217, 0.35);
  --font:          'Inter', sans-serif;
  --header-h:      120px;   /* overridden by JS */
  --subnav-h:      60px;    /* overridden by JS */

  /* Responsive side padding — grows smoothly, no sudden jump.
     min: 1.2rem at narrowest, max: 3rem at wide screens.
     clamp middle value: 4vw grows from ~1.2rem at 480px to 3rem at 1200px */
  --side-pad: clamp(1.2rem, 4vw, 3rem);
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: var(--font);
  background: var(--ground);
  color: var(--text);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background: var(--ground);
}

/* ============================================================
   PAGE FADE-IN
   Every inner page fades in on load.
   The landing page handles its own transition via JS.
============================================================ */
body {
  animation: pageFadeIn 0.5s ease forwards;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   PARALLAX BACKGROUND
============================================================ */
.parallax-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.22;
}

.parallax-bg-img {
  width: 120%;
  height: 120%;
  object-fit: cover;
  transform-origin: center center;
  transform: scale(1.05);
  will-change: transform;
}

/* ============================================================
   SITE HEADER — fixed, left-aligned
============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  background: var(--ground);
  padding: 1.2rem var(--side-pad) 0;
}

.site-header-name {
  font-family: var(--font);
  font-weight: 100;
  font-style: italic;
  /* Grows from 50% screen width to 90% screen width.
     At 13" MBP (~1440 CSS px wide):
       50% = 720px → 720 * 0.022 = 15.8px ≈ 1rem  (near minimum)
       90% = 1296px → 1296 * 0.022 = 28.5px → capped at max
     Middle value 2.2vw produces smooth growth in that range. */
  font-size: clamp(1.3rem, 2.2vw, 3.2rem);
  letter-spacing: 0.28em;
  color: var(--text);
  line-height: 1;
  text-transform: none;
  user-select: none;
  pointer-events: none;
  display: block;
  text-align: left;
  margin-bottom: 0.7rem;
}

/* ============================================================
   MAIN NAVIGATION BAR
============================================================ */
.nav-bar {
  display: flex;
  align-items: baseline;
  gap: 2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(240, 240, 248, 0.06);
  flex-wrap: wrap;
}

/* Nav items — same clamp range as title for synchronized scaling */
.nav-item {
  /* Min ~20% smaller than before: was 0.82rem min, now 0.66rem min.
     Same 50%–90% growth window as title and body text. */
  font-size: clamp(0.66rem, 1.3vw, 1.1rem);
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.25s ease;
  white-space: nowrap;
}

.nav-item:hover { color: var(--text-mid); }

/* Active — accent color, noticeably larger */
.nav-item.active {
  color: var(--accent);
  font-size: clamp(0.8rem, 1.6vw, 1.35rem);
  font-weight: 350;
  letter-spacing: 0.14em;
}

.nav-home { margin-right: auto; }

/* ============================================================
   SUB-NAVIGATION — fixed position, not sticky
   Sits flush below the main header.
   JS sets top = header.offsetHeight precisely.
============================================================ */
.sub-nav {
  position: fixed;           /* fixed, not sticky — never scrolls away */
  left: 0;
  right: 0;
  z-index: 100;              /* above content, below main header */
  background: var(--ground);
  padding: 0.7rem var(--side-pad) 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  /* top set by JS */
}

/* Gradient fade below sub-nav */
.sub-nav::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 1.8rem;
  background: linear-gradient(to bottom, var(--ground) 0%, rgba(20,0,48,0) 100%);
  pointer-events: none;
}

/* Sub-nav items — same size as statement text for visual harmony */
.sub-nav-item {
  font-size: clamp(0.7rem, 1.25vw, 1.04rem);
  font-weight: 300;
  letter-spacing: 0.01em;
  text-transform: none;
  text-decoration: none;
  padding: 0.12em 0;
  transition: color 0.3s ease;
  cursor: pointer;
  display: inline-block;
  line-height: 1.55;
}

/* Active — matches statement line-2 (full brightness) */
.sub-nav-item.sub-active {
  color: var(--text);
  font-weight: 300;
  order: 2;
}

/* Inactive — matches statement line-1 (dimmer) */
.sub-nav-item.sub-inactive {
  color: rgba(240, 240, 248, 0.72);
  order: 1;
}

.sub-nav-item.sub-inactive:hover { color: var(--text); }

/* ============================================================
   ABOUT PAGE
   padding-top accounts for both header and sub-nav heights
============================================================ */
.about-page {
  position: relative;
  z-index: 1;
  /* JS sets this to header height + sub-nav height */
  padding-top: calc(var(--header-h) + var(--subnav-h));
}

/* ---- Statement section ---- */
.statement-section {
  padding: 1.2rem var(--side-pad) 5rem;
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.statement-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.statement-item {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0 0.5rem;
  align-items: start;
  padding: 0.6rem 0;
  border-top: 1px solid rgba(240, 240, 248, 0.055);
}

.statement-item:last-of-type {
  border-bottom: 1px solid rgba(240, 240, 248, 0.055);
}

.slash {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.55;
  padding-top: 0.1em;
  opacity: 0.55;
  user-select: none;
}

.statement-text {
  /* ~20% smaller minimum than before (was 0.88rem, now 0.72rem).
     Same 50%–90% growth window. Max unchanged. */
  font-size: clamp(0.72rem, 1.25vw, 1.04rem);
  font-weight: 300;
  letter-spacing: 0.01em;
}

.statement-text .line-1 {
  display: block;
  color: rgba(240, 240, 248, 0.72);
  line-height: 1.55;
}

.statement-text .line-2 {
  display: block;
  color: var(--text);
  line-height: 1.55;
}

.statement-text em { font-style: italic; color: var(--text); }

/* Final line — left-aligned with text column, no grid, no slash */
.statement-final {
  padding: 0.6rem 0;
  border-top: 1px solid rgba(240, 240, 248, 0.055);
  /* Indent to match the text column (slash col width + gap) */
  padding-left: calc(1.4rem + 0.5rem);
}

.final-text {
  font-size: clamp(0.72rem, 1.25vw, 1.04rem);
  font-weight: 300;
  color: rgba(240, 240, 248, 0.72);
  line-height: 1.55;
  letter-spacing: 0.01em;
  font-style: normal;
}

/* ---- Bio section ---- */
.bio-section {
  min-height: 80vh;
  padding: 2.5rem var(--side-pad) 8rem;
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.bio-text {
  font-size: clamp(0.72rem, 1.25vw, 1.06rem);
  font-weight: 300;
  line-height: 1.9;
  color: var(--text-mid);
  letter-spacing: 0.01em;
}

.bio-text p { margin-bottom: 1.85em; }
.bio-text p:last-child { margin-bottom: 0; }
.bio-text em { font-style: italic; color: var(--text); }

/* Kept for other pages that use it */
.section-title {
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
  opacity: 0.8;
}

.accent-rule {
  width: 2rem;
  height: 1px;
  background: var(--accent);
  opacity: 0.4;
  margin: 1.2rem 0 2.2rem;
}

/* ============================================================
   WORK PAGE
============================================================ */
.work-page {
  padding-top: var(--header-h);
  position: relative;
  z-index: 1;
}

.reel-strip {
  width: 100%;
  height: clamp(100px, 16vw, 220px);
  overflow: hidden;
  position: relative;
  background: var(--ground-dark);
}

.reel-strip video, .reel-strip img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 40%;
  opacity: 0.8; display: block;
}

.reel-strip::before, .reel-strip::after {
  content: ''; position: absolute;
  top: 0; bottom: 0; width: 10%; z-index: 2; pointer-events: none;
}
.reel-strip::before { left: 0; background: linear-gradient(to right, var(--ground) 0%, transparent 100%); }
.reel-strip::after  { right: 0; background: linear-gradient(to left, var(--ground) 0%, transparent 100%); }

.work-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 85;
  display: flex;
  gap: 2.5rem;
  padding: 0.8rem var(--side-pad);
  background: linear-gradient(to bottom, rgba(20,0,48,0.97) 0%, rgba(20,0,48,0) 100%);
}

.work-nav a {
  font-size: clamp(0.6rem, 1vw, 0.85rem);
  font-weight: 300; letter-spacing: 0.32em;
  text-transform: lowercase; text-decoration: none;
  color: var(--text-dim); transition: color 0.25s ease; white-space: nowrap;
}

.work-nav a:hover, .work-nav a.section-active { color: var(--accent); }

.work-section { padding: 4rem var(--side-pad) 2rem; }
.work-section-header { margin-bottom: 3rem; }

.work-section-title {
  font-size: 0.62rem; font-weight: 300; letter-spacing: 0.5em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; opacity: 0.78;
}

.work-section-intro {
  font-size: clamp(0.82rem, 1.2vw, 1rem);
  font-weight: 300; line-height: 1.85; color: var(--text-mid); max-width: 700px;
}

.work-entry {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3px; margin-bottom: 4px; position: relative;
}

.work-entry:nth-child(odd) .work-video-box    { order: 2; }
.work-entry:nth-child(odd) .work-statement-box { order: 1; }

.work-video-box {
  position: relative; background: var(--ground-dark);
  aspect-ratio: 16/9; overflow: hidden; will-change: transform;
}

.work-video-box iframe { width: 100%; height: 100%; border: none; display: block; }

.video-placeholder {
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center;
  background: rgba(74,144,217,0.04); border: 1px solid rgba(74,144,217,0.1);
}

.video-placeholder span {
  font-size: 0.6rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--accent-dim);
}

.work-statement-box {
  background: rgba(240,240,248,0.02);
  padding: 2.2rem 2.4rem; display: flex;
  flex-direction: column; will-change: transform;
}

.work-title {
  font-size: clamp(1rem, 1.8vw, 1.4rem); font-weight: 200;
  letter-spacing: 0.03em; color: var(--text); margin-bottom: 0.25rem; font-style: italic;
}

.work-meta {
  font-size: 0.6rem; font-weight: 300; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--accent); opacity: 0.65; margin-bottom: 1.4rem;
}

.work-collaborators {
  font-size: 0.6rem; font-weight: 300; letter-spacing: 0.22em;
  color: var(--text-dim); margin-bottom: 1.4rem; text-transform: uppercase;
}

.work-statement-preview {
  font-size: clamp(0.8rem, 1.1vw, 0.93rem);
  font-weight: 300; line-height: 1.85; color: var(--text-mid); flex: 1;
}

.work-more-btn {
  display: inline-block; margin-top: 1.3rem; align-self: flex-start;
  font-size: 0.6rem; font-weight: 300; letter-spacing: 0.42em;
  text-transform: lowercase; color: var(--accent); cursor: pointer;
  background: none; border: none; border-bottom: 1px solid var(--accent-dim);
  padding-bottom: 0.12em; transition: color 0.2s ease, border-color 0.2s ease;
  font-family: var(--font);
}

.work-more-btn:hover { color: var(--text); border-color: var(--text-mid); }

.work-statement-full {
  display: none; font-size: clamp(0.8rem, 1.1vw, 0.93rem);
  font-weight: 300; line-height: 1.85; color: var(--text-mid);
  margin-top: 1.1rem; border-top: 1px solid rgba(240,240,248,0.06); padding-top: 1.1rem;
}

.work-statement-full.expanded { display: block; }

.negative-mirror-label {
  font-size: 0.58rem; letter-spacing: 0.42em;
  text-transform: lowercase; color: var(--text-dim); margin-bottom: 0.35rem;
}

/* ============================================================
   CONTACT PAGE
============================================================ */
.contact-page { padding-top: var(--header-h); min-height: 100vh; position: relative; z-index: 1; }
.contact-inner { max-width: 560px; padding: 4rem var(--side-pad) 7rem; margin: 0 auto; }
.contact-text { font-size: clamp(0.88rem, 1.25vw, 1.05rem); font-weight: 300; line-height: 1.85; color: var(--text-mid); margin-bottom: 2.8rem; }
.contact-form { display: flex; flex-direction: column; gap: 1.3rem; }
.contact-field { display: flex; flex-direction: column; gap: 0.4rem; }
.contact-label { font-size: 0.6rem; font-weight: 300; letter-spacing: 0.4em; text-transform: lowercase; color: var(--text-dim); }
.contact-input, .contact-textarea { background: rgba(240,240,248,0.035); border: 1px solid rgba(240,240,248,0.1); color: var(--text); font-family: var(--font); font-size: 0.9rem; font-weight: 300; padding: 0.75rem 1rem; outline: none; transition: border-color 0.25s ease; resize: none; border-radius: 0; -webkit-appearance: none; }
.contact-input:focus, .contact-textarea:focus { border-color: var(--accent-dim); }
.contact-textarea { min-height: 130px; }
.contact-submit { align-self: flex-start; font-family: var(--font); font-size: 0.62rem; font-weight: 300; letter-spacing: 0.44em; text-transform: lowercase; color: var(--text); background: transparent; border: 1px solid rgba(240,240,248,0.28); padding: 0.72em 2.2em; cursor: pointer; transition: border-color 0.25s ease, color 0.25s ease; }
.contact-submit:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   CV PAGE
============================================================ */
.cv-page { padding-top: var(--header-h); min-height: 100vh; position: relative; z-index: 1; }
.cv-inner { max-width: 820px; padding: 4rem var(--side-pad) 7rem; margin: 0 auto; }
.cv-download-link { display: inline-block; font-size: 0.6rem; font-weight: 300; letter-spacing: 0.38em; text-transform: lowercase; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-dim); padding-bottom: 0.12em; margin-bottom: 3rem; transition: color 0.2s ease; }
.cv-download-link:hover { color: var(--text); }
.cv-section { margin-bottom: 3rem; }
.cv-section-heading { font-size: 0.62rem; font-weight: 300; letter-spacing: 0.48em; text-transform: uppercase; color: var(--accent); opacity: 0.75; margin-bottom: 1.1rem; padding-bottom: 0.5rem; border-bottom: 1px solid rgba(240,240,248,0.07); }
.cv-entry { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0 1.5rem; padding: 0.55rem 0; border-top: 1px solid rgba(240,240,248,0.04); font-size: clamp(0.82rem, 1.1vw, 0.93rem); font-weight: 300; line-height: 1.65; }
.cv-year { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cv-detail { color: var(--text-mid); }
.cv-detail em { font-style: italic; color: var(--text); }

/* ============================================================
   PRESS PAGE
============================================================ */
.press-page { padding-top: var(--header-h); min-height: 100vh; position: relative; z-index: 1; }
.press-inner { max-width: 820px; padding: 4rem var(--side-pad) 7rem; margin: 0 auto; }
.press-placeholder { font-size: clamp(0.88rem, 1.25vw, 1.05rem); font-weight: 300; line-height: 1.85; color: var(--text-dim); font-style: italic; max-width: 560px; }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 800px) {
  .work-entry { grid-template-columns: 1fr; }
  .work-entry:nth-child(odd) .work-video-box,
  .work-entry:nth-child(odd) .work-statement-box { order: unset; }
}

/* ============================================================
   UTILITY
============================================================ */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
