/* ============================================================
   TIA PORTFOLIO — DESIGN SYSTEM
   Tony Ignatious Ambrose
   ============================================================ */

/* ---- FONTS ------------------------------------------------ */
/* Funnel Display + JetBrains Mono load from Google Fonts in the HTML <head>.
   Overused Grotesk is self-hosted. Drop the .woff2 files into
   assets/fonts/ and these rules pick them up automatically.
   Until then, the fallback stack keeps the site looking correct. */

@font-face {
  font-family: 'Overused Grotesk';
  src: url('../fonts/OverusedGrotesk-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Overused Grotesk';
  src: url('../fonts/OverusedGrotesk-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

/* ---- PRIMITIVES ------------------------------------------- */
:root {
  /* colour primitives */
  --paper-100: #F5F3EF;
  --paper-200: #EDEBE6;
  --paper-300: #DCDAD4;
  --graphite-400: #8A8880;
  --graphite-700: #3A3A36;
  --graphite-900: #1C1C1A;
  --signal-500: #FF5C00;
  --signal-100: #FFE4D2;
  --white: #FFFFFF;

  /* semantic colour */
  --surface-base: var(--paper-200);
  --surface-raised: var(--paper-100);
  --surface-sunken: var(--paper-300);
  --surface-inverse: var(--graphite-900);

  --text-primary: var(--graphite-900);
  --text-secondary: var(--graphite-400);
  --text-inverse: var(--paper-200);
  --text-accent: var(--signal-500);

  --border-hairline: rgba(138, 136, 128, 0.3);
  --border-highlight: rgba(255, 255, 255, 0.5);

  /* spacing */
  --space-4: 4px;
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-40: 40px;
  --space-64: 64px;
  --space-96: 96px;
  --space-160: 160px;

  /* radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-pill: 999px;

  /* type families */
  --font-display: 'Funnel Display', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Overused Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* layout */
  --gutter: 24px;
  --margin: 64px;
  --nav-height: 64px;
}

/* ---- RESET ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; padding: 0; cursor: pointer; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

/* ---- LAYOUT ----------------------------------------------- */
.section {
  padding: var(--space-160) 0;
  width: 100%;
  position: relative;
}
.section.is-sunken { background: var(--surface-sunken); }
.section.is-inverse { background: var(--surface-inverse); color: var(--text-inverse); }
.section.is-flush { padding: 0; }
.section.is-tight { padding: var(--space-96) 0; }

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--margin);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.col-1-3   { grid-column: 1 / 4; }
.col-1-4   { grid-column: 1 / 5; }
.col-1-6   { grid-column: 1 / 7; }
.col-1-8   { grid-column: 1 / 9; }
.col-1-12  { grid-column: 1 / 13; }
.col-2-10  { grid-column: 2 / 11; }
.col-3-10  { grid-column: 3 / 11; }
.col-4-10  { grid-column: 4 / 11; }
.col-5-8   { grid-column: 5 / 9; }
.col-5-10  { grid-column: 5 / 11; }
.col-7-12  { grid-column: 7 / 13; }
.col-8-12  { grid-column: 8 / 13; }
.col-9-12  { grid-column: 9 / 13; }

.stack { display: flex; flex-direction: column; }
.stack.is-gap-4   { gap: var(--space-4); }
.stack.is-gap-8   { gap: var(--space-8); }
.stack.is-gap-16  { gap: var(--space-16); }
.stack.is-gap-24  { gap: var(--space-24); }
.stack.is-gap-40  { gap: var(--space-40); }
.stack.is-gap-64  { gap: var(--space-64); }

.row { display: flex; flex-direction: row; align-items: center; }
.row.is-between { justify-content: space-between; }
.row.is-gap-16 { gap: var(--space-16); }
.row.is-gap-24 { gap: var(--space-24); }

/* ---- TYPOGRAPHY ------------------------------------------- */
.label {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--text-secondary);
  margin: 0;
}
.label.is-sm { font-size: 10px; line-height: 14px; }
.label.is-lg { font-size: 13px; line-height: 20px; letter-spacing: 0.04em; color: var(--text-primary); }
.label.is-accent { color: var(--text-accent); }
.label.is-inverse { color: var(--text-inverse); }

.data {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 16px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  margin: 0;
}

.body-text {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 26px;
  color: var(--text-primary);
  margin: 0;
}
.body-text.is-lg { font-size: 18px; line-height: 30px; }
.body-text.is-secondary { color: var(--text-secondary); }
.body-text.is-inverse { color: var(--text-inverse); }
.body-text + .body-text { margin-top: var(--space-24); }

.heading {
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}
.heading.is-xl { font-size: 140px; line-height: 118px; letter-spacing: 0.01em; }
.heading.is-lg { font-size: 96px;  line-height: 88px;  letter-spacing: 0.015em; }
.heading.is-md { font-size: 48px;  line-height: 52px;  letter-spacing: 0.02em; }
.heading.is-sm { font-size: 28px;  line-height: 32px;  letter-spacing: 0.03em; }
.heading.is-secondary { color: var(--text-secondary); }
.heading.is-inverse { color: var(--text-inverse); }

/* ---- SEAM ------------------------------------------------- */
.seam {
  width: 100%;
  height: 2px;
  display: flex;
  flex-direction: column;
  flex: none;
}
.seam::before {
  content: '';
  display: block;
  height: 1px;
  background: var(--border-hairline);
}
.seam::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--border-highlight);
}
.seam.is-inverse::before { background: rgba(255,255,255,0.15); }
.seam.is-inverse::after  { background: rgba(0,0,0,0.3); }

/* ---- LED -------------------------------------------------- */
.led {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--graphite-400);
  opacity: 0.25;
  transition: all 200ms ease;
  flex: none;
}
.led.is-on {
  background: var(--signal-500);
  opacity: 1;
  box-shadow: 0 0 8px rgba(255, 92, 0, 0.6);
}

/* ---- TOGGLE ----------------------------------------------- */
.toggle {
  width: 48px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-shadow: inset 0 1px 2px rgba(28, 28, 26, 0.2);
  cursor: pointer;
  transition: background 180ms ease-out, justify-content 180ms ease-out;
  flex: none;
}
.toggle.is-on {
  background: var(--signal-500);
  justify-content: flex-end;
}
.toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  box-shadow: 0 1px 2px rgba(28, 28, 26, 0.2);
  transition: all 180ms ease-out;
}

/* ---- SCREEN ----------------------------------------------- */
.screen {
  background: var(--surface-inverse);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
.screen .data { color: var(--text-inverse); }

/* ---- BUTTON ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  transition: all 200ms ease;
}
.btn:hover {
  border-color: var(--signal-500);
  background: var(--signal-100);
  color: var(--signal-500);
}

/* ---- NAV -------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 100;
  padding: 0 var(--margin);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(237, 235, 230, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--border-hairline);
}
.nav-mark {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}
.nav-mark sup { font-size: 60%; vertical-align: super; }
.nav-links { display: flex; gap: var(--space-24); }
.nav-link { transition: color 200ms ease; }
.nav-link:hover, .nav-link.is-active { color: var(--text-accent); }
.nav-right { display: flex; align-items: center; gap: var(--space-16); }

/* ---- HERO ------------------------------------------------- */
.hero {
  height: 100vh;
  min-height: 640px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: var(--margin);
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-base);
}
.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-media video.is-hidden { display: none; }
.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-40);
}
.hero-title { display: flex; flex-direction: column; }
.hero-audio { display: flex; align-items: center; gap: var(--space-16); }

.status-strip {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  padding: var(--space-16) var(--margin);
  display: flex;
  justify-content: space-between;
  z-index: 2;
  pointer-events: none;
}

/* ---- PROJECT ROWS ----------------------------------------- */
.project-list { display: flex; flex-direction: column; }
.project-row {
  display: flex;
  align-items: center;
  padding: var(--space-24) 0;
  width: 100%;
  cursor: pointer;
}
.project-row-num  { width: 72px;  flex: none; transition: color 300ms ease; }
.project-row-name { flex: 1; transition: transform 300ms ease, color 300ms ease; }
.project-row-tags { width: 260px; flex: none; }
.project-row-year { width: 64px;  flex: none; text-align: right; transition: color 300ms ease; }

.project-row:hover .project-row-num,
.project-row:hover .project-row-year { color: var(--text-accent); }
.project-row:hover .project-row-name { transform: translateX(8px); }

/* ---- META LIST -------------------------------------------- */
.meta-list { display: flex; flex-direction: column; }
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  gap: var(--space-16);
}
.meta-key   { width: 80px; flex: none; }
.meta-value { text-align: right; }

/* ---- CAPABILITIES ----------------------------------------- */
.cap-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr;
  gap: var(--gutter);
  padding: var(--space-24) 0;
  align-items: start;
}

/* ---- MEDIA BLOCKS ----------------------------------------- */
.media-full { width: 100%; margin-bottom: var(--space-16); }
.media-inset { grid-column: 3 / 11; }
.media-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
}
.media-caption { margin-top: var(--space-8); }

/* placeholder — remove once real assets are in */
.placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-sunken);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--text-secondary);
  text-align: center;
  padding: var(--space-24);
}
.placeholder.is-square { aspect-ratio: 1 / 1; }
.placeholder.is-portrait { aspect-ratio: 4 / 5; }

/* ---- RESULTS ---------------------------------------------- */
.result-value { font-family: var(--font-display); font-weight: 500; font-size: 72px; line-height: 72px; letter-spacing: 0.01em; }

/* ---- NEXT PROJECT ----------------------------------------- */
.next-project {
  display: block;
  width: 100%;
  transition: color 300ms ease;
}
.next-project:hover .heading { color: var(--signal-500); }

/* ---- CURSOR ----------------------------------------------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal-500);
  margin: -3px 0 0 -3px;
}
.cursor-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--signal-500);
  margin: -20px 0 0 -20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
}
.cursor-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--signal-500);
  white-space: nowrap;
}

/* ---- PRELOADER -------------------------------------------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--surface-base);
  display: flex;
  align-items: center;
  justify-content: center;
}
.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-16);
}
.preloader-count {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.preloader-bar {
  width: 160px;
  height: 2px;
  background: var(--surface-sunken);
  overflow: hidden;
}
.preloader-fill {
  width: 0%;
  height: 100%;
  background: var(--signal-500);
}

/* ---- REVEAL (set by GSAP) --------------------------------- */
.reveal { opacity: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ---- TABLET: 991px ---------------------------------------- */
@media (max-width: 991px) {
  :root {
    --margin: 32px;
    --gutter: 16px;
    --space-160: 96px;
  }
  .section { padding: var(--space-160) 0; }
  .heading.is-xl { font-size: 88px; line-height: 80px; }
  .heading.is-lg { font-size: 64px; line-height: 62px; }
  .heading.is-md { font-size: 36px; line-height: 42px; }
  .project-row-tags { width: 180px; }
  .result-value { font-size: 48px; line-height: 52px; }
}

/* ---- MOBILE LANDSCAPE / SMALL TABLET: 767px --------------- */
@media (max-width: 767px) {
  :root { --margin: 24px; --space-160: 80px; }
  .grid-12 { grid-template-columns: repeat(4, 1fr); }
  [class*="col-"] { grid-column: 1 / 5 !important; }
  .media-duo { grid-template-columns: 1fr; }
  .media-inset { grid-column: 1 / 5; }
  .heading.is-xl { font-size: 64px; line-height: 58px; }
  .heading.is-lg { font-size: 48px; line-height: 48px; }
}

/* ---- MOBILE: 479px ---------------------------------------- */
@media (max-width: 479px) {
  :root { --margin: 20px; --space-160: 80px; }

  .heading.is-xl { font-size: 48px; line-height: 46px; }
  .heading.is-lg { font-size: 40px; line-height: 40px; }
  .heading.is-md { font-size: 32px; line-height: 36px; }
  .heading.is-sm { font-size: 22px; line-height: 26px; }
  .body-text.is-lg { font-size: 16px; line-height: 26px; }

  /* nav: drop links, keep mark + clock */
  .nav { padding: 0 var(--margin); }
  .nav-links { display: none; }

  /* hero: video above, text below */
  .hero {
    height: auto;
    min-height: 0;
    padding: calc(var(--nav-height) + var(--space-24)) var(--margin) var(--space-40);
    flex-direction: column;
    align-items: stretch;
  }
  .hero-media {
    position: relative;
    inset: auto;
    width: 100%;
    aspect-ratio: 4 / 5;
    margin-bottom: var(--space-24);
  }
  .hero-content { flex-direction: column; align-items: stretch; gap: var(--space-24); }
  .hero-audio { justify-content: space-between; width: 100%; }
  .status-strip {
    position: relative;
    padding: var(--space-16) 0 0;
    flex-wrap: wrap;
    gap: var(--space-8);
  }

  /* project rows: two lines */
  .project-row {
    flex-wrap: wrap;
    padding: var(--space-24) 0;
    min-height: 72px;
    align-items: flex-start;
  }
  .project-row-num  { width: auto; order: 1; flex: 1; }
  .project-row-year { width: auto; order: 2; }
  .project-row-name { order: 3; flex: 0 0 100%; margin: var(--space-8) 0 var(--space-4); }
  .project-row-tags { order: 4; flex: 0 0 100%; width: auto; }
  .project-row:hover .project-row-name { transform: none; }

  /* capabilities stack */
  .cap-row { grid-template-columns: 1fr; gap: var(--space-8); }

  /* meta rows */
  .meta-row { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
  .meta-value { text-align: left; }

  .result-value { font-size: 40px; line-height: 44px; }

  /* no custom cursor on touch */
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---- ACCESSIBILITY ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

:focus-visible {
  outline: 2px solid var(--signal-500);
  outline-offset: 3px;
}
