/* ============ Fonts (self-hosted) ============ */
@font-face {
  font-family: "Young Serif";
  src: url("/assets/fonts/young-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
}

/* ============ Tokens (values from Figma "Desktop, final") ============ */
:root {
  --bg: #ffffff;
  --ink: #252525;
  --ink-2: #3d3d3d;
  --line: #252525;
  --line-w: 2px;
  --rule: rgba(61, 61, 61, .2);      /* 0.2px #3d3d3d in Figma */
  --tag: #767676;
  --tag-line: #767676;
  --row-line: #a75a3d;
  --accent: #a75a3d;                 /* labels, eyebrow, dividers */
  --accent-2: #e57b52;               /* location dot */
  --linkedin: #644bf4;
  --frame: #767676;
  --ink-mute: #767676;               /* Figma variables: ink-mute, rule, accent, accent-h, shadow-color */
  --rule-2: #b8b8b8;
  --accent-n: #e67042;
  --accent-h: #cf7b5b;
  --fact-label: #b9694a;
  --pill-bg: rgba(37, 37, 37, .68);   /* dark glass, more see-through than Figma's 80% light grey */
  --pill-ink: #e8e8e8;
  --pill-mute: #b8b8b8;
  --pill-line: rgba(255, 255, 255, .14);
  --hover: rgba(37, 37, 37, .07);
  --thumb-shadow: -3px 8px 22px rgba(83, 8, 8, .35);
  --thumb-stroke: rgba(37, 37, 37, .35);

  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --header-h: 62px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 86px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 20px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 400; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-2); color: #fff; }

/* Figma caps the content at 1800 wide */
main { max-width: 1800px; margin-inline: auto; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 892.5fr) minmax(0, 547.5fr); }
.grid-offset { grid-column: 2; }

.statement, .facts dt, h2, h3, .sub, .eyebrow, .work-label, .work-row .t {
  font-family: var(--serif);
  font-weight: 400;
}

/* ============ Header: floating pill (Figma "Pill nav") ============ */
/* keeps its 62px in the flow so the case pages sit where they did; the home hero pulls up under the pill */
.site-header { position: relative; z-index: 50; height: var(--header-h); }
.site-header + main > .hero:first-child { margin-top: calc(-1 * var(--header-h)); }
.navpill {
  --pill-w: 579px;   /* Figma's 449 plus the Resume item and its 48px gap */
  position: fixed; top: 16px; left: 50%; z-index: 50;
  width: var(--pill-w); max-width: calc(100% - 32px); max-height: calc(100dvh - 32px);
  translate: -50% 0;
  display: grid; grid-template-rows: 54px 0fr 0fr;
  border-radius: 16px;
  box-shadow: 0 5px 8.6px rgba(0, 0, 0, .2);
  /* Figma: 100ms ease-out open, ease-in close */
  transition: width .1s ease-in, grid-template-rows .1s ease-in;
}
/* The glass sits on its own layer: Chrome stops painting a scrolling child of an element with backdrop-filter */
.navpill::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--pill-bg);
  -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);   /* Figma background blur 60 */
}
/* 1px inside stroke, #b5b5b5 at the bottom to #f2f2f2 at the top */
.navpill::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border-radius: inherit; padding: 1px;
  background: linear-gradient(0deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.navpill[data-open] { transition-timing-function: ease-out; }
/* darker glass once a menu is open so the orange labels and grey text read clearly */
.navpill::after { transition: background-color .1s ease-in; }
.navpill[data-open]::after { background: rgba(22, 22, 22, .86); }
.navpill[data-open="work"] { width: min(calc(100% - 32px), 1768px);   /* Figma: pill nav max 1800 incl. its 16px sides */ grid-template-rows: 54px 0fr 1fr; }
.navpill[data-open="contact"] { grid-template-rows: 54px 1fr 0fr; }

.navpill-bar { display: flex; align-items: center; justify-content: center; gap: 48px; padding: 0 24px; white-space: nowrap; }
.logo, .nav-btn { font-size: 16px; line-height: 22px; font-weight: 600; }
.logo { color: var(--pill-ink); }
.navpill-sep { width: 0; height: 26px; border-left: 1px solid rgba(232, 232, 232, .45); margin-right: -1px; }
.nav-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--pill-ink); transition: color .2s; }
.nav-btn:hover, .logo:hover, .nav-btn[aria-expanded="true"] { color: #fff; }
.chev { overflow: visible; transition: transform .1s ease-out; }
.nav-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.dl { transition: transform .2s; }
.resume-btn:hover .dl { transform: translateY(2px); }

/* Panels sit in the pill's 0fr/1fr rows; their content shows once the pill has grown (Figma's empty in-between frame) */
.navpill-panel { min-height: 0; overflow: hidden; }
.navpill-inner { visibility: hidden; opacity: 0; }
.navpill-panel.open { overflow: visible; }
.navpill-panel.open .navpill-inner { visibility: visible; opacity: 1; transition: opacity .15s ease-out .1s; }

/* Contact */
.contact-panel a {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 20px 20px 19px 24px; border-bottom: 1px solid var(--pill-line);
  font-size: 16px; line-height: 20px; color: var(--pill-ink); transition: color .2s;
}
.contact-panel a:first-child { padding-block: 18px; }
.contact-panel a:last-child { border-bottom: 0; padding-bottom: 20px; }
.contact-panel b { font: 400 12px/17px var(--serif); color: var(--accent-n); }
.contact-panel a:hover span { color: #fff; }

/* Work */
.work-panel .navpill-inner { max-height: calc(100dvh - 32px - 54px); }
.work-grid { display: grid; grid-template-columns: 1fr 1fr; }
.work-label {
  height: 35px; padding: 21px 40px 0;
  font-size: 12px; line-height: 17px; color: var(--accent-n);
}
.work-row {
  position: relative;
  display: flex; align-items: center; gap: 24px;
  height: 104px; padding: 3px 40px 0;
  border-bottom: 1px solid var(--pill-line);   /* not an inset shadow: Chrome drew a sliver of it down the column edge */
}
.work-row:last-child { border-bottom: 0; padding-top: 2px; }
.work-row .t {
  font-size: 20px; line-height: 28px; color: var(--pill-ink); white-space: nowrap;
  transition: transform .4s var(--ease-out);
}
.work-row .s { font-size: 16px; line-height: 20px; color: var(--pill-mute); transition: color .2s; }
.work-row:hover .t, .work-row:focus-visible .t { transform: translateX(4px); }
.work-row:hover .s, .work-row:focus-visible .s { color: var(--pill-ink); }

.thumb {
  position: absolute; z-index: 3; left: 70%; top: 50%;
  width: 220px; height: auto; max-width: none;
  border-radius: 8px;
  box-shadow: var(--thumb-shadow);
  outline: .5px solid var(--thumb-stroke); outline-offset: -.5px;
  pointer-events: none;
  opacity: 0;
  /* separate from transform so cursor tracking isn't slowed by the transition below */
  translate: var(--tx, 0px) var(--ty, 0px);
  rotate: var(--tr, 0deg);
  transform: translate(-50%, calc(-50% + 12px)) rotate(0deg) scale(.92);
  transition: opacity .2s var(--ease), transform .45s var(--ease-out);
}
.thumb.tall {
  width: 115.5px; border-radius: 5px; top: calc(50% + 7px); left: 69%;
}
.work-row:last-child .thumb { top: calc(50% - 30px); }
.work-row:hover .thumb, .work-row:focus-visible .thumb {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(var(--rot)) scale(1);
}

/* ============ Hero ============ */
.hero { grid-template-columns: minmax(0, 960fr) minmax(0, 480fr); padding-top: 24px; }
.hero-text { display: flex; flex-direction: column; justify-content: center; padding: 148px 20px 88px 40px; }
.statement {
  font-size: 56px; line-height: 1.2; letter-spacing: .03em;
  color: var(--ink);
}
.lead { margin-top: 20px; font-size: 20px; line-height: 25px; color: var(--ink); }

.facts-frame { padding: 148px 40px 96px 40px; }   /* full opacity so the values match the case-study body text */
/* Figma's card is 279 tall with its rows centred, so they overhang it slightly */
.facts { display: flex; flex-direction: column; justify-content: center; min-height: 279px; padding: 16px 0; }   /* grows with the 16px rows */
.facts dl > div {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px; box-shadow: inset 0 1px var(--rule);   /* inside stroke: takes no height */
}
.facts dl > div:first-child { box-shadow: none; }
.facts dt { flex: none; color: var(--fact-label); font-size: 16px; line-height: 22px; }
.facts dd { color: var(--ink-2); font-size: 16px; line-height: 20px; font-weight: 400; text-align: right; }   /* same as .stack .body */
.dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-n);
  margin-right: 8px; vertical-align: -2px; position: relative;
}
.dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent-n);
  animation: ping 2.4s var(--ease-out) infinite;
}

/* ============ Case studies ============ */
.eyebrow { font-size: 12px; line-height: 17px; color: var(--accent-h); }
.cases { display: flex; flex-direction: column; }
.case { position: relative; }
.case + .case { margin-top: 48px; }
.case-cover { padding: 36px 40px 36px 20px; }
.case-text { padding: 36px 20px 36px 40px; }
#skryve .case-cover, #skryve .case-text { padding-top: 0; }
/* Desktop: text on the left, cover on the right (phones keep the cover first) */
@media (min-width: 901px) {
  .case.grid-2 { grid-template-columns: minmax(0, 547.5fr) minmax(0, 892.5fr); }
  .case-text { grid-area: 1 / 1; }
  .case-cover { grid-area: 1 / 2; }
}

.media {
  position: relative; z-index: 2; /* above the stretched title link, so :hover means the image itself */
  display: block; overflow: hidden; border-radius: 16px;
  isolation: isolate; background: var(--bg);
  aspect-ratio: var(--ar, auto);
}
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media video { display: block; }
/* No browser or player chrome over any video, ever */
.media video { pointer-events: none; }
.media video::-webkit-media-controls { display: none !important; }
.media video::-webkit-media-controls-enclosure { display: none !important; }
.vimeo {
  position: absolute; left: -2%; top: -2%; width: 104%; height: 104%;
  border: 0; pointer-events: none; opacity: 0;
  transition: opacity .8s var(--ease);
}
.vimeo.ready { opacity: 1; }
.media-cta {
  position: absolute; left: 20px; bottom: 20px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: rgba(255,255,255,.92); color: #1a1a1a;
  font-size: 14px; line-height: 18px; font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(10px);
  transition: opacity .4s var(--ease), transform .5s var(--ease-out);
}
.media-cta i { font-style: normal; display: inline-block; transition: transform .45s var(--ease-out); }
.framed::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  border: 2px solid rgba(37, 37, 37, .16); border-radius: inherit;   /* light edge so white images don't melt into the page */
}
/* Each image sets its own light-mode --frame inline; dark mode uses one quiet line */

.media:hover .media-cta { opacity: 1; transform: none; }
.media:hover .media-cta i { transform: translate(2px, -2px); }

h2, h3 { font-size: 32px; line-height: 45px; letter-spacing: -.01em; color: var(--ink); }
.case-text h2 a, .card h3 a { position: static; background: linear-gradient(currentColor, currentColor) 0 90% / 0 1.5px no-repeat; transition: background-size .5s var(--ease); }
/* stretched link: whole case/card is clickable */
.case-text h2 a::after, .card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.case:hover h2 a, .card:hover h3 a { background-size: 100% 1.5px; }

.sub { font-size: 24px; line-height: 34px; color: var(--ink-2); margin-top: 8px; }
.stack .body { margin-top: 16px; font-size: 16px; line-height: 20px; color: var(--ink-2); }
.case-text .body p + p { margin-top: 20px; }
.case-text .body strong { font-weight: 700; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; position: relative; z-index: 2; }
.tags li {
  font-size: 12px; line-height: 16px; font-weight: 700; color: var(--tag);
  border: 1px solid var(--tag-line); border-radius: 12px; padding: 3px 7px;
  transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--ease);
  cursor: default;
}
.tags li:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); transform: translateY(-1px); }

.store-badge { display: block; width: 182px; height: 40px; margin-top: 32px; position: relative; z-index: 2; overflow: hidden;
  transition: transform .35s var(--ease), opacity .25s; }
/* the badge image is cropped to its frame, as in Figma */
.store-badge img { position: absolute; left: -5.49%; top: -28.13%; width: 113.5%; height: 156.25%; max-width: none; }
.store-badge:hover { transform: translateY(-2px); }
.store-badge:active { transform: scale(.97); }

/* ============ Prototyping ============ */
.proto-break { height: 68px; align-items: center; }
.proto-break .eyebrow:first-child { padding-left: 40px; }
@media (min-width: 901px) { .proto-break { grid-template-columns: minmax(0, 547.5fr) minmax(0, 892.5fr); } }
.media img.crop { position: absolute; max-width: none; }
.proto-head { padding: 0 36px 138px; }   /* Figma: 80 + the block's 58 */
.proto-head .lede { color: var(--ink); }
.proto-head .lede { margin-top: 16px; font-size: 24px; line-height: 30px; color: var(--ink); }

.proto-grid { display: grid; grid-template-columns: 1fr 1fr; }
.card { position: relative; padding: 36px 40px 80px; }
.card.top { padding-top: 20px; padding-bottom: 48px; }
.card .media { margin-bottom: 24px; }
.card.top h3 { color: var(--ink); }
.card.soft h3 { color: var(--ink-2); }
.card.tight { padding-bottom: 36px; }
.card.tight .tags { margin-top: 24px; }
#five5quare .sub { margin-right: -2px; } /* keeps this line on one row at 1440, as in Figma */

/* ============ Keyframes ============ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ping   { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.6); opacity: 0; } }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .statement { font-size: 44px; }
  .sub { font-size: 21px; line-height: 29px; }
  .proto-head .lede { font-size: 20px; line-height: 27px; }
  .work-row { flex-wrap: wrap; align-content: center; gap: 4px 12px; }
  .work-row .s { flex-basis: 100%; }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-offset { grid-column: 1; }
  .hero { padding-top: var(--header-h); }
  .hero-text { padding: 48px 24px 40px; }
  .statement { font-size: 30px; line-height: 37px; }
  .lead { margin-top: 16px; font-size: 18px; line-height: 24px; }
  .facts-frame { padding: 0 24px 40px; }
  .facts { height: auto; padding: 0; }
  .case-cover, #skryve .case-cover { padding: 0 24px 28px; }
  .case-text, #skryve .case-text { padding: 0 24px 72px; }
  .case + .case { margin-top: 24px; }
  .proto-break { height: auto; padding: 40px 24px 16px; }
  .proto-break .eyebrow:first-child { padding-left: 0; }
  .proto-head { padding: 0 24px 40px; }
  .proto-head .lede { font-size: 18px; line-height: 26px; }
  .proto-grid { grid-template-columns: 1fr; }
  .card, .card.top { padding: 0 24px 64px; }
  .media-cta { opacity: 1; transform: none; left: 14px; bottom: 14px; padding: 7px 12px; font-size: 13px; }
  .work-panel .navpill-inner { overflow-y: auto; overscroll-behavior: contain; }
  .work-panel.open { overflow: hidden; }
  .work-grid { grid-template-columns: 1fr; }
  .work-label { height: auto; padding: 20px 24px 4px; }
  .work-row { height: auto; padding: 18px 24px; }
  .work-col:first-child .work-row:last-child { border-bottom: 1px solid var(--pill-line); }
  .thumb { display: none; }
}
@media (hover: none) { .thumb { display: none; } }
.m-home, .hello { display: none; }   /* phone-only: the pill drops the name there */
.hello { margin-bottom: 12px; font-size: 16px; line-height: 22px; font-weight: 600; color: var(--ink-mute); }
@media (max-width: 560px) {
  /* phones: the pill sits at the bottom with just Work / Contact / Resume and opens upwards */
  body { padding-bottom: 96px; }
  /* full width at all times, so opening only grows it upwards (no sideways shift) */
  /* align-content: end — mid-animation the fr rows don't fill the pill, and the spare space must sit above the bar, not under it (that made the bar bounce up) */
  .navpill { --pill-w: 100%; top: auto; bottom: 16px; grid-template-rows: 0fr 0fr 64px; align-content: end; }   /* 64px: Material 3 nav bar height, close to the iOS floating tab bar */
  .navpill[data-open="work"] { grid-template-rows: 1fr 0fr 64px; }
  .navpill[data-open="contact"] { grid-template-rows: 0fr 1fr 64px; }
  .work-panel { order: 1; }
  .contact-panel { order: 2; }
  .navpill-bar { order: 3; justify-content: space-evenly; gap: 0; padding: 0 8px; }
  .navpill-bar .logo, .navpill-sep { display: none; }
  .nav-btn { font-size: 16px; line-height: 22px; gap: 8px; }
  /* 32px = half the closed height, so the corners look the same closed and open
     (a bigger radius gets clamped to 32 while closed, then visibly morphs as the pill grows) */
  .navpill { border-radius: 32px; }
  /* one slower, smooth ease for the height and the content fade, and nothing else animating (no width change, no tap flash) */
  .navpill, .navpill[data-open] { transition: grid-template-rows .32s cubic-bezier(.32, .72, 0, 1); }
  .navpill-panel.open .navpill-inner { transition: opacity .2s ease-out .08s; }
  .nav-btn { -webkit-tap-highlight-color: transparent; }
  .chev { transition-duration: .32s; }
  .chev { transform: rotate(180deg); }
  .nav-btn[aria-expanded="true"] .chev { transform: none; }
  .work-panel .navpill-inner { max-height: calc(100dvh - 32px - 64px); }
  .site-header .m-home { display: inline-flex; align-items: center; height: 100%; padding: 0 16px; font-size: 16px; line-height: 22px; font-weight: 600; color: var(--ink); }
  .hero { padding-top: 0; }
  .hello { display: block; }
  .contact-panel a { padding: 18px 16px; font-size: 15px; }
  .contact-panel a:first-child { padding-block: 18px; }
  .hero-text { padding: 40px 16px 32px; }
  .statement { font-size: 22px; line-height: 29px; }
  .facts-frame { padding: 0 16px 32px; }
  .facts { padding: 12px 14px; }
  .facts dt, .facts dd { font-size: 14px; line-height: 20px; }
  .facts dl > div { gap: 12px; }
  .lead { font-size: 16px; line-height: 22px; }
  .case-cover, #skryve .case-cover { padding: 0 16px 24px; }
  .case-text, #skryve .case-text { padding: 0 16px 64px; }
  h2, h3 { font-size: 22px; line-height: 30px; }
  .sub { font-size: 17px; line-height: 24px; }
  .proto-head { padding: 0 16px 32px; }
  .proto-break { padding: 32px 16px 12px; }
  .card, .card.top { padding: 0 16px 56px; }
  .work-label { padding: 16px 16px 4px; }
  .work-row { padding: 14px 16px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
  .dot::after { display: none; }
}
