/* ================================================
   Theme registration
   One inherited value keeps the page components in sync.
   ================================================ */

@property --theme-darkness {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

/* ================================================
   Colors — page palette and theme modes
   ================================================ */

:root {
  --theme-darkness: 0%;
  /* Unmixed endpoints also supply the browser's theme-color metadata. */
  --bg-light: #f2f1ec;
  --bg-dark: #151515;
  --bg: color-mix(in srgb, var(--bg-light), var(--bg-dark) var(--theme-darkness));
  --surface: color-mix(in srgb, #e9e8e1, #1d1d1c var(--theme-darkness));
  --text: color-mix(in srgb, #232321, #efefeb var(--theme-darkness));
  --muted: color-mix(in srgb, #62625b, #a1a19c var(--theme-darkness));
  --faint: color-mix(in srgb, #6c6c64, #96968f var(--theme-darkness));
  --line: color-mix(in srgb, #cecdc5, #3a3a37 var(--theme-darkness));
  --red: color-mix(in srgb, #c9322c, #e43c35 var(--theme-darkness));
  --error-text: color-mix(in srgb, #b52b25, #f07167 var(--theme-darkness));
  --hover-text: color-mix(in srgb, #000, #fff var(--theme-darkness));
}

/* ================================================
   System color preference
   ================================================ */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --theme-darkness: 100%;
  }
}

:root[data-theme="light"] {
  --theme-darkness: 0%;
}

:root[data-theme="dark"] {
  --theme-darkness: 100%;
}

/* ================================================
   Colors — surfaces and interaction states
   ================================================ */

:root {
  --header-bg: color-mix(in srgb, var(--bg) 80%, transparent);
  --header-bg-safari: color-mix(in srgb, var(--bg) 95%, transparent);
  --surface-selected: color-mix(in srgb, #e4e3dc, #242423 var(--theme-darkness));
  --surface-hover: color-mix(in srgb, #eae9e2, #20201f var(--theme-darkness));
  --showcase-bg: color-mix(in srgb, #d5d5d5, #303030 var(--theme-darkness));
  --portfolio-image-bg: #232321;
  --popover-bg: color-mix(in srgb, #faf9f5, #242422 var(--theme-darkness));
  --popover-border: color-mix(in srgb, #c5c4ba, #4a4a44 var(--theme-darkness));
  --popover-shadow: color-mix(in srgb, #23232118, #0004 var(--theme-darkness));
  --overlay-scrim: color-mix(in srgb, var(--bg) 65%, transparent);
  --overlay-blur: 4px;
}

/* ================================================
   Colors — timeline and control rulers
   ================================================ */

:root {
  --ruler-major: color-mix(in srgb, #98988e, #696962 var(--theme-darkness));
  --ruler-highlight: color-mix(in srgb, #53534c, #c2c2b7 var(--theme-darkness));
}

/* ================================================
   Colors — hero artwork
   Normalized sRGB channels (0–1), read by the WebGL renderer.
   Keep the original precision rather than rounding these colors to hex.
   ================================================ */

:root {
  --hero-ink-light-rgb: 0.12 0.12 0.115;
  --hero-ink-dark-rgb: 0.92 0.92 0.90;
}

/* ================================================
   Spacing — shared pixel values
   Names reflect the existing pixel values; fine increments are preserved.
   Zero resets and auto alignment stay explicit at their point of use.
   ================================================ */

/* ================================================
   Compact spacing
   ================================================ */

:root {
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-5: 5px;
  --space-6: 6px;
  --space-7: 7px;
  --space-8: 8px;
  --space-9: 9px;
  --space-10: 10px;
  --space-11: 11px;
  --space-12: 12px;
  --space-14: 14px;
  --space-15: 15px;
  --space-16: 16px;
}

/* ================================================
   Medium spacing
   ================================================ */

:root {
  --space-18: 18px;
  --space-20: 20px;
  --space-22: 22px;
  --space-23: 23px;
  --space-24: 24px;
  --space-25: 25px;
  --space-26: 26px;
  --space-27: 27px;
  --space-28: 28px;
  --space-29: 29px;
  --space-30: 30px;
  --space-32: 32px;
  --space-35: 35px;
  --space-36: 36px;
  --space-37: 37px;
  --space-40: 40px;
  --space-43: 43px;
  --space-44: 44px;
}

/* ================================================
   Large spacing
   ================================================ */

:root {
  --space-48: 48px;
  --space-52: 52px;
  --space-54: 54px;
  --space-56: 56px;
  --space-64: 64px;
  --space-84: 84px;
  --space-88: 88px;
}

/* ================================================
   Spacing — proportional gaps
   Percentage and em values retain their original layout and text contexts.
   ================================================ */

:root {
  --layout-gap-wide: 9%;
  --layout-gap-medium: 7%;
  --layout-gap-tight: 6%;
  --side-project-intro-gap: 1.6em;
}

/* ================================================
   Spacing — optical alignment
   Preserve the numeral overhang and native slider-thumb centering.
   ================================================ */

:root {
  --experience-count-offset: -0.075em;
  --hero-slider-thumb-width: 10px;
  --hero-slider-thumb-offset: -11.5px;
}

/* ================================================
   Layout gutters and section spacing
   ================================================ */

:root {
  --gutter: clamp(var(--space-24), 4.45vw, 80px);
  --header-height: 80px;
  --section-spacing: 120px;
}

/* ================================================
   Typography — family and weights
   ================================================ */

:root {
  --font: "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
}

/* ================================================
   Typography — small text
   One continuous ramp from 390px to 1440px at the default root size.
   rem bounds preserve the browser's text-size setting.
   ================================================ */

:root {
  --type-step: clamp(0rem, calc((100vw - 24.375rem) / 65.625), 1rem);
  --font-size-micro: calc(0.625rem + var(--type-step) / 16);
  /* 10–11 */
  --font-size-caption: calc(0.6875rem + var(--type-step) / 16);
  /* 11–12 */
  --font-size-small-compact: calc(0.75rem + var(--type-step) / 16);
  /* 12–13 */
  --font-size-small: calc(0.8125rem + var(--type-step) / 16);
  /* 13–14 */
  --font-size-body-compact: calc(0.875rem + var(--type-step) / 16);
  /* 14–15 */
  --font-size-body: calc(0.875rem + var(--type-step) / 8);
  /* 14–16 */
  --font-size-icon: calc(1.125rem + var(--type-step) / 8);
  /* 18–20 */
}

/* ================================================
   Typography — display roles
   These scale continuously; layout breakpoints never replace them.
   ================================================ */

:root {
  --font-size-hero: clamp(2.125rem, calc(1.2429rem + 3.619vw), 5.5rem);
  --font-size-hero-description: clamp(1.125rem, 1.4vw, 1.375rem);
  --font-size-section-title: clamp(2.75rem, 4.2vw, 4.25rem);
  --font-size-skills-title: clamp(2.75rem, 4.8vw, 4.75rem);
  --font-size-project-title: clamp(2rem, 2.3vw, 2.375rem);
  --font-size-timeline-title: clamp(2.125rem, 3.3vw, 3.0625rem);
  --font-size-accordion-title: clamp(1.75rem, 2.2222vw, 2rem);
  --font-size-project-tab: clamp(1.0625rem, 1.8vw, 1.6875rem);
  --font-size-side-projects-title: clamp(2.625rem, 4.7372vw, 5.25rem);
  --font-size-experience: clamp(10rem, calc(7.9464rem + 10.2679vw), 18.125rem);
}

/* ================================================
   Typography — popover titles
   Independent fluid role: 1.375–1.4375rem (22–23px at the default root size).
   ================================================ */

:root {
  --font-size-popover-title: calc(1.375rem + var(--type-step) / 16);
}

/* ================================================
   Motion
   ================================================ */

:root {
  --ease: cubic-bezier(0.2, 0.65, 0.3, 1);
  --theme-fade-duration: 600ms;
}

/* ================================================
   Work reader and project index controls
   ================================================ */

:root {
  --picker-ease: cubic-bezier(.16, 1, .3, 1);
  --picker-control: 48px;
}

/* ================================================
   Career timeline — company colors
   Keep these scoped so each company's descendants inherit its own color.
   ================================================ */

.career-timeline {
  --career-color: var(--text);
}

.career-timeline [data-company="Netflix"],
.career-timeline [data-company="MinoiaGroup"] {
  --career-color: color-mix(in srgb, #d43129, #eb3d35 var(--theme-darkness));
}

.career-timeline [data-company="Lukibear"] {
  --career-color: color-mix(in srgb, #285fc4, #518aed var(--theme-darkness));
}

.career-timeline [data-company="Shootfolio"] {
  --career-color: color-mix(in srgb, #11857d, #3fbdb0 var(--theme-darkness));
}

.career-timeline [data-company="Uncle Pear"] {
  --career-color: color-mix(in srgb, #2e813c, #6db258 var(--theme-darkness));
}

.career-timeline [data-company="Timmagine"] {
  --career-color: color-mix(in srgb, #137fab, #58b8e2 var(--theme-darkness));
}

.career-timeline [data-company="Mindflow"] {
  --career-color: color-mix(in srgb, #c27020, #e19650 var(--theme-darkness));
}

.career-popover,
.career-indicator {
  --career-accent: var(--career-color);
}

/* ================================================
   Career timeline — tracks, ruler and popover
   JavaScript updates measured positions and interaction values at runtime.
   ================================================ */

.career-timeline {
  --career-row: 44px;
  --career-reveal-inset: var(--space-8);
}

.career-span {
  --track-opacity: 0.88;
  --track-emphasis: 1;
}

.career-tick {
  --tick-height: 9px;
  --tick-color: var(--line);
}

.career-tick-half {
  --tick-height: 15px;
}

.career-tick-year {
  --tick-height: 23px;
  --tick-color: var(--ruler-major);
}

.career-popover {
  --popover-gap: var(--space-14);
  --popover-viewport-margin: var(--space-12);
}

/* ================================================
   Responsive layout overrides
   ================================================ */

/* ================================================
   Responsive layout — (max-width: 1100px)
   ================================================ */

@media (max-width: 1100px) {
  .work-section {
    --heading-columns: 2fr 4fr 5fr;
    --project-columns: 7fr 5fr;
  }
}

/* ================================================
   Responsive layout — (max-width: 800px)
   ================================================ */

@media (max-width: 800px) {
  :root {
    --gutter: var(--space-28);
  }
}

/* ================================================
   Responsive layout — (max-width: 560px)
   ================================================ */

@media (max-width: 560px) {
  :root {
    --gutter: var(--space-22);
  }
}
