/* ==========================================================================
   Christine S. Kim — Portfolio 2026
   Tokens come from the Figma style guide (XS = 375px … XL = 1600px).
   Between those breakpoints values interpolate fluidly (the "FluidSpacer"
   approach in the design), and are capped at the XL values.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Colors */
  --white: #fcfbf9;
  --black: #292f33;
  --graphite-400: #667075;
  --lavender-main: #e2c7e3;
  --lavender-dark: #584856;
  --sunshine-light: #feeacb;
  --sunshine-dark: #655132;
  --coral-light: #faddd0;
  --coral-dark: #5e3220;
  --grass-light: #e6eddc;
  --grass-dark: #4d5443;
  --sky-light: #ebf6ff;
  --sky-dark: #525d66;
  --clay-200: #f5f2f0;

  /* Radius */
  --radius-s: 5px;
  --radius-m: 7.5px;
  --radius-pill: 46.781px;

  /* Fluid spacing: XS value @375px → XL value @1600px */
  --space-xs:  clamp(8px,  calc(8px  + 8   * (100vw - 375px) / 1225), 16px);
  --space-s:   clamp(16px, calc(16px + 16  * (100vw - 375px) / 1225), 32px);
  --space-m:   clamp(24px, calc(24px + 24  * (100vw - 375px) / 1225), 48px);
  --space-xl:  clamp(64px, calc(64px + 64  * (100vw - 375px) / 1225), 128px);
  --space-2xl: clamp(104px, calc(104px + 104 * (100vw - 375px) / 1225), 208px);

  /* Fluid type */
  --fs-h1:      clamp(40px, calc(40px + 32 * (100vw - 375px) / 1225), 72px);   /* headline/7XL */
  --fs-tagline: clamp(20px, calc(20px + 10 * (100vw - 375px) / 1225), 30px);
  --fs-h3:      clamp(28px, calc(28px + 8  * (100vw - 375px) / 1225), 36px);   /* headline/H3 */
  --fs-mono:    clamp(16px, calc(16px + 2  * (100vw - 375px) / 1225), 18px);   /* mono/XS */
  --fs-p2:      clamp(18px, calc(18px + 2  * (100vw - 375px) / 1225), 20px);   /* text/P2 */
  --fs-p3:      clamp(16px, calc(16px + 2  * (100vw - 375px) / 1225), 18px);   /* text/P3 */

  /* Tag padding */
  --tag-px: clamp(15px, calc(15px + 2.5 * (100vw - 375px) / 1225), 17.5px);
  --tag-py: clamp(6px,  calc(6px  + 1   * (100vw - 375px) / 1225), 7px);

  /* Layout */
  --gutter: clamp(25px, calc(25px + 135 * (100vw - 375px) / 1225), 160px);
  --page-width: min(100% - 2 * var(--gutter), 1280px);
  --nav-height: 134px;

  /* Fonts */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-size: var(--fs-p3);
  font-weight: 400;
  line-height: 1.6;
  font-feature-settings: "lnum" 1, "tnum" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }

:focus-visible {
  outline: 2px solid var(--lavender-dark);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-s);
}
.skip-link:focus { top: 8px; }

/* Display type (Fraunces) */
.display {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 75, "WONK" 1;
  font-feature-settings: "ss01" 1, "ss05" 1;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* ---------- Link underline (hover/focus) ---------- */
.link {
  position: relative;
  display: inline-block;
  padding-bottom: 4px;
}
.link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.link:hover::after,
.link:focus-visible::after { opacity: 1; }

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  margin-bottom: calc(var(--nav-height) * -1); /* nav overlays the hero, as in the design */
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* Slides away while scrolling down, returns on the slightest scroll up (js/main.js) */
.site-header.is-hidden { transform: translateY(-100%); }
.site-header__inner {
  width: var(--page-width);
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  font-size: var(--fs-p2);
}

/* ---------- Logo (CSK monogram) — drawn at its 82×70 design size ---------- */
.logo {
  position: relative;
  display: block;
  flex: none;
  width: 82.456px;
  height: 70px;
  color: var(--lavender-dark);
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 75, "WONK" 1;
  font-feature-settings: "ss01" 1, "rvrn" 1;
  line-height: normal;
}
.logo > * { position: absolute; display: block; }
.logo__back  { left: 2.99px; top: 3.24px; width: 76.477px; height: 63.772px; }
.logo__front { left: 0;      top: 0.25px; width: 82.456px; height: 69.751px; }
.logo__c, .logo__s, .logo__k { width: 35.125px; height: 55.303px; }
.logo__c { left: 9.19px;  top: 2.99px; font-size: 49.822px; font-weight: 196; }
.logo__s { left: 18.68px; top: 0.78px; font-size: 44.84px;  font-weight: 201; }
.logo__k { left: 35.84px; top: 2.99px; font-size: 49.822px; font-weight: 196; }
.logo__star {
  left: 58.51px; top: 29.07px;
  width: 8.393px; height: 8.393px;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(13.16deg);
}
.logo__star img { width: 6.986px; height: 6.986px; }

.logo-box--sm { width: 60px; height: 50.937px; }
.logo-box--sm .logo { transform: scale(0.7277); transform-origin: 0 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  padding-top: calc(var(--space-xl) + var(--space-2xl));
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  z-index: -1;
  height: calc(100% + var(--space-2xl) + var(--space-xl));
  background: url("../assets/svg/bg-gradients.svg") no-repeat left top / max(100%, 1600px) 919px;
}
.hero__inner {
  width: var(--page-width);
  margin-inline: auto;
}
.hero__title {
  max-width: 14.67em;
  margin-inline: auto;
  font-size: var(--fs-h1);
  font-weight: 250;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero__tagline {
  margin-top: var(--space-s);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: var(--fs-tagline);
  font-weight: 250;
  color: var(--lavender-dark);
  letter-spacing: -0.02em;
}
.hero__tagline span { text-wrap: balance; }
.hero__tagline img { flex: none; width: 16.648px; height: 16.231px; margin: 0 1.7px; transform: rotate(13.16deg); }

/* ---------- Teasers ---------- */
.teasers {
  width: var(--page-width);
  margin: var(--space-2xl) auto 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.media {
  width: 100%;
  height: auto;
  border-radius: var(--radius-m);
  background: var(--clay-200);
}

.meta { margin-top: var(--space-s); }
.title {
  position: relative;
  width: fit-content;
  max-width: 100%;
  font-size: var(--fs-h3);
  font-weight: 200;
  letter-spacing: -0.02em;
}
/* Hover arrow (from the Figma "Title + Arrow" component) follows the last word
   of the title, 4px away, without taking up layout space */
.title .arrow {
  position: relative;
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: baseline;
}
/* The arrow's drawn shape sits 4.86px above the bottom of its 13.72px box.
   Its centre goes 0.32em above the baseline, which is where the Figma
   component puts it (measured from the exported hover state). */
.title .arrow img {
  position: absolute;
  left: 0;
  bottom: calc(0.32em - 4.86px);
  width: 25.2px;
  height: 13.72px;
  max-width: none;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
a .title:hover .arrow img,
a:focus-visible .title .arrow img { opacity: 1; transform: none; }

/* Ampersand: the font's regular form (WONK off), as set in the Figma title */
.amp { font-variation-settings: "SOFT" 75, "WONK" 0; }

/* Photo frames: slight zoom on hover */
.frame {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--clay-200);
}
.frame .media {
  border-radius: 0;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}
@media (hover: hover) {
  .frame:hover .media,
  a:focus-visible .frame .media,
  a.frame:focus-visible .media { transform: scale(1.04); }
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: var(--space-xs);
}
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--tag-py) var(--tag-px);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  line-height: 1.6;
  white-space: nowrap;
}
.tag--lavender  { background: var(--lavender-main);  color: var(--lavender-dark); }
.tag--sunshine  { background: var(--sunshine-light); color: var(--sunshine-dark); }
.tag--coral     { background: var(--coral-light);    color: var(--coral-dark); }
.tag--grass     { background: var(--grass-light);    color: var(--grass-dark); }
.tag--sky       { background: linear-gradient(rgba(0,0,0,.02), rgba(0,0,0,.02)), var(--sky-light); color: var(--sky-dark); }
.tag--neutral   { background: #e1e2dc; color: var(--black); }

/* Small side images only exist in the large layouts */
.teaser__side { display: none; }

/* Row: image on the right, flipped to the top on small screens */
.teaser--odds { display: flex; flex-direction: column-reverse; }
.teaser--odds .meta { margin-top: var(--space-s); }
.teaser--odds .media-wrap { order: 0; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  margin-top: var(--space-xl);
  overflow: hidden;
  background: var(--white);
}
.site-footer__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Glow positions come from the Figma footer (1600px frame): the purple one hugs the
   right edge, the yellow one the left edge, so both stay visible at any width. */
.site-footer__bg .blob { position: absolute; }
.site-footer__bg .blob img { position: absolute; max-width: none; }
.site-footer__bg .blob--purple { right: 24px; top: 50%; width: 517px; height: 221px; transform: translateY(-50%); }
.site-footer__bg .blob--purple img { left: -62.97%; top: -147.3%; width: 225.94%; height: 394.6%; }
.site-footer__bg .blob--yellow { left: -250px; top: calc(50% + 252.53px); width: 1184px; height: 506px; transform: translateY(-50%); }
.site-footer__bg .blob--yellow img { left: -27.49%; top: -64.33%; width: 154.98%; height: 228.66%; }
.site-footer__inner {
  position: relative;
  width: var(--page-width);
  margin-inline: auto;
  padding-block: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 16px; /* room for the link underline above the copyright */
  font-size: var(--fs-p3);
}
.footer-links { display: flex; gap: var(--space-m); }
/* Keep footer text on one line with the copyright; the underline drops below instead of padding the link */
.footer-links .link { padding-bottom: 0; }
.footer-links .link::after { bottom: -4px; }
.footer-logo { display: none; }

/* ==========================================================================
   Large layouts (side-by-side teasers)
   ========================================================================== */
@media (min-width: 960px) {
  .teaser { display: flex; }
  .teaser__side { display: block; }

  /* Hoag for Life / Help Scout: big image + small square, bottom aligned */
  .teaser--a { align-items: flex-end; justify-content: space-between; }
  .teaser--a .teaser__main { flex: 0 0 65.4%; }
  .teaser--a .teaser__side { flex: 0 0 30.7%; }
  .teaser--a .teaser__side .media { aspect-ratio: 1; object-fit: cover; }

  /* Hoag Classic: centred wide image, title left / tags right */
  .teaser--center { justify-content: center; }
  .teaser--center .teaser__main { width: 82.66%; }
  .teaser--center .meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-s);
  }
  .teaser--center .tags { margin-top: 0; justify-content: flex-end; max-width: 277px; }

  /* Patient Room / In the Works: image left, text vertically centred */
  .teaser--b { align-items: center; justify-content: space-between; }
  .teaser--b .media-wrap { flex: 0 0 65.3%; }
  .teaser--b .meta { flex: 0 0 30.7%; margin-top: 0; }
  .teaser--b .tags { margin-top: var(--space-xs); }

  /* Odds & Ends: text left, image right */
  .teaser--odds { flex-direction: row; align-items: center; justify-content: space-between; }
  .teaser--odds .media-wrap { flex: 0 0 65.3%; }
  .teaser--odds .meta { flex: 0 0 30.7%; margin-top: 0; }

  /* Footer */
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    row-gap: 0;
  }
  .footer-logo { display: block; }
  .footer-copyright { width: 180px; text-align: right; }
}

/* Large-screen copyright alignment: matches the design (left-aligned 180px box) */
@media (min-width: 960px) {
  .footer-copyright { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Small screens: keep the glow visible but let the peach lead, as in the mobile design */
@media (max-width: 959px) {
  .site-footer__bg .blob--purple { opacity: .4; right: -140px; }
}

/* Avoid widows and orphans: paragraphs avoid a lone last word, headings and captions balance their lines */
p, li, blockquote { text-wrap: pretty; }
h1, h2, h3, h4, .display, .cs-caption { text-wrap: balance; }
.hero__tagline span { text-wrap: balance; }

/* ---------- Odds & Ends thumbnail: the 404 collage drifts apart and back together ----------
   Coordinates are percentages of the 835 x 469.68 design frame, so it scales with the thumbnail. */
.oddsanim { position: relative; aspect-ratio: 835 / 469.684; overflow: hidden; background: #efedf7; }
.oddsanim__stage { position: absolute; inset: 0; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.oa { position: absolute; display: block; max-width: none; height: auto; user-select: none; -webkit-user-drag: none;
  transition: transform 1.6s cubic-bezier(.65, 0, .25, 1), opacity 1.6s ease-in-out; will-change: transform; }
.oa-blob1, .oa-blob2 { left:33.5042%;top:7.7501%;width:25.2695%; }
.oa-blob2 { opacity:0; }
.oa-mtn1 { left:29.8966%;top:10.5676%;width:36.2475%;transform-origin:0 0; }
.oa-mtn2 { left:58.7621%;top:0.0000%;width:41.2774%;transform-origin:0 0;opacity:0;transform:translate(-69.930%,22.391%) scale(0.8781,0.8992); }
.oa-water { left:44.9796%;top:38.6844%;width:21.6766%; }
.oa-star { left:34.0515%;top:13.9094%;width:7.1058%; }
.oa-line { left:34.7309%;top:39.4592%;width:28.4631%; }
.oa-h1 { left:29.0623%;top:60.6088%;width:41.8762%; }
.oa-sub { left:27.4251%;top:69.9044%;width:45.1497%; }
.oa-btn { left:43.3533%;top:78.7764%;width:13.3333%; }
/* scattered state */
.oddsanim.is-out .oa-blob1 { opacity:0;transform:translate(-102.414%,-3.670%); }
.oddsanim.is-out .oa-blob2 { opacity:1;transform:translate(-102.414%,-3.670%); }
.oddsanim.is-out .oa-mtn1 { opacity:0;transform:translate(79.634%,-24.900%) scale(1.1388,1.1120); }
.oddsanim.is-out .oa-mtn2 { opacity:1;transform:none; }
.oddsanim.is-out .oa-water { transform:translate(121.781%,239.573%); }
.oddsanim.is-out .oa-star { transform:translate(-407.292%,208.412%); }
.oddsanim.is-out .oa-line { transform:translate(-96.353%,311.690%); }
@media (hover: hover) {
  a:hover .oddsanim__stage, a:focus-visible .oddsanim__stage { transform: scale(1.0101); }
}

/* Tablet and smaller: a more compact nav logo */
@media (max-width: 1023px) {
  .site-header .logo { transform: scale(.72); transform-origin: 0 50%; margin-right: calc(-82.456px * .28); }
}

/* ======================================================================
   Micro-animations (all motion-safe: skipped under prefers-reduced-motion)
   ====================================================================== */

/* 1. Arrows: slide in on hover, then settle a few px further along */
.title .arrow img,
.cs-next__arrow { transition: opacity .25s ease, transform .45s cubic-bezier(.2, .8, .2, 1.2); }
@media (hover: hover) {
  a .title:hover .arrow img,
  a:hover .title .arrow img,
  a:focus-visible .title .arrow img { opacity: 1; transform: translateX(4px); }
  .cs-next .cs-next__link:hover .cs-next__arrow,
  .cs-next .cs-next__link:focus-visible .cs-next__arrow { opacity: 1; transform: translateX(6px); }
}

/* 2. Photo frames: corners tighten a touch as the image eases in */
.frame { transition: border-radius .5s cubic-bezier(.2, .7, .2, 1); }
@media (hover: hover) {
  .frame:hover,
  a:hover > .frame,
  a:hover .frame { border-radius: calc(var(--radius-m) * .55); }
}

/* 3. Logo: the star twirls on hover */
.logo__star { transition: transform .8s cubic-bezier(.3, 1.4, .4, 1); }
@media (hover: hover) {
  .logo:hover .logo__star { transform: rotate(373.16deg) scale(1.25); }
}

@media (prefers-reduced-motion: no-preference) {
  /* 4. Entrance: title, tags and intro rise in one after another */
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  .hero__title, .hero__tagline,
  .cs-info__title, .cs-info .tags, .cs-info__body, .credits {
    animation: rise .8s cubic-bezier(.2, .7, .2, 1) both;
  }
  .hero__tagline, .cs-info .tags { animation-delay: .12s; }
  .cs-info__body, .credits { animation-delay: .24s; }

  /* 6. Footer glow: the two blobs drift very slowly */
  @keyframes drift-a { from { transform: translate(0, 0) scale(1); } to { transform: translate(-28px, 10px) scale(1.04); } }
  @keyframes drift-b { from { transform: translate(0, 0) scale(1); } to { transform: translate(24px, -8px) scale(1.03); } }
  .site-footer__bg .blob--purple img { animation: drift-a 22s ease-in-out infinite alternate; }
  .site-footer__bg .blob--yellow img { animation: drift-b 26s ease-in-out infinite alternate; }
}

/* The Odds & Ends thumbnail loop keeps running for everyone (as requested), so it is exempt from the global transition kill */
@media (prefers-reduced-motion: reduce) {
  .oddsanim__stage, .oa { transition-duration: 1.6s !important; }
  .oddsanim__stage { transition-duration: .7s !important; }
}
