/* Rachel Park portfolio — indigo (default) + light theme */
:root {
  --bg: #17133a;
  --ink: #f2eefb;
  --accent: #b9acf5;
  --line: rgba(242, 238, 251, 0.14);
  --muted: rgba(242, 238, 251, 0.85);
  --dim: rgba(242, 238, 251, 0.7);
  --faint: rgba(242, 238, 251, 0.5);
  --hover: #b9acf5;
  --scrim: rgba(12, 10, 32, 0.72);
  --concept: #17133a;
  --pad: 96px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --pixel: "Press Start 2P", monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f3fc;
  --ink: #1b1730;
  --accent: #5a4fa8;
  --line: rgba(27, 23, 48, 0.12);
  --muted: rgba(27, 23, 48, 0.8);
  --dim: rgba(27, 23, 48, 0.62);
  --faint: rgba(27, 23, 48, 0.45);
  --hover: #5a4fa8;
  --scrim: rgba(246, 243, 252, 0.78);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease, opacity 0.2s ease; }
a:hover { color: var(--hover); }
.u { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--pad); }

/* Concept colour wash at the top of case studies */
.wash {
  position: absolute; inset: 0 0 auto 0; height: 880px; pointer-events: none; z-index: 0;
  background: linear-gradient(180deg, var(--concept) 0%, color-mix(in srgb, var(--concept) 55%, var(--bg)) 48%, var(--bg) 100%);
  transition: opacity 0.6s ease;
}
:root[data-theme="light"] .wash {
  background: linear-gradient(180deg, color-mix(in srgb, var(--concept) 22%, var(--bg)) 0%, var(--bg) 100%);
}
main, header, footer { position: relative; z-index: 1; }

/* Nav */
.nav { height: 120px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--pixel); font-size: 13px; letter-spacing: 0; color: var(--ink); }
.nav { z-index: 20; }
.nav-end { display: flex; align-items: center; gap: 36px; }
.nav-links { display: flex; align-items: center; gap: 36px; list-style: none; }
.burger { display: none; }
.nav li a { font-weight: 500; font-size: 17px; color: var(--dim); }
.nav li a[aria-current="page"] { color: var(--ink); }
.nav li a:hover { color: var(--hover); }

/* Theme toggle: pill with sun and moon */
.toggle {
  width: 72px; height: 32px; border-radius: 16px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 8%, transparent); position: relative; cursor: pointer; margin-left: 4px;
}
.toggle::before, .toggle::after { content: ""; position: absolute; top: 50%; transform: translateY(-50%); }
.toggle::before { left: 11px; width: 10px; height: 10px; border-radius: 50%; background: #ffd56a; box-shadow: 0 0 0 3px rgba(255, 213, 106, 0.25); }
.toggle::after { right: 10px; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset -4px -2px 0 0 #d8ccff; }
.toggle .knob {
  position: absolute; top: 3px; left: 43px; width: 24px; height: 24px; border-radius: 50%;
  background: #e8ff6a; transition: left 0.3s ease, background 0.3s ease; z-index: 1;
}
:root[data-theme="light"] .toggle .knob { left: 3px; background: #5a4fa8; }

/* Type */
.display { font-family: var(--display); font-weight: 500; letter-spacing: -0.025em; }
.h-hero { font-size: 62px; line-height: 70px; max-width: 1200px; }
.h-page { font-size: 76px; line-height: 82px; }
.h-section { font-size: 36px; line-height: 46px; letter-spacing: -0.01em; }
.label { color: var(--accent); font-size: 17px; }
.lede { font-size: 22px; line-height: 33px; color: var(--muted); max-width: 720px; }
.hair { height: 1px; background: var(--line); border: 0; }

/* Home */
.hero { padding-top: 56px; }
.scene { margin-top: 136px; width: 100%; overflow: hidden; }
.scene img { width: 100%; height: auto; min-width: 900px; image-rendering: pixelated; display: block; }
.work { display: grid; grid-template-columns: 560px 1fr; gap: 88px; padding-top: 112px; align-items: start; }
.work .label { margin-bottom: 23px; }
.rows { border-top: 1px solid var(--line); }
.row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 22px 0 26px; border-bottom: 1px solid var(--line); position: relative;
}
.row .name { font-family: var(--display); font-weight: 500; font-size: 36px; line-height: 43px; letter-spacing: -0.04em; color: var(--faint); transition: color 0.25s ease; }
.row .meta { font-size: 16px; color: color-mix(in srgb, var(--accent) 70%, transparent); white-space: nowrap; transition: color 0.25s ease; }
.row.is-active .name { color: var(--ink); }
.row.is-active .meta { color: var(--muted); }
.row.is-soon { cursor: default; }
.row::before {
  content: ""; position: absolute; left: -44px; top: 34px; width: 24px; height: 24px; opacity: 0;
  background: var(--ink);
  -webkit-mask: url("/img/feather.svg") center / contain no-repeat; mask: url("/img/feather.svg") center / contain no-repeat;
  transition: opacity 0.2s ease;
}
.row.is-active::before { opacity: 1; }
.preview { position: sticky; top: 40px; padding-top: 44px; }
.preview .frame { aspect-ratio: 600 / 392; border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.preview .frame img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.25s ease; }
.preview .cap { display: flex; justify-content: space-between; gap: 24px; padding: 20px 0 0; align-items: baseline; }
.preview .cap p { font-size: 19px; line-height: 29px; color: var(--muted); max-width: 340px; }
.preview .cap a { font-weight: 500; white-space: nowrap; }
.foot { margin-top: 110px; padding: 31px 0 68px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot p { color: var(--accent); }
.foot .links { display: flex; gap: 36px; font-weight: 500; }

/* Case study */
.cs-head { padding-top: 72px; display: grid; gap: 18px; }
.cs-head .h-page { margin-top: 0; }
.hero-img { margin-top: 72px; border-radius: 14px; overflow: hidden; }
.hero-img img { width: 100%; height: auto; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 72px; }
.facts div { padding-right: 32px; }
.facts dt { font-size: 15px; color: var(--accent); margin-bottom: 8px; }
.facts dd { font-size: 18px; line-height: 27px; font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 72px; }
.stats strong { display: block; font-family: var(--display); font-weight: 500; font-size: 96px; line-height: 100px; letter-spacing: -0.03em; }
.stats span { font-size: 18px; color: var(--muted); }
.cs-body { margin-top: 72px; border-top: 1px solid var(--line); padding-top: 72px; display: grid; gap: 72px; }
.sec { display: grid; grid-template-columns: 320px minmax(0, 860px); }
.sec .hint { margin-top: 20px; font-size: 19px; line-height: 29px; color: var(--accent); }
.list { list-style: none; }
.list li { font-size: 21px; line-height: 32px; color: color-mix(in srgb, var(--ink) 90%, transparent); padding: 16px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.screens { display: grid; gap: 24px; }
.screens.n2 { grid-template-columns: 1fr 1fr; }
.screens.n3 { grid-template-columns: 1fr 1fr 1fr; }
.screens figure { border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 10.4; }
.screens.n3 figure { aspect-ratio: 16 / 9; }
.screens.tall figure { aspect-ratio: 612 / 435; }
.screens img { width: 100%; height: 100%; object-fit: cover; }
.closing { border-top: 1px solid var(--line); padding-top: 72px; margin-top: 72px; display: flex; align-items: baseline; gap: 28px; flex-wrap: wrap; }
.closing .display { font-size: 32px; letter-spacing: -0.01em; }
.closing a { font-size: 20px; font-weight: 500; }
.next { margin: 72px 0 120px; display: grid; gap: 8px; }
.next span { font-size: 16px; color: var(--accent); }
.next a { font-family: var(--display); font-weight: 500; font-size: 32px; letter-spacing: -0.01em; }

/* Zoomable images + lightbox */
[data-zoom] { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 64px;
  background: var(--scrim); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.lightbox.open { display: grid; animation: fade 0.2s ease; }
.lightbox img { max-width: min(1400px, 100%); max-height: calc(100vh - 128px); border-radius: 12px; object-fit: contain; }
.lightbox button {
  position: absolute; top: 24px; right: 28px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--ink);
  font-size: 22px; line-height: 1; cursor: pointer;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Archive */
.arch-head { padding-top: 72px; display: grid; gap: 18px; }
.arch-list { margin-top: 72px; border-top: 1px solid var(--line); }
.arch-row { display: grid; grid-template-columns: 320px minmax(0, 1fr); padding: 48px 0; border-bottom: 1px solid var(--line); }
.arch-row .year { color: var(--accent); }
.arch-row h2 { font-size: 36px; line-height: 43px; letter-spacing: -0.03em; }
.arch-row p { font-size: 20px; line-height: 30px; color: var(--muted); margin-top: 12px; max-width: 720px; }
.arch-row .role { font-size: 16px; color: var(--accent); margin-top: 10px; }
.strip-wrap { position: relative; margin-top: 44px; margin-right: calc(-1 * var(--pad)); }
.strip { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-right: 96px; }
.strip::-webkit-scrollbar { display: none; }
.strip img { height: 300px; width: auto; border-radius: 10px; flex: none; scroll-snap-align: start; }
.cue {
  position: absolute; top: 0; right: 0; width: 64px; height: 300px; border: 0; cursor: pointer;
  background: linear-gradient(90deg, transparent, var(--bg) 85%);
  display: grid; place-items: center; transition: opacity 0.3s ease;
}
.cue span {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink);
  background: color-mix(in srgb, var(--ink) 16%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  font-size: 22px; line-height: 1; transition: transform 0.3s ease, background 0.2s ease;
}
.cue:hover span { background: color-mix(in srgb, var(--ink) 26%, transparent); }
.cue.at-end span { transform: rotate(180deg); }

/* About */
.about-hero { padding-top: 72px; display: grid; gap: 24px; max-width: 900px; }
.about-hero .big { font-size: 24px; line-height: 36px; color: var(--ink); }
.about-hero .small { font-size: 19px; line-height: 30px; color: var(--muted); }
.about-hero .links { display: flex; gap: 32px; font-size: 19px; font-weight: 500; }
.about-body { margin-top: 72px; border-top: 1px solid var(--line); padding-top: 72px; display: grid; gap: 72px; }
.about-body .sec p { font-size: 21px; line-height: 32px; color: var(--muted); margin-top: 16px; }
.xp { list-style: none; }
.xp li { display: grid; grid-template-columns: 240px 200px 1fr; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
.xp li:first-child { padding-top: 0; }
.xp .when { color: var(--accent); }
.xp .title { color: var(--muted); }
.contact { border-top: 1px solid var(--line); margin: 72px 0 120px; padding-top: 72px; display: flex; gap: 40px; align-items: baseline; flex-wrap: wrap; }
.contact a { font-size: 19px; font-weight: 500; }

/* Tablet */
@media (max-width: 1100px) {
  :root { --pad: 48px; }
  .work { grid-template-columns: 1fr; gap: 40px; }
  .preview { position: static; padding-top: 0; }
  .sec { grid-template-columns: 220px 1fr; }
  .arch-row { grid-template-columns: 200px 1fr; }
  .xp li { grid-template-columns: 200px 160px 1fr; }
}

/* Phone */
@media (max-width: 720px) {
  :root { --pad: 20px; }
  body { font-size: 16px; }
  .nav { height: 84px; }
  .toggle { width: 56px; height: 28px; }
  .toggle .knob { width: 20px; height: 20px; left: 33px; }
  .toggle::before { left: 8px; width: 8px; height: 8px; }
  .toggle::after { right: 8px; width: 10px; height: 10px; }
  .h-hero { font-size: 38px; line-height: 44px; }
  .h-page { font-size: 46px; line-height: 52px; }
  .h-section { font-size: 26px; line-height: 34px; }
  .lede { font-size: 18px; line-height: 28px; }
  .hero { padding-top: 24px; }
  .scene { margin-top: 56px; }
  .scene img { min-width: 720px; transform: translateX(-25%); }
  .work { padding-top: 56px; }
  .row .name { font-size: 26px; line-height: 32px; }
  .row .meta { font-size: 14px; }
  .row::before { display: none; }
  .preview .cap { padding: 12px 0 0; flex-direction: column; gap: 8px; }
  .foot { margin-top: 64px; flex-direction: column; }
  .foot .links { gap: 24px; }
  .cs-head, .arch-head, .about-hero { padding-top: 32px; }
  .hero-img { margin-top: 40px; }
  .facts { grid-template-columns: 1fr 1fr; gap: 24px 0; margin-top: 40px; }
  .stats { margin-top: 40px; gap: 24px; }
  .stats strong { font-size: 56px; line-height: 60px; }
  .cs-body, .about-body { margin-top: 48px; padding-top: 48px; gap: 48px; }
  .sec { grid-template-columns: 1fr; gap: 12px; }
  .list li { font-size: 18px; line-height: 28px; }
  .screens.n2, .screens.n3 { grid-template-columns: 1fr; }
  .closing { margin-top: 48px; padding-top: 48px; }
  .closing .display { font-size: 26px; }
  .next a { font-size: 26px; }
  .arch-row { grid-template-columns: 1fr; gap: 8px; padding: 36px 0; }
  .arch-row h2 { font-size: 28px; line-height: 34px; }
  .strip img { height: 220px; }
  .cue { height: 220px; }
  .xp li { grid-template-columns: 1fr; gap: 2px; }
  .contact { margin: 48px 0 80px; padding-top: 48px; gap: 20px; }
  .lightbox { padding: 16px; }
}

/* Home: concept colour rising from the bottom when a project is hovered */
.home { position: relative; overflow: hidden; }
.home-wash {
  position: absolute; left: 0; right: 0; bottom: 0; height: 60%; z-index: 0; pointer-events: none; opacity: 0;
  --concept: #17133a;
  background: linear-gradient(180deg, transparent 0%, var(--concept) 100%);
  transition: opacity 0.6s ease, --concept 0.6s ease;
}
:root[data-theme="light"] .home-wash { background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--concept) 22%, var(--bg)) 100%); }
@property --concept { syntax: "<color>"; inherits: true; initial-value: #17133a; }
.home > * { position: relative; z-index: 1; }
@media (max-width: 720px) { .br-lg { display: none; } }

.about-top { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 72px; align-items: end; }
.portrait { margin: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 1034 / 1170; background: #c4c6cd; }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@media (max-width: 1100px) { .about-top { grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; } }
@media (max-width: 720px) { .about-top { grid-template-columns: 1fr; gap: 32px; } .portrait { max-width: 320px; order: -1; margin-top: 32px; } }
.about-top { position: relative; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
.about-top .about-hero { max-width: 780px; }
.about-top .portrait { position: absolute; right: 0; top: calc(72px + 13px); bottom: 7px; width: auto; height: auto; aspect-ratio: 1034 / 1170; margin: 0; }
@media (max-width: 1100px) { .about-top { grid-template-columns: 1fr; gap: 0; } .about-top .portrait { position: static; order: -1; width: 100%; max-width: 240px; margin-top: 32px; } }
@media (max-width: 720px) { .about-top .portrait { max-width: 128px; border-radius: 10px; margin-top: 24px; } }
html { touch-action: manipulation; }
img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* Smart-zoom guard: let double-taps on the portrait land on the full-width page block, so browsers have nothing narrow to zoom into */
.about-top, .about-top .portrait, .about-top .portrait img { pointer-events: none; }
.about-top .about-hero { pointer-events: auto; }

.tori { width: 40px; height: 30px; display: inline-block; vertical-align: -4px; margin-left: 14px; }
.tori .tl { fill: #0b0920; }
:root[data-theme="light"] .tori .tl { fill: #2B2440; }

.copy { margin: 48px 0 40px; font-size: 13px; line-height: 20px; color: var(--muted); opacity: 0.7; }
.nowrap { white-space: nowrap; }
/* Scene stops growing past its native 1440px; ground and water extend to the edges */
@media (min-width: 1441px) {
  .scene img { width: 1440px; min-width: 0; display: block; margin: 0 auto; }
  .scene { background:
    linear-gradient(#2c2563, #2c2563) left 0 top 226px / 50% 3px no-repeat,
    linear-gradient(#18143a, #18143a) left 0 top 229px / 50% 1px no-repeat,
    linear-gradient(#110e2c, #110e2c) left 0 top 230px / 50% 58px no-repeat,
    linear-gradient(#2c2563, #2c2563) right 0 top 226px / 50% 2px no-repeat,
    linear-gradient(#132044, #132044) right 0 top 228px / 50% 60px no-repeat; }
}

/* Mobile menu: logo left, theme toggle + hamburger right, links drop down */
@media (max-width: 720px) {
  .logo { white-space: nowrap; font-size: 11px; }
  .nav-end { gap: 14px; }
  .toggle { margin-left: 0; }
  .burger {
    display: block; position: relative; width: 40px; height: 40px; margin-right: -8px;
    background: none; border: 0; cursor: pointer; color: var(--ink);
  }
  .burger span, .burger span::before {
    position: absolute; left: 10px; right: 10px; height: 2px; border-radius: 1px; background: currentColor;
    transition: transform 0.25s ease, top 0.25s ease;
  }
  .burger span { top: 19px; }
  .burger span::before { content: ""; left: 0; right: 0; top: -6px; }
  .burger span::after { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 1px; background: currentColor; transition: transform 0.25s ease, top 0.25s ease; }
  .nav.open .burger span { background: transparent; }
  .nav.open .burger span::before { top: 0; transform: rotate(45deg); }
  .nav.open .burger span::after { top: 0; transform: rotate(-45deg); }
  .nav-links {
    display: none; position: absolute; top: 84px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0;
    padding: 8px var(--pad) 28px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav.open .nav-links { display: flex; }
  .nav-links li { width: 100%; border-top: 1px solid var(--line); }
  .nav-links li:first-child { border-top: 0; }
  .nav-links li a { display: block; padding: 16px 0; font-family: var(--display); font-size: 28px; letter-spacing: -0.02em; color: var(--ink); }
  .nav-links li a[aria-current="page"] { color: var(--accent); }
}

/* About: quick facts */
.xp.qf li { grid-template-columns: 240px 1fr; }
@media (max-width: 1100px) { .xp.qf li { grid-template-columns: 200px 1fr; } }
@media (max-width: 720px) { .xp.qf li { grid-template-columns: 1fr; gap: 2px; } }

/* Korean resume link: small tag beside Resume on desktop, own row in the phone menu */
.nav-links li.nav-ko { margin-left: -22px; }
.nav-links li.nav-ko a { font-size: 12px; letter-spacing: 0.04em; padding: 1px 8px; border: 1px solid var(--line); border-radius: 10px; }
.nav-ko .m { display: none; }
@media (max-width: 720px) {
  .nav-links li.nav-ko { margin-left: 0; }
  .nav-links li.nav-ko a { font-size: 28px; letter-spacing: -0.02em; padding: 16px 0; border: 0; border-radius: 0; }
  .nav-ko .d { display: none; }
  .nav-ko .m { display: inline; }
}
