:root {
  --bg: #edecef;
  --card: #f6f6f6;
  --text: #323232;
  --black: #000000;
  --grey-1: #6b6b6b;
  --white: #ffffff;
  --border: #e5e5e5;
  --font: "Inter Tight", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --pad-x: 80px;
  --accent: #b91c1c;
  /* semantic tokens (light) */
  --muted: #555555;
  --card-hover: #f9f9f9;
  --card-border: #ffffff;
  --surface: #ffffff;
  --thumb-bg: #ffffff;
  --media-bg: #e3e3e6;
  --hover-bg: #f3f3f5;
  --btn-hover-bg: #111111;
  --btn-hover-fg: #ffffff;
  --icon-filter: none;
  --icon-hover-filter: invert(1);
  --shadow: rgba(30, 30, 50, .3);
  --blur-bg: rgba(237, 236, 239, .55);
  --bar-bg: rgba(237, 236, 239, .8);
  --dot-off: rgba(50, 50, 50, .14);
  --line: #ffffff;
  --mark-color: rgba(0, 0, 0, .035); --vmark-color: rgba(0, 0, 0, .06);
  --back-bg: #5b5b5e;
  --back-hover: #323232;
  --trail-rgb: 185, 28, 28;
  --divider-opacity: 1;
  color-scheme: light;
}

/* ---------- Dark theme: follows the OS unless the visitor picked a theme ---------- */
/* Text contrast on --bg / --card: --black 17:1, --text 14:1, --grey-1 7:1, --muted 10:1, --accent 6:1 (WCAG AA ≥ 4.5) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141416; --card: #1c1c1f; --text: #e4e4e7; --black: #f4f4f5; --grey-1: #a1a1aa; --muted: #c4c4cc;
    --border: #34343a; --accent: #f87171;
    --card-hover: #212125; --card-border: #26262b; --surface: #232327; --thumb-bg: #26262b; --media-bg: #26262b;
    --hover-bg: #2c2c31; --btn-hover-bg: #f4f4f5; --btn-hover-fg: #111111;
    --icon-filter: invert(1); --icon-hover-filter: none;
    --shadow: rgba(0, 0, 0, .6); --blur-bg: rgba(20, 20, 22, .55); --bar-bg: rgba(20, 20, 22, .82);
    --dot-off: rgba(255, 255, 255, .18); --line: rgba(255, 255, 255, .16); --mark-color: rgba(255, 255, 255, .045); --vmark-color: rgba(255, 255, 255, .075);
    --back-bg: #3a3a40; --back-hover: #52525a; --trail-rgb: 248, 113, 113; --divider-opacity: .22;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141416; --card: #1c1c1f; --text: #e4e4e7; --black: #f4f4f5; --grey-1: #a1a1aa; --muted: #c4c4cc;
  --border: #34343a; --accent: #f87171;
  --card-hover: #212125; --card-border: #26262b; --surface: #232327; --thumb-bg: #26262b; --media-bg: #26262b;
  --hover-bg: #2c2c31; --btn-hover-bg: #f4f4f5; --btn-hover-fg: #111111;
  --icon-filter: invert(1); --icon-hover-filter: none;
  --shadow: rgba(0, 0, 0, .6); --blur-bg: rgba(20, 20, 22, .55); --bar-bg: rgba(20, 20, 22, .82);
  --dot-off: rgba(255, 255, 255, .18); --line: rgba(255, 255, 255, .16); --mark-color: rgba(255, 255, 255, .045); --vmark-color: rgba(255, 255, 255, .075);
  --back-bg: #3a3a40; --back-hover: #52525a; --trail-rgb: 248, 113, 113; --divider-opacity: .22;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; scrollbar-gutter: stable; }

/* Smooth page-to-page navigation (Chrome/Edge/Safari 18+); the header stays put */
@view-transition { navigation: auto; }
.header { view-transition-name: site-header; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
body { overscroll-behavior: none; background: var(--bg); color: var(--text); font-family: var(--font); }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* Header */
.header { position: sticky; top: 0; z-index: 10; background: var(--bg); height: 64px; display: flex; align-items: center; padding: 0 var(--pad-x); }
.header__inner { width: 100%; max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; white-space: nowrap; }
.logo { font-family: var(--serif); font-size: 34px; font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
.nav { display: flex; gap: 52px; font-size: 18px; }
.nav a { transition: opacity .2s; }
.nav a:hover { opacity: .6; }

/* Layout */
.container { padding: 40px var(--pad-x) 60px; min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); display: flex; flex-direction: column; justify-content: center; }
.layout { width: 100%; max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }

/* Intro column */
.intro { width: 419px; flex-shrink: 0; display: flex; flex-direction: column; gap: 37px; position: sticky; top: 104px; }
.hero { display: flex; align-items: center; gap: 15px; }

.avatar { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

.greeting { flex: 1 1 auto; min-width: 0; }
.greeting__text { margin-left: 4px; display: flex; flex-direction: column; font-weight: 400; color: var(--black); }
/* Line 1: "Chloe" (large, roman) + "as a" (small, italic) */
.greeting__lead { font-family: var(--serif); font-size: 36px; line-height: 1.1; letter-spacing: -0.01em; }
.greeting__lead em { font-style: italic; }
.greeting__small { font-size: 26px; font-style: italic; }

.divider { width: 100%; height: 1px; opacity: var(--divider-opacity); }

.about { display: flex; flex-direction: column; gap: 16px; }
/* Same style as the description paragraph below it */
.about__headline { font-family: var(--font); font-size: 16px; font-weight: 300; line-height: 1.5; color: var(--text); }
.about__text { font-size: 16px; font-weight: 300; line-height: 1.5; }
.stats { display: flex; gap: 12px; line-height: 1.3; }
.stat { flex: 1 0 0; min-width: 0; }
.stat__num { font-size: 36px; color: var(--black); }
.stat__label { font-size: 14px; font-weight: 300; color: var(--text); }

.contact { display: flex; flex-direction: column; gap: 9px; }
.about__text + .contact { margin-top: 20px; }
.contact__title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 20px; line-height: 1.2; color: var(--black); }
.socials { display: flex; gap: 12px; }
.social { background: #ffffff; padding: 8px; border-radius: 8px; }

/* Projects column */
.projects { width: 778px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 24px; padding: 6px; }
.card--h { display: flex; gap: 16px; }
.card__info { flex: 1 0 0; min-width: 0; padding: 16px 0 16px 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.card__text { display: flex; flex-direction: column; gap: 12px; line-height: 1.3; }
.card__tag { font-size: 14px; color: var(--grey-1); }
.card__title { font-size: 19px; font-weight: 600; color: var(--black); }
.card__desc { font-size: 14px; font-weight: 300; color: var(--grey-1); }

.btn { align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 48px; padding: 4px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 36px; font-size: 18px; font-weight: 500; color: var(--black); }
.btn img { filter: var(--icon-filter); }
.btn--icon { padding: 4px 12px; position: absolute; top: 12px; right: 12px; }

.thumb { position: relative; overflow: hidden; border-radius: 20px; }
.thumb--h { flex: 1 0 0; min-width: 0; height: 230px; }

.shot { position: absolute; width: 136px; border-radius: 24px; overflow: hidden; }
.shot img { position: absolute; max-width: none; }
.shot img.cover { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot--flat { border-radius: 0; }

/* Phone mockup (home, tutor card): screens cross-fade in place (script.js) */
.phone {
  /* iPhone 17-like: thin even bezel, corner radius ≈ 14% of the width.
     Sized so about 3/4 of the screen shows above the card edge (thumb is 230px tall). */
  position: absolute; left: 50%; top: 24px; width: 122px; transform: translateX(-50%);
  padding: 4px; border-radius: 19px; background: #1d1d1f;
  box-shadow: inset 0 0 0 1px #3a3a3d, 0 18px 40px -12px rgba(0, 0, 0, .35);
}
.phone__screen { position: relative; aspect-ratio: 375 / 812; border-radius: 15px; overflow: hidden; background: #fff; }
.phone__screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease; }
.phone__screen img.is-on { opacity: 1; }
.phone__island { position: absolute; top: 5px; left: 50%; width: 28%; height: 8px; transform: translateX(-50%); border-radius: 10px; background: #0b0b0c; }

/* Scroll progress: borderless frame with a soft progressive blur.
   Takes no layout space (negative margin = height + column gap) and stays hidden at 0%. */
.progress {
  position: sticky; top: 64px; z-index: 5;
  display: flex; justify-content: flex-end; align-items: flex-start;
  height: 64px; margin: 0 0 -84px; padding: 14px 4px 0;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .4s ease, visibility 0s linear .4s;
}
.progress.is-visible { opacity: 1; visibility: visible; transition: opacity .4s ease, visibility 0s; }
.progress::before,
.progress::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.progress::before {
  background: var(--blur-bg);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent);
          mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
.progress::after {
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent 65%);
          mask-image: linear-gradient(to bottom, #000 25%, transparent 65%);
}
.progress__meter { display: flex; align-items: center; gap: 12px; }
.progress__pct { font-size: 13px; color: var(--grey-1); white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress__pct b { display: inline-block; min-width: 3.2ch; text-align: center; font-weight: 500; color: var(--text); }
.progress__dots { display: flex; gap: 6px; }
.progress__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--dot-off); transition: background-color .4s ease; }
.progress__dots i.on { background: var(--text); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card--v { display: flex; flex-direction: column; gap: 16px; }
.thumb--v { background: var(--thumb-bg); aspect-ratio: 520 / 321; width: 100%; }
.card__info--v { position: relative; padding: 12px; justify-content: flex-start; }
.card__info--v .card__tag,
.card__info--v .card__title { padding-right: 64px; }

/* Tablet: stack columns */
@media (max-width: 1240px) {
  :root { --pad-x: 40px; }
  .layout { flex-direction: column; align-items: stretch; }
  .intro { position: static; width: 100%; max-width: 560px; }
  .projects { width: 100%; }
}

/* Mobile */
@media (max-width: 720px) {
  :root { --pad-x: 16px; }
  .logo { font-size: 24px; }
  .container { padding-top: 24px; }
  .layout { gap: 32px; }
  .intro { gap: 28px; }
  .hero { gap: 8px; }
  .avatar { width: 128px; height: 128px; }
  .greeting { transform-origin: left center; }

  .card--h { flex-direction: column-reverse; }
  .card--h .card__info { padding: 12px; }
  .thumb--h { flex: none; height: 230px; }
  .grid { grid-template-columns: 1fr; gap: 20px; }
  .progress__meter { gap: 8px; }
  .progress__dots { gap: 4px; }
  .progress__dots i { width: 5px; height: 5px; }
}


/* ---------- Interactions (kept subtle) ---------- */


/* Typewriter */
/* Line 2: "Product" (roman) "Designer" (italic) — same serif (Instrument Serif), red, typed */
.typewriter { display: block; font-family: var(--serif); font-size: 36px; font-weight: 400; line-height: 1.1; letter-spacing: -0.01em; color: var(--accent); white-space: nowrap; }
.typewriter__line { display: block; min-height: 1.1em; }
/* "Product Designer" a bit bolder: the serif (Instrument Serif fallback) has a
   single weight, so a thin stroke in the text colour thickens it evenly. */
.typewriter__line { -webkit-text-stroke: .022em currentColor; paint-order: stroke fill; }
.typewriter em { font-style: italic; }
.typewriter__caret { margin-left: 1px; font-weight: 300; animation: caret-blink 1s infinite; }
@keyframes caret-blink { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* Project cards */
/* Case study still in progress: faded and not interactive */
.card--wip { opacity: .2; pointer-events: none; }
.card { transition: transform .5s ease, box-shadow .5s ease, background-color .4s ease; }
.card:hover { transform: translateY(-2px); background: var(--card-hover); box-shadow: 0 10px 28px -20px var(--shadow); }

.card .btn { transition: background-color .3s ease, border-color .3s ease, color .3s ease; }
.card .btn img { transition: transform .4s ease, filter .3s ease; }
.btn:hover { transform: none; }
.card:hover .btn { background: var(--btn-hover-bg); border-color: var(--btn-hover-bg); color: var(--btn-hover-fg); }
.card:hover .btn img { transform: translate(1px, -1px); filter: var(--icon-hover-filter); }

.social { transition: transform .3s ease; }
.social:hover { transform: translateY(-1px); }

@media (hover: none) {
  .card:hover { transform: none; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .card .btn img, .progress { transition: none; }
  .typewriter__caret { animation: none; }
}

/* Whole card is clickable when it links to a case study (the EXPLORE link is stretched over the card) */
.card--link { position: relative; cursor: pointer; }
.card--link .btn::after { content: ""; position: absolute; inset: 0; border-radius: 24px; }
.card--link .btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* ---------- Mobile header: hamburger + dropdown ---------- */
.nav-toggle { display: none; }
@media (max-width: 720px) {
  .header__inner { position: relative; }
  .nav-toggle {
    display: grid; place-content: center; gap: 4px;
    width: 40px; height: 40px; margin-right: -8px; padding: 0;
    background: none; border: 0; border-radius: 10px; color: var(--text); cursor: pointer;
  }
  .nav-toggle span { display: block; width: 20px; height: 1.5px; border-radius: 1px; background: currentColor; transition: transform .3s ease, opacity .2s ease; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
  .nav-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

  .nav {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 30;
    flex-direction: column; gap: 2px; min-width: 200px; padding: 8px;
    font-size: 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    box-shadow: 0 16px 36px -18px var(--shadow);
    opacity: 0; visibility: hidden; translate: 0 -6px;
    transition: opacity .25s ease, translate .25s ease, visibility 0s linear .25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; translate: 0 0; transition: opacity .25s ease, translate .25s ease, visibility 0s; }
  .nav a { padding: 12px 14px; border-radius: 10px; }
  .nav a:hover { opacity: 1; background: var(--hover-bg); }
  .nav a[aria-current="page"] { background: var(--hover-bg); }
}
@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .nav, .nav-toggle span { transition: none; }
}

/* ---------- Home (mobile): full-screen intro + animated scroll hint ---------- */
.scroll-hint { display: none; }
@media (max-width: 720px) {
  html { scroll-behavior: smooth; }
  /* fill the first screen below the sticky header (64px) and the container's top padding (24px) */
  .intro { min-height: calc(100vh - 88px); min-height: calc(100svh - 88px); }
  .projects { scroll-margin-top: 64px; }
  /* icon only, pinned to the bottom of the first screen so it is never cut off;
     hidden as soon as the page is scrolled (script.js) */
  .scroll-hint {
    position: fixed; left: 50%; bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px)); z-index: 15;
    display: grid; place-items: center;
    width: 44px; height: 44px; translate: -50% 0;
    color: var(--text);
    transition: opacity .35s ease, visibility 0s linear .35s;
  }
  .scroll-hint svg { width: 26px; height: 26px; animation: hint-down 1.8s cubic-bezier(.45, 0, .55, 1) infinite; }
  .scroll-hint.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
  .scroll-hint:not(.is-hidden) { transition: opacity .35s ease, visibility 0s; }
}
/* arrow travels downward, fades out at the bottom and re-enters from the top */
@keyframes hint-down {
  0%   { transform: translateY(-14px); opacity: 0; }
  25%  { transform: translateY(-2px);  opacity: 1; }
  65%  { transform: translateY(4px);   opacity: 1; }
  100% { transform: translateY(16px);  opacity: 0; }
}
@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-hint svg { animation: none; }
}

/* ---------- Theme toggle (light / dark) ---------- */
.nav { margin-left: auto; }
.theme-toggle {
  display: grid; place-items: center; flex-shrink: 0;
  width: 40px; height: 40px; margin-left: 28px; margin-right: -8px; padding: 0;
  background: none; border: 0; border-radius: 50%; color: var(--text); cursor: pointer;
  transition: background-color .25s ease;
}
.theme-toggle:hover { background: var(--hover-bg); }
.theme-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }
@media (max-width: 720px) {
  /* mobile header: logo … [theme] [menu] */
  .theme-toggle { order: 1; margin-left: auto; margin-right: 0; }
  .nav-toggle { order: 2; margin-left: 4px; }
}

/* ---------- Desktop: the intro is a fixed, viewport-tall frame ----------
   It must never be taller than the screen, otherwise the sticky column
   scrolls away and jumps. Spacing and sizes shrink with the viewport height. */
@media (min-width: 1241px) {
  .container { padding-bottom: 24px; }
  .intro {
    /* sticks exactly where it starts (64px header + 40px container padding),
       and stays clear of the container bottom padding, so it never moves */
    top: 104px;
    height: calc(100vh - 128px); height: calc(100svh - 128px);
    box-sizing: border-box;
    justify-content: flex-start; /* top-aligned with the project cards */
    gap: clamp(10px, 3.4vh, 37px);
  }
  .avatar { width: clamp(96px, 17vh, 160px); height: clamp(96px, 17vh, 160px); }
  .about__text + .contact { margin-top: clamp(4px, 2vh, 20px); }
  .stat__num { font-size: clamp(26px, 4vh, 36px); }
}
/* Very short screens: not enough room for a fixed frame — let it scroll normally */
@media (min-width: 1241px) and (max-height: 660px) {
  .intro { position: static; height: auto; }
}

/* ---------- Custom cursor (all pages) — dot + trailing ring, like monoform ----------
   Desktop (mouse) only; touch and reduced-motion keep the system cursor. */
html.has-cursor, html.has-cursor *:not(input):not(textarea):not(select) { cursor: none !important; }
/* no position / z-index on the wrapper: it must not isolate the blend mode */
.cursor:not(.is-on) .cursor__part { opacity: 0 !important; }
.cursor__part { position: fixed; inset: 0 auto auto 0; z-index: 250; pointer-events: none; mix-blend-mode: difference; will-change: transform; }
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; transition: opacity .3s ease; }
.cursor__ring {
  --size: 40px;
  display: flex; align-items: center; justify-content: center;
  width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  border: 1px solid #fff; border-radius: 50%; box-sizing: border-box; background: rgba(255, 255, 255, 0);
  transition: width .5s cubic-bezier(.16, 1, .3, 1), height .5s cubic-bezier(.16, 1, .3, 1), margin .5s cubic-bezier(.16, 1, .3, 1),
              background-color .5s cubic-bezier(.16, 1, .3, 1), border-color .5s cubic-bezier(.16, 1, .3, 1);
}
.cursor__label {
  opacity: 0; transform: scale(.6);
  color: var(--bg); font-family: var(--font); font-size: 14px; font-weight: 500; line-height: 1.5; letter-spacing: .04em; text-transform: uppercase;
  transition: opacity .4s cubic-bezier(.16, 1, .3, 1), transform .4s cubic-bezier(.16, 1, .3, 1);
}
/* links & buttons: bigger filled ring (inverts what is under it), no dot */
.cursor[data-state="hover"] .cursor__ring { --size: 64px; background: #fff; }
.cursor[data-state="hover"] .cursor__dot,
.cursor[data-state="view"] .cursor__dot { opacity: 0; }
/* project cards: solid circle with a label */
.cursor[data-state="view"] .cursor__ring-wrap { mix-blend-mode: normal; }
.cursor[data-state="view"] .cursor__ring { --size: 104px; background: var(--black); border-color: var(--black); }
.cursor[data-state="view"] .cursor__label { opacity: 1; transform: scale(1); }

/* current page in the header menu */
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
