/* ============================================================
   Joon Park — portfolio
   Editorial parchment. Hairlines only, no shadows.
   One breakpoint: 820px.
   ============================================================ */

/* ---------- design tokens ---------- */

:root {
  --bg:          #f1ebdf;
  --ink:         #211e19;
  --muted:       rgba(33, 30, 25, .62);
  --accent:      #a4562e;
  --panel:       rgba(33, 30, 25, .04);
  --hover:       rgba(33, 30, 25, .035);

  --hair:        rgba(33, 30, 25, .15);   /* rules and section dividers */
  --hair-strong: rgba(33, 30, 25, .25);   /* theme toggle */
  --hair-tag:    rgba(33, 30, 25, .22);   /* tag pills */
  --hair-dash:   rgba(33, 30, 25, .28);   /* image placeholders */

  --ph-fill:     rgba(33, 30, 25, .07);   /* placeholder hatching */
  --chip-bg:     #f1ebdf;                 /* label chip sitting on the hatching */

  --display: "Space Grotesk", system-ui, sans-serif;
  --body:    Inter, system-ui, sans-serif;
  --mono:    ui-monospace, Menlo, Consolas, monospace;

  color-scheme: light;
}

html[data-th="dark"] {
  --bg:          #16140f;
  --ink:         #ece5d6;
  --muted:       #9a9280;
  --accent:      #d1804f;
  --panel:       rgba(236, 229, 214, .045);
  --hover:       rgba(236, 229, 214, .045);

  --hair:        rgba(236, 229, 214, .18);
  --hair-strong: rgba(236, 229, 214, .28);
  --hair-tag:    rgba(236, 229, 214, .22);
  --hair-dash:   rgba(236, 229, 214, .26);

  --ph-fill:     rgba(236, 229, 214, .09);
  --chip-bg:     #16140f;

  color-scheme: dark;
}

/* Fallback for the no-JS case — the inline head script normally sets data-th
   before first paint, so this only applies when scripting is off. */
@media (prefers-color-scheme: dark) {
  html:not([data-th]) {
    --bg:          #16140f;
    --ink:         #ece5d6;
    --muted:       #9a9280;
    --accent:      #d1804f;
    --panel:       rgba(236, 229, 214, .045);
    --hover:       rgba(236, 229, 214, .045);
    --hair:        rgba(236, 229, 214, .18);
    --hair-strong: rgba(236, 229, 214, .28);
    --hair-tag:    rgba(236, 229, 214, .22);
    --hair-dash:   rgba(236, 229, 214, .26);
    --ph-fill:     rgba(236, 229, 214, .09);
    --chip-bg:     #16140f;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--bg); }

h1, h2, h3, p, ul, figure { margin: 0; }

.num { font-variant-numeric: tabular-nums; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 50;
  padding: 8px 14px; border-radius: 4px;
  background: var(--ink); color: var(--bg); font-size: 13px;
}
.skip:focus { left: 16px; color: var(--bg); }

/* ---------- shell ---------- */

.wrap  { min-height: 100vh; padding: 0 30px; }
.bound { max-width: 1020px; margin: 0 auto; }

/* ---------- header ---------- */

.site-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; padding: 20px 0;
  border-bottom: 1px solid var(--hair);
}
/* Wordless home mark — the hero already carries the name, so repeating it in
   the header was redundant. Slightly larger than the 18px tool glyphs: a dot
   grid reads lighter than a stroked shape at the same size. */
.brand { display: inline-flex; }
.brand svg { width: 20px; height: 20px; }
.brand circle { fill: currentColor; }
.brand .brand-core { fill: var(--accent); }   /* needs .brand to outrank the rule above */
.site-nav { display: flex; align-items: center; gap: 20px; }
.nav-link {
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.theme-toggle {
  width: 29px; height: 29px; padding: 0;
  border: 1px solid var(--hair-strong); border-radius: 50%;
  background: transparent; color: inherit; cursor: pointer;
  font-size: 12px; line-height: 1;
  display: grid; place-items: center;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- shared type ---------- */

.label {
  font-size: 11px; font-weight: 500; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.eyebrow {
  font-size: 11px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}

/* ---------- hero ---------- */

.hero { padding: 76px 0 54px; display: flex; flex-direction: column; }
.hero-stack { display: flex; flex-direction: column; gap: 26px; }

.hero-name {
  font-family: var(--display); font-size: 56px; font-weight: 400;
  line-height: 1.02; letter-spacing: -.03em; text-transform: uppercase;
  max-width: 17ch; text-wrap: balance;
}

/* Name and location share a line, sitting on a common baseline. Wraps to two
   lines on narrow screens, where they'd otherwise overflow. */
.hero-id {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px;
}
.hero-loc { font-size: 13px; line-height: 1.5; letter-spacing: .01em; color: var(--muted); }

.profile { display: flex; flex-direction: column; gap: 13px; }
.statement {
  font-family: var(--display); font-size: 24px; font-weight: 400;
  line-height: 1.15; letter-spacing: -.02em; max-width: 24ch;
}
.para {
  font-size: 16px; line-height: 1.6; max-width: 62ch;
  color: var(--muted); text-wrap: pretty;
}

.meta-block {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; align-self: stretch;
  padding-top: 20px; margin-top: 5px;
  border-top: 1px solid var(--hair);
}
.tools { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 4px; }
.tool {
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; font-size: 15px; line-height: 1.4;
}
/* Lucide glyphs (ISC). Monochrome — they inherit the ink colour via
   currentColor, so they follow the light/dark theme. Note: no `fill` here on
   purpose — the scatter icon's dots carry their own fill="currentColor" and a
   CSS fill would override that attribute and erase them. */
.tool svg {
  flex: none; width: 18px; height: 18px;
  stroke-width: 1.75;
}

/* ---------- experience ---------- */

.about {
  padding: 48px 0 8px;
  border-top: 1px solid var(--hair);
  scroll-margin-top: 20px;
}
.about-stack { display: flex; flex-direction: column; gap: 16px; }
.roles { display: flex; flex-direction: column; gap: 22px; }
.role {
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 16px; border-top: 1px solid var(--hair);
}
.role-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
}
.role-title { font-family: var(--display); font-size: 18px; font-weight: 500; }
.role-dates {
  font-size: 12px; letter-spacing: .04em; white-space: nowrap; color: var(--muted);
}
.role-org {
  font-size: 11.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
}
.role-list {
  margin-top: 5px; padding-left: 17px; max-width: 56ch;
  display: flex; flex-direction: column; gap: 7px;
}
.role-list li { font-size: 14.5px; line-height: 1.55; }

/* ---------- selected work ---------- */

.work-sec { padding: 60px 0 20px; scroll-margin-top: 20px; }
.sec-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 20px; padding-bottom: 6px;
}
.sec-count { font-size: 11px; letter-spacing: .13em; color: var(--muted); }

.work {
  display: block; border-top: 1px solid var(--hair);
  padding: 26px 16px; margin: 0 -16px;
  transition: background .15s ease;
}
.work:hover { background: var(--hover); color: var(--ink); }
.work-grid {
  display: grid; grid-template-columns: 1fr 1.05fr;
  gap: 34px; align-items: stretch;
}
.work-text { display: flex; flex-direction: column; gap: 14px; order: 1; }
.work-head { display: flex; flex-direction: column; gap: 5px; }
.work-headline {
  font-family: var(--display); font-size: 25px; font-weight: 400;
  line-height: 1.14; letter-spacing: -.02em; max-width: 24ch;
}
.work-blurb {
  font-size: 14.5px; line-height: 1.6; max-width: 56ch;
  color: var(--muted); text-wrap: pretty;
}
.work-cta {
  margin-top: auto; font-size: 13px; letter-spacing: .03em; color: var(--accent);
}
.arrow { display: inline-block; font-style: normal; transition: transform .15s ease; }
.work:hover .arrow { transform: translateX(3px); }
.work-end { border-top: 1px solid var(--hair); }

/* image placeholders */
.ph {
  display: grid; place-items: center;
  border: 1px dashed var(--hair-dash);
  background-image: repeating-linear-gradient(45deg,
    var(--ph-fill) 0 7px, transparent 7px 14px);
}
.ph-shot { min-height: 230px; order: 2; }
.chip {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em;
  padding: 5px 8px; background: var(--chip-bg); color: var(--muted);
}

/* facts strips */
.facts3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
}
.fact { display: flex; flex-direction: column; gap: 3px; }
.fact-k {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.fact-v { font-size: 13px; line-height: 1.35; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  display: inline-block; white-space: nowrap;
  font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  border: 1px solid var(--hair-tag); border-radius: 12px;
  padding: 4px 10px; color: var(--muted);
}

/* ---------- full-bleed panels ---------- */

.panel {
  margin: 60px -30px 0; padding: 52px 30px;
  background: var(--panel); border-top: 1px solid var(--hair);
}
.panel-inner {
  max-width: 1020px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 26px;
}
/* A slim closing band that ends the page: contact link left, credit right.
   The full 52px panel padding was built for a headline and three columns. */
.panel-thin { padding-top: 22px; padding-bottom: 22px; }
.contact-row {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: baseline; gap: 8px 26px;
}
.credit { font-size: 11.5px; letter-spacing: .06em; color: var(--muted); }
.contact-cta { font-size: 12px; letter-spacing: .13em; text-transform: uppercase; }

/* ---------- footer ---------- */

/* Only the credit line remains, so send it to the right edge — space-between
   would just pin it left. */
.site-foot {
  padding: 24px 0 40px;
  display: flex; justify-content: flex-end; align-items: baseline; gap: 20px;
}
.site-foot span { font-size: 11.5px; letter-spacing: .06em; color: var(--muted); }

/* ---------- case study ---------- */

.cs-top {
  padding: 24px 0 0;
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
}
.cs-back {
  font-size: 11.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
}
.cs-counter { font-size: 11.5px; letter-spacing: .11em; color: var(--muted); }

.cs-head { padding: 52px 0 30px; display: flex; flex-direction: column; gap: 20px; }
.cs-title {
  font-family: var(--display); font-size: 44px; font-weight: 400;
  line-height: 1.05; letter-spacing: -.03em; text-transform: uppercase;
  max-width: 20ch; text-wrap: balance;
}
.cs-lede {
  font-size: 17px; line-height: 1.55; max-width: 56ch;
  color: var(--muted); text-wrap: pretty;
}

.facts4 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding: 22px 0 30px; border-top: 1px solid var(--hair);
}
.facts4 .fact-k { font-size: 10.5px; }
.facts4 .fact-v { font-size: 14.5px; line-height: 1.45; }

.ph-hero { height: 440px; }
.ph-hero .chip { font-size: 11px; padding: 6px 10px; }
.ph-detail { height: 270px; }

.cs-row {
  display: grid; grid-template-columns: 160px 1fr; gap: 34px;
  padding-top: 38px; margin-top: 38px; border-top: 1px solid var(--hair);
}
.cs-body { display: flex; flex-direction: column; gap: 26px; }
.cs-para {
  font-size: 15.5px; line-height: 1.65; max-width: 62ch; text-wrap: pretty;
}
.figure { display: flex; flex-direction: column; gap: 10px; }
.figure figcaption {
  font-size: 13px; line-height: 1.5; max-width: 52ch; color: var(--muted);
}

.stats { display: flex; flex-wrap: wrap; gap: 52px; }
.stat { display: flex; flex-direction: column; gap: 5px; }
.stat-n {
  font-family: var(--display); font-size: 38px; font-weight: 400;
  letter-spacing: -.035em; color: var(--accent);
}
.stat-k { font-size: 12.5px; letter-spacing: .04em; color: var(--muted); }

.cs-nav { margin: 52px -30px 0; padding: 30px; }
.cs-nav .panel-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.cs-step {
  display: flex; flex-direction: column; gap: 6px;
  transition: background .15s ease;
}
.cs-step:hover { color: var(--ink); }
.cs-step-next { text-align: right; }
.cs-step-title { font-family: var(--display); font-size: 19px; line-height: 1.2; }
.cs-results { display: flex; flex-direction: column; gap: 28px; }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .hero-name,
  .cs-title      { font-size: 31px; }

  /* The four nav items plus the brand are wider than a phone viewport, so let
     the bar wrap to a second row instead of forcing the page to scroll. */
  .site-head     { flex-wrap: wrap; gap: 12px 18px; }
  .site-nav      { flex-wrap: wrap; gap: 16px; }

  .work-grid     { grid-template-columns: 1fr; gap: 22px; }
  .ph-shot       { order: -1; }

  .facts4        { grid-template-columns: 1fr 1fr; gap: 20px; }
  .cs-row        { grid-template-columns: 1fr; gap: 12px; }
  .cs-nav .panel-inner { grid-template-columns: 1fr; gap: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .work, .arrow, .cs-step { transition: none; }
}
