/* ============================================================
   style.css — Tanisha Rana Portfolio (plain HTML/CSS/JS version)
   Single stylesheet: fonts → tokens → reset → components
   ============================================================ */


/* ── FONTS ────────────────────────────────────────────────── */
/* Apple Garamond is loaded from the project-root /fonts folder.
   Use root-absolute URLs so pages in subpaths resolve consistently.
   Geist falls back to system-ui; swap in the real Geist if
   you copy the woff2 files into a local /fonts/ folder.      */

@font-face {
  font-family: 'Apple Garamond';
  src: url('fonts/AppleGaramond.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Apple Garamond';
  src: url('fonts/AppleGaramond-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}


/* ── DESIGN TOKENS — STAR MODE (dark, default) ────────────── */
:root {
  /* Font stacks */
  --font-sans:    'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  --font-display: 'Apple Garamond', 'Times New Roman', Georgia, serif;

  /* Page background gradient — dark blue-black at top, deepening to dark navy */
 --bg-grad: linear-gradient(to bottom, #050408 0%, #060c1c 60%, #050e1a 100%);

  /* Carousel fade-mask edge — must match outermost stop of --bg-grad */
  --fade-edge: #050408;

  /* Layout */
  --page-padding-x:    32px;
  --nav-height:        68px;
  --carousel-card-gap: 80px;
  /* AI float: prefer roomier than home carousel; JS enforces ≥ carousel gap after drift */
  --ai-float-gap:      clamp(100px, 8vw, 140px);

  /* Nav pill metrics — fluid so tabs scale with viewport */
  --nav-pill-font-size:   var(--text-xs);
  --nav-pill-line-height: 0;
  --nav-pill-pad-y:       clamp(8px, 0.6vw + 6px, 10px);
  --nav-pill-pad-x:       clamp(8px, 1.2vw + 4px, 14px);
  --nav-pill-gap:         clamp(4px, 0.6vw + 2px, 8px);
  --nav-links-gap:        clamp(0px, 0.4vw, 4px);

  /* Text colors */
  --text1:          #e4dff0;
  --text2:          rgba(228, 223, 240, 0.78);
  --text3:          rgba(236, 236, 236, 0.50);
  --text-hero-caps: rgba(228, 223, 240, 0.42);

  /* Accent — purple in star mode */
  --accent:      #a78bfa;
  --accent2:     #7c5cbf;
  --accent-dim:  rgba(167, 139, 250, 0.08);
  --accent-glow: rgba(167, 139, 250, 0.12);

  /* Shadows */
  --shadow-card:       0 2px 16px rgba(255, 255, 255, 0.06);
  --shadow-card-hover: 0 0 48px rgba(167, 139, 250, 0.24);

  /* Cards */
  --card-bg:     rgba(20, 16, 46, 0.8);
  --card-border: rgba(167, 139, 250, 0.12);
  /* Inset bevel on project cards (Star: cool highlight / depth) */
  --card-inset-depth: inset 1px 1px 0 rgba(255, 255, 255, 0.07), inset -1px -1px 0 rgba(0, 0, 0, 0.28);

  /* Tag text */
  --tag-color: rgba(228, 223, 240, 0.7);

  /* Nav backgrounds */
  --nav-blur-bg:        rgba(12, 15, 29, 0.80);
  --nav-blur-fallback:  rgba(12, 15, 29, 0.97);
  --nav-border:         rgba(167, 139, 250, 0.24);

  /* Gold */
  --gold:      #c9a84c;
  --gold-mid:  #d4a853;
  --gold-tint: rgba(201, 168, 76, 0.10);

  /* Theme transition speed */
  --speed: 0.9s;

  /* Toggle dial size */
  --dial-size: 34px;

  /* Content container max-width */
  --content-max: 1440px;
  /* Wider shell for multi-column layouts (about grid); case studies stay on --content-max */
  --content-max-wide: 1600px;

  /* Fluid type scale — use these tokens for all font-size declarations */
  --text-2xs: clamp(0.5rem, 0.4rem + 0.15vw, 0.625rem);    /* ~8–10px  */
  --text-xs:  clamp(0.5625rem, 0.47rem + 0.22vw, 0.75rem);  /* ~9–12px  */
  --text-sm:  clamp(0.75rem, 0.65rem + 0.3vw, 0.875rem);    /* ~12–14px */
  --text-base: clamp(0.875rem, 0.75rem + 0.35vw, 1rem); /* ~14–16px */
  --text-lg:  clamp(1rem, 0.85rem + 0.7vw, 1.5rem);         /* ~16–24px */
  --text-xl:  clamp(1.25rem, 0.9rem + 1.2vw, 2rem);         /* ~20–32px */
  --text-2xl: clamp(1.75rem, 1rem + 2vw, 3rem);             /* ~28–48px */
  --text-3xl: clamp(2.5rem, 1.5rem + 3vw, 4rem);            /* ~40–64px */
}


/* ── DESIGN TOKENS — SHORE MODE (light) ───────────────────── */
/* Activated by adding class="shore" to <body>                 */
body.shore {
  --bg-grad: linear-gradient(180deg, #fef8ed 0%, #f7fafd 52%, #e8f2f9 100%);
  --fade-edge: #fef8ed;

  --text1:          #1a1a2e;
  --text2:          rgba(26, 26, 46, 0.78);
  --text3:          rgba(26, 26, 46, 0.64);
  --text-hero-caps: rgba(26, 26, 46, 0.48);

  --accent:      #1d4ed8;
  --accent2:     #1e40af;
  --accent-dim:  rgba(29, 78, 216, 0.07);
  --accent-glow: rgba(29, 78, 216, 0.16);

  --card-bg:     rgba(255, 255, 255, 0.80);
  --card-border: rgba(139, 92, 246, 0.15);
  /* Shore: daylight paper edge */
  --card-inset-depth: inset 0 1px 0 rgba(255, 255, 255, 0.52), inset 0 -1px 0 rgba(181, 132, 90, 0.14);
  --tag-color:   rgba(26, 26, 46, 0.65);

  --nav-blur-bg:       rgba(245, 239, 230, 0.80);
  --nav-blur-fallback: rgba(245, 239, 230, 0.97);
  --nav-border:        rgba(26, 26, 46, 0.16);

  --shadow-card:       0 4px 20px rgba(210, 165, 70, 0.16);
  --shadow-card-hover: 0 0 48px rgba(29, 78, 216, 0.24);

  --gold-mid: #b5845a;
}


/* ── OVERSCROLL BACKGROUND ──────────────────────────────── */
/* Prevents white flash during rubber-band scroll on mobile/trackpad.
   background-color on html is the only element the browser uses for
   overscroll fill. Safari iOS ignores overscroll-behavior but respects
   this color. */
html {
  background-color: #050408; /* star mode default — matches --fade-edge */
} 
html.shore {
  background-color: #fef8ed; /* shore mode — matches --fade-edge override */
} 


/* ── CSS RESET ────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
ul, ol {
  list-style: none;
}

/* ── CONTENT CONTAINER ───────────────────────────────────── */
/* Utility class — centers content at --content-max, adds fluid
   padding so content never touches viewport edges on any screen. */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}


/* Screen-reader-only live regions / labels */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ── BODY ─────────────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  background: var(--bg-grad);
  color: var(--text1);
  overflow: hidden;        /* no page scroll on desktop         */
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--speed) ease, color var(--speed) ease;
  overscroll-behavior-y: none; /* suppress overscroll bounce on Chrome/Edge */
}

@media (max-width: 768px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 100dvh;
  }
}


/* ── CANVAS LAYERS ───────────────────────────────────────── */
#bgCanvas,
#fxCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#bgCanvas { z-index: 0; }
#fxCanvas { z-index: 5; }


/* ── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes heroTextGlitch {
  0%   { opacity: 0; transform: translate3d(3px, 0, 0); filter: blur(3px);
         text-shadow: 2px 0 rgba(167,139,250,0.55), -2px 0 rgba(120,200,255,0.45); }
  12%  { opacity: 1; transform: translate3d(-2px, 1px, 0); filter: blur(0);
         text-shadow: -2px 0 rgba(167,139,250,0.6), 2px 0 rgba(255,220,180,0.35); }
  28%  { transform: translate3d(2px,-1px,0);
         text-shadow: 1px 1px rgba(167,139,250,0.45), -1px -1px rgba(120,200,255,0.4); }
  48%  { transform: translate3d(-1px,0,0);
         text-shadow: 1px 0 rgba(255,252,240,0.25), -1px 0 rgba(167,139,250,0.3); }
  72%, 100% { transform: translate3d(0,0,0); text-shadow: none; filter: none; opacity: 1; }
}

/* Home carousel — Star-mode motion (subtle, not decorative noise) */
@keyframes card-tag-star-twinkle {
  0%, 100% {
    opacity: 1;
    border-color: var(--card-border);
  }
  50% {
    opacity: 0.93;
    border-color: rgba(167, 139, 250, 0.22);
  }
}

@keyframes heroTextGlitchShore {
  0%   { opacity: 0; transform: translate3d(3px,0,0); filter: blur(3px);
         text-shadow: 2px 0 rgba(139,92,246,0.45), -2px 0 rgba(200,120,80,0.35); }
  12%  { opacity: 1; transform: translate3d(-2px,1px,0); filter: blur(0);
         text-shadow: -2px 0 rgba(139,92,246,0.5), 2px 0 rgba(220,140,100,0.3); }
  28%  { transform: translate3d(2px,-1px,0);
         text-shadow: 1px 1px rgba(139,92,246,0.35), -1px -1px rgba(200,120,80,0.3); }
  48%  { transform: translate3d(-1px,0,0); text-shadow: 1px 0 rgba(26,26,46,0.12); }
  72%, 100% { transform: translate3d(0,0,0); text-shadow: none; filter: none; opacity: 1; }
}


/* ── NAV ─────────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-padding-x);
  border-bottom: 1px solid transparent;
  transition:
    background 0.4s ease,
    border-color 0.4s ease,
    backdrop-filter 0.4s ease;
}

#nav.scrolled {
  background: var(--nav-blur-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--nav-border);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
  #nav.scrolled {
    background: var(--nav-blur-fallback);
  }
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--nav-links-gap);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--nav-pill-gap);
  padding: var(--nav-pill-pad-y) var(--nav-pill-pad-x);
  min-height: 36px;
  border-radius: 999px;
  background: transparent;
  border: 0.5px solid transparent;
  font-family: var(--font-mono);
  font-size: var(--nav-pill-font-size);
  line-height: var(--nav-pill-line-height);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.nav-pill:hover,
.nav-pill.active {
  color: var(--text1);
  border-color: var(--nav-border);
  background: var(--accent-dim);
}

.nav-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  flex-shrink: 0;
  transition: opacity 0.2s, background 0.2s;
}

.nav-pill.active .nav-dot {
  background: var(--accent);
  opacity: 1;
}


/* ── WORK DROPDOWN ──────────────────────────────────────── */
.work-wrap {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--nav-blur-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0.5px solid var(--nav-border);
  border-radius: 10px;
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 200;
}

#nav-ai-dropdown {
  min-width: 280px;
}

.nav-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown li a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text2);
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown li a:hover {
  background: var(--accent-dim);
  color: var(--text1);
}

.nav-dropdown li a:focus-visible {
  background: var(--accent-dim);
  color: var(--text1);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ── THEME TOGGLE ───────────────────────────────────────── */
.theme-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-readout {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  transition: color 0.3s;
  user-select: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  -webkit-appearance: none;
  appearance: none;
}

.toggle-readout.active {
  color: var(--text1);
}

.toggle-readout:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle-btn {
  width: var(--dial-size);
  height: var(--dial-size);
  border-radius: 50%;
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 50%;
}

.toggle-dial {
  width: var(--dial-size);
  height: var(--dial-size);
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--nav-border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transform: rotate(-45deg);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), background var(--speed), border-color var(--speed);
  will-change: transform;
}

/* Shore mode: dial rotates clockwise to shore position */
body.shore .toggle-dial {
  transform: rotate(45deg);
  box-shadow: inset 0 1px 2px rgba(26, 26, 46, 0.15);
}

.toggle-notch {
  position: absolute;
  top: 1px;
  left: 50%;
  width: 2px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
  transform: translateX(-50%);
}

.toggle-glyph {
  font-size: var(--text-lg);
  line-height: 1;
  color: var(--accent);
  opacity: 0;
  position: absolute;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toggle-glyph.visible {
  opacity: 1;
}

/* Counter-rotate each glyph so it stays visually upright as the dial spins */
.toggle-glyph-star  { transform: rotate(45deg); }
.toggle-glyph-shore { transform: rotate(-45deg); }


/* ── MAIN COMPOSITION ──────────────────────────────────── */
/* Fixed full-viewport container; carousel fills it;        */
/* hero text overlays in upper-left.                        */
#main-page {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none; /* clicks fall through to carousel cards */
}

.composition {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none;
}


/* ── FADE-LEFT MASK ─────────────────────────────────────── */
/* Hides carousel cards entering behind the hero text block  */
.fade-left {
  position: absolute;
  top: 0;
  left: 0;
  width: min(500px, 50vw);
  height: 100%;
  background: linear-gradient(
    to right,
    var(--fade-edge) 0%,
    transparent 100%
  );
  z-index: 20;
  pointer-events: none;
  transition: background var(--speed) ease;
}


/* ── CAROUSEL AREA ──────────────────────────────────────── */
.carousel-area {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: auto; /* receives wheel + touch events */
}

.carousel-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Each card slot is absolutely positioned; JS sets transform */
.card-slot {
  position: absolute;
  top: 50%;
  left: 0;
  pointer-events: auto;
  will-change: transform;
}


/* ── PROJECT CARDS ──────────────────────────────────────── */
.card {
  flex-shrink: 0;
  width: var(--card-w, 520px);
  display: block;
  border-radius: 12px;
  position: relative;
  color: inherit;
}

a.card {
  cursor: pointer;
  text-decoration: none;
}

div.card {
  cursor: default;
}

.card-inner {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card), var(--card-inset-depth);
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s,
    box-shadow 0.4s,
    background var(--speed);
}

/* Paper / starlight wash — depth without backdrop blur */
.card-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  transition: opacity var(--speed);
}

body:not(.shore) .card-inner::before {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.055) 0%, transparent 52%);
}

body.shore .card-inner::before {
  background: linear-gradient(
    168deg,
    rgba(255, 253, 248, 0.42) 0%,
    transparent 48%,
    rgba(29, 78, 216, 0.045) 100%
  );
}

.card-inner > * {
  position: relative;
  z-index: 2;
}

a.card:hover .card-inner,
a.card:focus-visible .card-inner {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover), var(--card-inset-depth);
}

a.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Header row: title + optional badge */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 24px 0;
}

.card-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: 1.25;
  color: var(--text1);
  transition: color var(--speed);
}

.card-summary {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.25;
  color: var(--text2);
  padding: 4px 24px 0;
  transition: color var(--speed);
}

/* Image area */
.img-wrap {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  aspect-ratio: 16 / 10;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Shore: slower, swell-like image motion */
body.shore .card-img {
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-inner.is-upcoming .card-img {
  opacity: 0.5;
  filter: brightness(0.7) saturate(0.5);
}

a.card:hover .card-img,
a.card:focus-visible .card-img {
  transform: scale(1.04);
}

body.shore a.card:hover .card-img,
body.shore a.card:focus-visible .card-img {
  transform: scale(1.028);
}

/* Cursor hint — same box language as case-study "click to zoom" */
@media (hover: hover) and (pointer: fine) {
  .card[data-cursor-hint] {
    cursor: none;
  }

  .card-cursor-hint {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 40;
    font-family: var(--font-mono), ui-monospace, monospace;
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.35);
    padding: 4px 10px;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(14px, 14px);
  }

  .card[data-cursor-hint]:hover .card-cursor-hint,
  .card[data-cursor-hint]:focus-visible .card-cursor-hint {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-cursor-hint {
    transition: none;
  }
}

/* Tag overlay */
.tag-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 12px 12px;
  pointer-events: none;
}

.tag-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.tag-pill {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--tag-color);
  background: var(--card-bg);
  border: 0.5px solid var(--card-border);
  border-radius: 2px;
  padding: 4px 8px;
  white-space: nowrap;
  transition: color var(--speed), background var(--speed), border-color var(--speed);
}

/* Star: tag pills breathe like distant signals (live cards only — calms “coming soon” rows) */
body:not(.shore) .card-inner:not(.is-upcoming) .tag-row .tag-pill {
  animation: card-tag-star-twinkle 4.2s ease-in-out infinite;
}
body:not(.shore) .card-inner:not(.is-upcoming) .tag-row .tag-pill:nth-child(1) { animation-delay: 0s; }
body:not(.shore) .card-inner:not(.is-upcoming) .tag-row .tag-pill:nth-child(2) { animation-delay: 0.35s; }
body:not(.shore) .card-inner:not(.is-upcoming) .tag-row .tag-pill:nth-child(3) { animation-delay: 0.7s; }
body:not(.shore) .card-inner:not(.is-upcoming) .tag-row .tag-pill:nth-child(4) { animation-delay: 1.05s; }

/* COMING SOON badge — static by default; shine only on card hover (no filter animation / GPU flicker) */
.wip-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--accent);
  background: var(--accent-dim);
  border: 0.5px solid var(--accent);
  border-radius: 999px;
  padding:4px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  animation: none;
  box-shadow: none;
  filter: none;
  transition:
    color var(--speed),
    background var(--speed),
    border-color var(--speed),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Glow the badge when hovering upcoming cards */
.card:hover .card-inner.is-upcoming .wip-badge,
.card:focus-within .card-inner.is-upcoming .wip-badge {
  background: var(--accent-glow);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 22px var(--accent-glow),
    0 0 40px rgba(167, 139, 250, 0.12);
  filter: none;
}

body.shore .card:hover .card-inner.is-upcoming .wip-badge,
body.shore .card:focus-within .card-inner.is-upcoming .wip-badge {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45),
    0 0 20px var(--accent-glow),
    0 0 36px rgba(29, 78, 216, 0.12);
}

/* Crosshair corner decorations (compact — avoids overlap with titles) */
.crosshair-tl,
.crosshair-br {
  position: absolute;
  width: 7px;
  height: 7px;
  opacity: 0.12;
  color: var(--text1);
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.3s ease, color var(--speed);
}
.crosshair-tl { top: 5px; left: 5px; }
.crosshair-br { bottom: 5px; right: 5px; }

.crosshair-tl::before, .crosshair-br::before,
.crosshair-tl::after,  .crosshair-br::after {
  content: '';
  position: absolute;
  background: currentColor;
}
.crosshair-tl::before, .crosshair-br::before {
  width: 100%; height: 1px; top: 50%; left: 0; transform: translateY(-50%);
}
.crosshair-tl::after, .crosshair-br::after {
  height: 100%; width: 1px; left: 50%; top: 0; transform: translateX(-50%);
}

@media (prefers-reduced-motion: reduce) {
  body:not(.shore) .card-inner:not(.is-upcoming) .tag-row .tag-pill {
    animation: none !important;
  }
  body:not(.shore) .card-inner:not(.is-upcoming) .tag-row .tag-pill {
    opacity: 1;
  }
}


/* ── HERO INTRO ─────────────────────────────────────────── */
.hero-intro {
  position: absolute;
  top: calc(var(--nav-height) + 24px);
  left: var(--page-padding-x);
  z-index: 30;
  width: clamp(360px, 40%, 520px);
  pointer-events: auto;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-hero-caps);
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.2s forwards;
  transition: color 0.5s ease;
}

.hero-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.08;
  margin-bottom: 8px;
  color: var(--text1);
  transition: color 0.5s ease;
  /* Flex column replaces <br> + inline-block; avoids double line-box gap that ignored margin tweaks. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.title-line-1 {
  display: block;
  line-height: 1.08;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.4s forwards;
  white-space: nowrap;
}

.title-line-2 {
  display: block;
  line-height: 1.08;
  margin-top: -0.12em;
  white-space: nowrap;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.52s forwards;
  will-change: transform, opacity;
}

/* After intro animation ends, lock final state — prevents glitch re-trigger on theme toggle */
.title-line-2.animation-done {
  animation: none !important;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: none;
  text-shadow: none;
}


/* Gold highlight on "creating gold." — solid tokens for readable contrast */
.hl {
  color: var(--gold-mid);
  font-style: italic;
  display: inline;
  white-space: nowrap;
  cursor: default;
  transition: color 0.3s ease, filter 0.3s ease;
}

body.shore .hl {
  color: #9a6b24;
}

.hl:hover {
  filter:
    drop-shadow(0 0 10px rgba(201, 168, 76, 0.55))
    drop-shadow(0 0 24px rgba(201, 168, 76, 0.25));
}

body.shore .hl:hover {
  filter:
    drop-shadow(0 0 8px rgba(154, 107, 36, 0.35))
    drop-shadow(0 0 18px rgba(154, 107, 36, 0.18));
}

.hero-desc {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text2);
  line-height: 1.5;
  max-width: 360px;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.8s forwards;
  transition: color 0.5s ease;
}


/* ── FOOTER / BOTTOM BAR ───────────────────────────────── */
#bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 10px var(--page-padding-x);
  border-top: 0.5px solid var(--nav-border);
  background: var(--nav-blur-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    transform 0.3s ease,
    background var(--speed),
    border-color var(--speed);
}

#bottom-bar.bar-hidden {
  transform: translateY(100%);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--text3);
  white-space: nowrap;
  transition: color var(--speed);
}

.footer-gold {
  color: var(--gold-mid, #d4a853);
}

.footer-dad {
  color: var(--text3);
}

.footer-copyright {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  transition: color var(--speed);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-links a,
.email-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text2);
  line-height: 1;
  transition: color 0.2s;
}

.footer-links a:hover,
.email-btn:hover {
  color: var(--accent);
}

.footer-links a:focus-visible,
.email-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.footer-ext-arrow {
  font-size: calc(1em + 4px);
}

.footer-copy-icon {
  font-size: calc(1em + 4px);
  line-height: 1;
}

.footer-copy-check {
  font-size: calc(1em + 4px);
  line-height: 1;
}

.email-btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.footer-divider {
  width: 1px;
  height: 10px;
  background: var(--text3);
  opacity: 0.4;
  flex-shrink: 0;
}


/* ── RESPONSIVE ─────────────────────────────────────────── */
/* Nav uses --page-padding-x at all widths — matches hero-intro left offset */

@media (min-width: 769px) and (max-width: 1100px) {
  .hero-intro {
    width: clamp(300px, 38%, 440px);
  }
}

@media (max-width: 1023px) {
  .hero-intro {
    width: clamp(280px, 80%, 520px);
    padding: 0 20px;
  }
  .title-line-1,
  .title-line-2 {
    white-space: normal;
  }
  .hero-desc {
    max-width: 100%;
  }
  .fade-left {
    display: none;
  }
}

@media (max-width: 768px) {
  /* On mobile, main is not fixed — page scrolls normally */
  #main-page {
    position: relative;
    inset: auto;
    height: auto;
    min-height: 100svh;
  }

  /* Fix 1+2: Hero text flows normally above the carousel;
     carousel follows as a contained block below it.
     order: -1 on hero-intro because .carousel-area comes first in the DOM. */
  .composition {
    height: auto;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    padding-top: calc(var(--nav-height) + 24px);
  }
  .hero-intro {
    position: static;
    order: -1;
    width: 100%;
    padding: 0 var(--page-padding-x);
    margin: 0 0 28px;
  }
  .carousel-area {
    position: relative;
    height: 70vh;
  }

  /* AI float: allow page scroll when stacked cards exceed the viewport */
  body.is-grid-home {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
  }

  #main-page.is-grid-view {
    height: auto;
    min-height: 100svh;
  }

  .ai-float-view {
    position: relative;
    inset: auto;
    min-height: 70vh;
    overflow: visible;
  }

  .ai-float-area {
    position: relative;
    inset: auto;
    height: 70vh;
  }

  .ai-float-group {
    top: 50%;
    padding: 0 var(--page-padding-x);
  }

  /* Fix 4A: Nav always has a background on mobile so pills are
     readable regardless of scroll position. */
  #nav {
    background: var(--nav-blur-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--nav-border);
  }

  #bottom-bar {
    position: sticky;
    bottom: 0;
    /* Fix 6: reduce footer height on mobile */
    padding-top: 6px;
    padding-bottom: 6px;
  }

  /* Fix 7+8: stack footer vertically, center all items,
     restore quote below the links. */
  .footer-row {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  .footer-links {
    order: 1;
    justify-content: center;
  }
  .footer-quote {
    display: block;
    order: 2;
    text-align: center;
    white-space: normal;
    font-size: var(--text-base); /* larger token at mobile viewport size */
  }
  .footer-copyright {
    order: 3;
  }

  /* Tap targets ≥44px; keep pill padding fluid (no wider than desktop) */
  .nav-pill {
    min-height: 44px;
  }
  .theme-toggle-btn {
    min-width: 44px;
    min-height: 44px;
  }
  /* Vertically center the link text and icon, fix icon oversizing */
  .footer-links a,
  .email-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
  }
  .footer-ext-arrow,
  .footer-copy-icon,
  .footer-copy-check {
    font-size: 1em; /* keep icon same height as text */
  }

  /* Touch tap target for toggle-readout */
  .toggle-readout {
    min-height: 44px;
    padding: 0 8px;
  }
}

@media (max-width: 540px) {
  :root {
    --page-padding-x: 20px;
    --nav-pill-pad-y: 10px;
    --nav-pill-pad-x: 8px;
    --nav-pill-gap: 4px;
    --nav-links-gap: 0px;
  }
  .footer-copyright {
    display: none;
  }
  /* Fix 8: allow hero label to wrap on narrowest screens */
  .hero-label {
    white-space: normal;
  }
  .nav-pill {
    min-height: 44px;
  }
  .nav-pill-label {
    letter-spacing: 0.04em;
  }
  .nav-dot {
    width: 4px;
    height: 4px;
  }
}


/* ── AI EXPERIMENTS FLOAT VIEW ──────────────────────────── */
/* Same hero .card markup as the carousel — absolute float + slow L↔R drift. */

#main-page.is-grid-view #home-composition {
  display: none;
}

.ai-float-view {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
}

.ai-float-view[hidden] {
  display: none !important;
}

.ai-float-area {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

/* Group sits lower than home carousel center; JS drives wave-synced translate */
.ai-float-group {
  position: absolute;
  left: 50%;
  top: 52%;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: var(--ai-float-gap);
  pointer-events: none;
  will-change: transform;
}

.ai-float-group .card {
  width: var(--card-w, 520px);
  flex: 0 0 auto;
  pointer-events: auto;
  will-change: transform;
  opacity: 0;
  animation: aiCardFade 0.55s ease both;
}

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

.ai-float-group .card:nth-child(1) { animation-delay: 0.05s; }
.ai-float-group .card:nth-child(2) { animation-delay: 0.12s; }
.ai-float-group .card:nth-child(3) { animation-delay: 0.19s; }


/* ── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-label,
  .title-line-1,
  .hero-desc {
    animation: fadeUp 0.3s ease 0.1s forwards;
  }
  .title-line-2 {
    animation: fadeUp 0.3s ease 0.2s forwards;
    filter: none !important;
    text-shadow: none !important;
  }
  body.shore .title-line-2 {
    animation: fadeUp 0.3s ease 0.2s forwards;
  }
  .card-inner,
  .card-img {
    transition: none;
  }
  .wip-badge {
    transition: none;
    filter: none;
  }
  .ai-float-group .card {
    animation: none;
    opacity: 1;
  }
}
