/* ==========================================================================
   NN-Portfolio
   Layout: a one-screen "desk". An oversized expanded grotesk carries the
   identity, mono labels carry metadata, and every section opens as a
   window (desktop) or a sheet (phone). Black on white only: emphasis comes
   from inverting a surface, never from adding a color.
   ========================================================================== */

:root {
  /* Color: page */
  --bg: #f4f4f2;
  --fg: #0e0e0d;
  --muted: #6b6b67;
  --line: #d3d3cf;
  --surface: #e7e7e4;
  /* Color: inverted surfaces */
  --bg-inv: #0e0e0d;
  --fg-inv: #f4f4f2;
  --muted-inv: #9b9b96;
  --line-inv: #30302e;
  --surface-inv: #1b1b1a;
  --scrim: rgba(14, 14, 13, 0.4);
  --shadow-win: 0 24px 60px -24px rgba(14, 14, 13, 0.35);
  --shadow-win-front: 0 40px 90px -30px rgba(14, 14, 13, 0.5);
  /* Blend instruments: used only with mix-blend-mode: difference */
  --blend: #f5f5f5;
  --blend-ink: #000000;

  /* Type */
  --font-display: "Archivo", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-body: "Archivo", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-pixel: "Galmuri9", "JetBrains Mono", ui-monospace, monospace;

  --fs-label: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: clamp(1.0625rem, 0.98rem + 0.4vw, 1.3125rem);
  --fs-lg: clamp(1.375rem, 1.05rem + 1.5vw, 2.5rem);

  /* Space & layout */
  --gutter: clamp(16px, 3.2vw, 48px);
  --col-gap: clamp(16px, 2vw, 32px);
  --max-w: 1760px;
  --header-h: 64px;
  --status-h: 44px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0d;
    --fg: #f0f0ed;
    --muted: #8f8f8a;
    --line: #2c2c2a;
    --surface: #1a1a19;
    --bg-inv: #f0f0ed;
    --fg-inv: #0e0e0d;
    --muted-inv: #5f5f5b;
    --line-inv: #cdcdc9;
    --surface-inv: #e2e2de;
    --scrim: rgba(0, 0, 0, 0.6);
    --shadow-win: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
    --shadow-win-front: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e0e0d;
  --fg: #f0f0ed;
  --muted: #8f8f8a;
  --line: #2c2c2a;
  --surface: #1a1a19;
  --bg-inv: #f0f0ed;
  --fg-inv: #0e0e0d;
  --muted-inv: #5f5f5b;
  --line-inv: #cdcdc9;
  --surface-inv: #e2e2de;
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow-win: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  --shadow-win-front: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; border-radius: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, dl, dd, figure, blockquote { margin: 0; font-weight: inherit; font-size: inherit; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; z-index: 200;
  left: max(16px, env(safe-area-inset-left, 0px));
  top: calc(12px + env(safe-area-inset-top, 0px));
  padding: 10px 16px;
  background: var(--fg); color: var(--bg);
  font-family: var(--font-mono); font-size: var(--fs-label);
  transform: translateY(-200%);
  transition: transform .3s var(--ease-out);
}
.skip-link:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Roll label: text slides up and a copy slides in from below */
.roll { display: inline-flex; overflow: hidden; vertical-align: top; }
.roll__inner { position: relative; display: block; transition: transform .55s var(--ease-out); }
.roll__inner::after { content: attr(data-text); position: absolute; left: 0; top: 100%; }
@media (hover: hover) {
  :is(a, button):hover > .roll .roll__inner,
  .roll:hover .roll__inner { transform: translateY(-100%); }
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  padding-top: env(safe-area-inset-top, 0px);
  color: var(--blend);
  mix-blend-mode: difference;
  pointer-events: none;
}
.site-header a,
.site-header button { pointer-events: auto; }
.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: inline-flex;
  align-items: flex-start;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  font-variation-settings: "wdth" 115;
  letter-spacing: -0.02em;
  line-height: 1;
}
.logo sup { font-size: 0.55em; line-height: 1; margin-left: 2px; }

.nav ul { display: flex; gap: clamp(20px, 2.6vw, 44px); }
.nav__btn {
  display: inline-flex;
  align-items: flex-start;
  gap: 3px;
  padding-block: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}
.nav__count { font-size: 0.68em; line-height: 1; font-variant-numeric: tabular-nums; opacity: 0.75; }
.nav__count:empty { display: none; }

.site-header__tools { display: flex; align-items: center; gap: 16px; }
.theme-toggle {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: transform .7s var(--ease-out);
}
.theme-toggle svg { width: 20px; height: 20px; }
@media (hover: hover) { .theme-toggle:hover { transform: rotate(180deg); } }

/* ---------- Desk (home screen) ---------- */
.desk {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.desk__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vw, 64px);
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + clamp(4px, 1.6vw, 24px));
  padding-bottom: clamp(10px, 1.4vw, 20px);
}

.hero__meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.hero__meta p { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); line-height: 1.5; min-width: 0; }
.hero__coords { font-variant-numeric: tabular-nums; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 10px; }
.status__dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--fg); }
.status__dot::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: inherit;
  animation: pulse 2.2s var(--ease-out) infinite;
}
@keyframes pulse {
  from { transform: scale(1); opacity: 0.55; }
  to { transform: scale(3.2); opacity: 0; }
}

.desk__mid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 28px;
  align-items: end;
  align-content: end;
}
.hero__lead {
  grid-column: 1 / span 7;
  font-size: var(--fs-lg);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.desk__aside {
  grid-column: 9 / -1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.hero__sub { max-width: 38ch; color: var(--muted); }

/* Big index: main menu on phones and tablets */
.index { display: none; }
.index ul { border-top: 1px solid var(--fg); }
.index__btn {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 7.4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
  transition: padding-left .5s var(--ease-out);
}
.index__btn:active { padding-left: 10px; }
.index__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.hero__name {
  font-family: var(--font-display);
  font-size: var(--name-size, 24vw);
  font-weight: 800;
  line-height: 0.74;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
}
.hero__chars {
  display: flex;
  justify-content: space-between;
  margin-inline: calc(var(--name-size, 24vw) * -0.08);
}
.hero__char { display: block; overflow: hidden; padding-top: 0.04em; }
.hero__char--space { min-width: 0.2em; }
.hero__char > span {
  display: block;
  font-variation-settings: "wdth" 125, "wght" 800;
  will-change: transform;
}
.hero__probe {
  position: absolute;
  left: -9999px; top: 0;
  visibility: hidden;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 100px;
  font-weight: 900;
  font-variation-settings: "wdth" 125, "wght" 900;
  text-transform: uppercase;
}
.hero__probe span { display: inline-block; }

/* Status bar with a slow ticker */
.statusbar {
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.statusbar__inner {
  height: var(--status-h);
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.statusbar__inner p { flex: none; white-space: nowrap; }
.ticker {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ticker__track { display: flex; width: max-content; will-change: transform; }
.ticker__group { display: inline-flex; flex: none; gap: 18px; padding-right: 18px; white-space: nowrap; }
.ticker__sep { font-style: normal; opacity: 0.5; }
.noscript { padding: 16px var(--gutter); font-size: var(--fs-sm); }

/* ---------- Windows ---------- */
.windows { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.has-sheet .windows { z-index: 70; }

.win {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  min-height: 220px;
  overflow: hidden;
  resize: both;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--fg);
  box-shadow: var(--shadow-win);
  outline: none;
}
.win.is-front { box-shadow: var(--shadow-win-front); }
.win.is-dragging { user-select: none; }
.win.is-closing { pointer-events: none; }

.win__bar {
  position: relative;
  flex: none;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 0 16px;
  border-bottom: 1px solid var(--fg);
  background: var(--bg);
  user-select: none;
  touch-action: none;
}
.win:not(.is-front) .win__bar { color: var(--muted); border-bottom-color: var(--line); }
.win__title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.win__name { overflow: hidden; text-overflow: ellipsis; }
.win.is-editing .win__name { font-family: var(--font-body); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0; }
.win__meta { color: var(--muted); font-variant-numeric: tabular-nums; }
.win__ctrls { flex: none; display: flex; align-items: center; gap: 2px; }
.win__tools { display: flex; align-items: center; gap: 6px; }
.win__tools:not(:empty) { margin-right: 6px; }
.win__btn {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: color .2s, background-color .2s;
}
.win__btn svg { width: 18px; height: 18px; }
.win__btn:hover { color: var(--fg); background: var(--surface); }
.win__grip { display: none; }

.win__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  container-type: inline-size;
  -webkit-overflow-scrolling: touch;
}
.win__content {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4cqi, 48px);
  padding: clamp(20px, 4cqi, 44px);
  padding-bottom: clamp(32px, 6cqi, 64px);
}

/* Phone: sheets slide up from the bottom */
.win--sheet {
  left: 0 !important;
  right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
  bottom: 0;
  width: auto !important;
  height: auto !important;
  min-width: 0;
  resize: none;
  border: 0;
  border-top: 1px solid var(--fg);
  box-shadow: 0 -24px 60px -24px rgba(0, 0, 0, 0.45);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.win--sheet .win__bar { height: 56px; padding-top: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(6px, env(safe-area-inset-right, 0px)); }
.win--sheet .win__grip {
  display: block;
  position: absolute;
  left: 50%; top: 7px;
  width: 40px; height: 4px;
  margin-left: -20px;
  border-radius: 2px;
  background: var(--line);
}
.win--sheet .win__btn--max { display: none; }
.win--sheet .win__content { padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 65;
  background: var(--scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s var(--ease-out);
}
body.has-sheet::after { opacity: 1; }

/* Content entrance inside a window */
@keyframes rv-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.win__content .rv { animation: rv-in .8s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms + 160ms); }
.win__content.no-rv .rv { animation: none; }

.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-block: 0.1em; margin-block: -0.1em; }
.split .w > span { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease-out) calc(var(--i, 0) * 45ms + 220ms); }
.split.is-in .w > span { transform: none; }

/* Shared bits inside windows */
.w-intro { max-width: 52ch; color: var(--muted); font-size: var(--fs-md); line-height: 1.6; }
.empty { color: var(--muted); }
.prose { max-width: 62ch; line-height: 1.75; }
.prose > * + * { margin-top: 1em; }
.prose h4 { font-family: var(--font-display); font-size: 1.25em; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; margin-top: 1.6em; }
.prose ul { padding-left: 1.1em; list-style: disc; }
.prose li + li { margin-top: 0.3em; }
.prose blockquote { padding-left: 1em; border-left: 2px solid var(--fg); color: var(--fg); }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose code { font-family: var(--font-mono); font-size: 0.88em; padding: 0.1em 0.35em; background: var(--surface); }
.prose img { width: 100%; height: auto; filter: grayscale(1); }
.prose strong { font-weight: 600; color: var(--fg); }

/* ---------- Work list ---------- */
.plist { border-top: 1px solid var(--fg); }
.plist__item { border-bottom: 1px solid var(--line); }
.prow {
  --bleed: clamp(8px, 2cqi, 20px);
  position: relative;
  isolation: isolate;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 2.4fr) minmax(0, 2.4fr) 3.5rem 24px;
  align-items: center;
  column-gap: 16px;
  padding-block: clamp(14px, 2.4cqi, 26px);
  text-align: left;
  transition: color .45s var(--ease-out), opacity .45s var(--ease-out);
}
.prow::before {
  content: "";
  position: absolute;
  inset: 0 calc(-1 * var(--bleed));
  z-index: -1;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform .6s var(--ease-out);
}
.prow__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.6cqi, 3.25rem);
  font-weight: 600;
  font-variation-settings: "wdth" 100;
  line-height: 1.02;
  letter-spacing: -0.04em;
  transition: font-variation-settings .7s var(--ease-out), transform .7s var(--ease-out);
}
.prow__cat { font-size: var(--fs-sm); }
.prow__role { font-size: var(--fs-sm); color: var(--muted); transition: color .45s var(--ease-out); }
.prow__year { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; text-align: right; }
.prow__arrow { justify-self: end; width: 22px; height: 22px; transition: transform .6s var(--ease-out); }
.prow .prow__art { display: none; }
.prow:focus-visible { outline-offset: 0; color: var(--bg); }
.prow:focus-visible::before { transform: scaleY(1); }
.prow:focus-visible .prow__role { color: inherit; }
@media (hover: hover) and (pointer: fine) {
  .prow:hover { color: var(--bg); }
  .prow:hover::before { transform: scaleY(1); transform-origin: 50% 100%; }
  .prow:hover .prow__title { font-variation-settings: "wdth" 125; transform: translateX(12px); }
  .prow:hover .prow__role { color: inherit; }
  .prow:hover .prow__arrow { transform: rotate(-45deg); }
  .plist:hover .prow:not(:hover) { opacity: 0.4; }
}
@container (max-width: 620px) {
  .prow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; padding-block: 16px 20px; }
  .prow .prow__art { display: block; grid-column: 1 / -1; margin-bottom: 12px; }
  .prow__title { grid-column: 1; }
  .prow__year { grid-column: 2; grid-row: 2; }
  .prow__cat { grid-column: 1 / -1; color: var(--muted); }
  .prow__role, .prow__arrow { display: none; }
  .prow::before { display: none; }
  .prow:hover .prow__title { transform: none; }
}

/* ---------- Generative artwork ---------- */
.art {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  container-type: inline-size;
  background-color: var(--surface);
  color: var(--fg);
}
.art__label {
  position: absolute;
  left: 6cqi; bottom: 6cqi;
  font-family: var(--font-display);
  font-size: min(7.5cqi, 4.5rem);
  font-weight: 700;
  font-variation-settings: "wdth" 120;
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.art--image img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.art--ruled {
  --rule: clamp(18px, 6cqi, 44px);
  background-image:
    linear-gradient(90deg, transparent 14%, color-mix(in srgb, var(--fg) 45%, transparent) 14%, color-mix(in srgb, var(--fg) 45%, transparent) calc(14% + 1px), transparent calc(14% + 1px)),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--rule) - 1px), color-mix(in srgb, var(--fg) 20%, transparent) calc(var(--rule) - 1px) var(--rule));
}
.art--rings {
  background-image: repeating-radial-gradient(circle at 62% 44%, transparent 0 2.6cqi, color-mix(in srgb, var(--fg) 70%, transparent) 2.6cqi calc(2.6cqi + 1px));
}
.art--map {
  background-image:
    linear-gradient(color-mix(in srgb, var(--fg) 14%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--fg) 14%, transparent) 1px, transparent 1px);
  background-size: 7cqi 7cqi;
}
.art--map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.art--type { background-color: var(--fg); color: var(--bg); }
.art__glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 6cqi;
  font-family: var(--font-display);
  font-size: 46cqi;
  line-height: 1;
  letter-spacing: -0.04em;
}
.art__glyph b { font-weight: 900; font-variation-settings: "wdth" 125, "wght" 900; }
.art__glyph i { font-style: normal; font-weight: 200; font-variation-settings: "wdth" 62, "wght" 200; }
.art--dots::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--fg) 38%, transparent 40%);
  background-size: 3.2cqi 3.2cqi;
  -webkit-mask-image: linear-gradient(115deg, transparent 8%, #000 85%);
  mask-image: linear-gradient(115deg, transparent 8%, #000 85%);
}
.art--wave::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, var(--fg) 0 0.9cqi, transparent 0.9cqi 2.4cqi);
  -webkit-mask-image: radial-gradient(ellipse 46% 32% at 50% 44%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 46% 32% at 50% 44%, #000 30%, transparent 100%);
}

/* Floating preview over the Work list */
.preview {
  position: fixed;
  left: 0; top: 0;
  z-index: 80;
  width: clamp(240px, 22vw, 360px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  pointer-events: none;
  transform: scale(0);
  will-change: transform;
}
.preview__track { display: flex; flex-direction: column; height: 100%; transition: transform .75s var(--ease-out); }
.preview__track > .art { flex: 0 0 100%; aspect-ratio: auto; }
@media not all and (hover: hover) and (pointer: fine) {
  .preview { display: none; }
}

/* ---------- Project / note detail ---------- */
.pd__head { display: flex; flex-direction: column; gap: 14px; }
.pd__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 11cqi, 7rem);
  font-weight: 700;
  font-variation-settings: "wdth" 112;
  line-height: 0.9;
  letter-spacing: -0.05em;
}
.pd__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  column-gap: clamp(24px, 5cqi, 56px);
  row-gap: 32px;
}
.pd__main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pd__lead { max-width: 48ch; font-size: var(--fs-md); line-height: 1.6; }
.pd__main .prose { color: var(--muted); }
.pd__meta { align-self: start; border-top: 1px solid var(--fg); }
.pd__meta > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 14px;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.pd__meta dt { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.7; color: var(--muted); }
.pd__art .art { aspect-ratio: 16 / 9; }
.pnext {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: clamp(20px, 3cqi, 32px);
  border-top: 1px solid var(--fg);
  text-align: left;
}
.pnext__text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pnext__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7cqi, 4.5rem);
  font-weight: 600;
  font-variation-settings: "wdth" 100;
  line-height: 1;
  letter-spacing: -0.045em;
  transition: font-variation-settings .7s var(--ease-out);
}
.pnext__arrow { flex: none; width: clamp(28px, 5cqi, 48px); height: clamp(28px, 5cqi, 48px); transition: transform .6s var(--ease-out); }
@media (hover: hover) {
  .pnext:hover .pnext__title { font-variation-settings: "wdth" 125; }
  .pnext:hover .pnext__arrow { transform: translateX(8px); }
}
@container (max-width: 640px) {
  .pd__grid { grid-template-columns: minmax(0, 1fr); }
  .pd__art .art { aspect-ratio: 4 / 3; }
}

.note__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7cqi, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.prose--note { font-size: var(--fs-md); line-height: 1.85; }

/* ---------- About ---------- */
.about__statement {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5.4cqi, 3.5rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.04em;
  text-wrap: pretty;
}
.about__body { max-width: none; column-count: 2; column-gap: clamp(20px, 4cqi, 40px); font-size: var(--fs-md); line-height: 1.7; }
.about__body > * { break-inside: avoid; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 16px;
  border-top: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; min-width: 0; }
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 10cqi, 6.5rem);
  font-weight: 300;
  font-variation-settings: "wdth" 110;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.stat__num [data-count] { display: inline-block; text-align: right; }

.svc { display: flex; flex-direction: column; gap: 20px; padding-top: 12px; }
.svc__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 32px; align-items: end; }
.svc__title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 8cqi, 5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.05em;
}
.svc__intro { color: var(--muted); max-width: 40ch; }

.acc { border-top: 1px solid var(--fg); }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: clamp(14px, 2.4cqi, 24px);
  text-align: left;
}
.acc__title {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 4.2cqi, 2.75rem);
  font-weight: 600;
  font-variation-settings: "wdth" 100;
  line-height: 1.05;
  letter-spacing: -0.04em;
  transition: font-variation-settings .7s var(--ease-out), transform .7s var(--ease-out);
}
.acc__item.is-open .acc__title { font-variation-settings: "wdth" 118; }
@media (hover: hover) { .acc__btn:hover .acc__title { transform: translateX(10px); } }
.acc__icon { position: relative; flex: none; width: 24px; height: 24px; }
.acc__icon::before,
.acc__icon::after {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 100%; height: 1.5px;
  margin-top: -0.75px;
  background: currentColor;
  transition: transform .6s var(--ease-out);
}
.acc__icon::after { transform: rotate(90deg); }
.acc__item.is-open .acc__icon::after { transform: rotate(0deg); }
.acc__item.is-open .acc__icon::before { transform: rotate(180deg); }
.acc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .7s var(--ease-out); }
.acc__item.is-open .acc__panel { grid-template-rows: 1fr; }
.acc__inner { min-height: 0; overflow: hidden; }
.acc__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 32px;
  padding-bottom: clamp(18px, 3cqi, 28px);
}
.acc__content p { max-width: 46ch; }
.tags { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; }
.tags li {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
@container (max-width: 620px) {
  .about__body { column-count: 1; }
  .svc__head, .acc__content { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Experience ---------- */
.xp { border-top: 1px solid var(--fg); }
.xp__item { border-bottom: 1px solid var(--line); }
.xp__row {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(0, 3.4fr) minmax(0, 4fr) minmax(0, 1.2fr);
  column-gap: 16px;
  row-gap: 4px;
  align-items: baseline;
  padding-block: clamp(14px, 2.2cqi, 22px);
}
.xp__period, .xp__place {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.xp__place { text-align: right; }
.xp__org {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.6cqi, 2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  transition: transform .6s var(--ease-out);
}
@media (hover: hover) { .xp__row:hover .xp__org { transform: translateX(8px); } }
@container (max-width: 620px) {
  .xp__row { grid-template-columns: minmax(0, 1fr) auto; }
  .xp__period { grid-column: 1; grid-row: 1; }
  .xp__place { grid-column: 2; grid-row: 1; }
  .xp__org, .xp__role { grid-column: 1 / -1; }
  .xp__role { color: var(--muted); }
}

/* ---------- Notes ---------- */
.nlist { border-top: 1px solid var(--fg); }
.nlist__item { border-bottom: 1px solid var(--line); }
.nrow {
  width: 100%;
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) 22px;
  align-items: baseline;
  gap: 16px;
  padding-block: clamp(14px, 2.2cqi, 22px);
  text-align: left;
}
.nrow__date { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.nrow__title {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 3.2cqi, 1.75rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.03em;
  transition: transform .6s var(--ease-out);
}
.nrow__arrow { width: 20px; height: 20px; align-self: center; transition: transform .6s var(--ease-out); }
@media (hover: hover) {
  .nrow:hover .nrow__title { transform: translateX(8px); }
  .nrow:hover .nrow__arrow { transform: rotate(-45deg); }
}
@container (max-width: 480px) {
  .nrow { grid-template-columns: minmax(0, 1fr) 20px; }
  .nrow__date { grid-column: 1 / -1; }
}

/* ---------- Contact ---------- */
.contact__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 11cqi, 7rem);
  font-weight: 700;
  font-variation-settings: "wdth" 108;
  line-height: 0.88;
  letter-spacing: -0.055em;
  max-width: 12ch;
  text-wrap: balance;
}
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 24px clamp(24px, 5cqi, 56px);
  align-items: end;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.contact__text { max-width: 34ch; font-size: var(--fs-md); }
.contact__actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.contact__mail { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.contact__email {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4cqi, 2.25rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  word-break: break-all;
}
.btn-circle {
  position: relative;
  isolation: isolate;
  flex: none;
  width: clamp(92px, 14cqi, 124px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color .5s var(--ease-out), transform .5s var(--ease-out);
}
.btn-circle::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 50%;
  background: var(--fg);
  transform: translateY(101%);
  transition: transform .6s var(--ease-out);
}
@media (hover: hover) {
  .btn-circle:hover { color: var(--bg); }
  .btn-circle:hover::before { transform: none; }
}
.socials { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: var(--fs-md); }
.socials a { display: inline-flex; align-items: center; gap: 6px; }
.socials__arrow { width: 16px; height: 16px; transform: rotate(-45deg); transition: transform .5s var(--ease-out); }
@media (hover: hover) { .socials a:hover .socials__arrow { transform: rotate(0deg) translateX(3px); } }
@container (max-width: 620px) {
  .contact__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Owner: edit tools & forms ---------- */
/* Owner UI is mostly Korean: body font, no tracking (mono tracking spaces Hangul apart) */
.win__edit,
.tool-btn,
.add-btn,
.ebtn,
.editbar__btn {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
}
.win__edit { height: 28px; padding: 0 12px; border: 1px solid var(--fg); color: var(--fg); }
.win__edit:hover { background: var(--fg); color: var(--bg); }
.item-tools { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 14px; }
.tool-btn { height: 28px; min-width: 28px; padding: 0 10px; border: 1px solid var(--line); }
.tool-btn:hover { border-color: var(--fg); }
.tool-btn:disabled { opacity: 0.3; pointer-events: none; }
.tool-btn--danger.is-armed { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.add-btn { align-self: flex-start; height: 40px; padding: 0 16px; border: 1px dashed var(--fg); }
.add-btn:hover { background: var(--surface); }

.eform { display: flex; flex-direction: column; gap: 20px; }
.eform__intro { max-width: 56ch; color: var(--muted); }
.eform__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.eform__field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.eform__field.is-wide { grid-column: 1 / -1; }
.eform__label { font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.eform input,
.eform textarea,
.eform select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  transition: border-color .2s, box-shadow .2s;
}
.eform textarea { resize: vertical; line-height: 1.65; min-height: 3.5em; }
.eform select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.eform input:focus,
.eform textarea:focus,
.eform select:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.eform__hint { font-size: 0.8125rem; line-height: 1.5; color: var(--muted); }
.eform__error { min-height: 1.4em; font-size: var(--fs-sm); font-weight: 500; }
.eform__error:not(:empty)::before { content: "! "; font-family: var(--font-mono); }
.eform__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ebtn { height: 44px; padding: 0 20px; border: 1px solid var(--fg); }
.ebtn:hover { background: var(--surface); }
.ebtn--primary { background: var(--fg); color: var(--bg); }
.ebtn--primary:hover { background: var(--fg); opacity: 0.85; }
.ebtn--danger { margin-left: auto; }
.ebtn--danger.is-armed { background: var(--fg); color: var(--bg); }
.ebtn:disabled { opacity: 0.5; pointer-events: none; }
.eform--login .eform__actions .ebtn { flex: 1; }
@container (max-width: 560px) {
  .eform__grid { grid-template-columns: minmax(0, 1fr); }
}

.editbar {
  position: fixed;
  z-index: 85;
  left: max(16px, env(safe-area-inset-left, 0px));
  bottom: calc(var(--status-h) + 12px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100vw - 32px);
  padding: 6px 6px 6px 14px;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: var(--shadow-win);
  animation: rv-in .5s var(--ease-out) both;
}
.editbar[hidden] { display: none; }
.has-sheet .editbar { display: none; }
.editbar__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bg); animation: blink 1.6s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.editbar__label { margin-right: 6px; }
.editbar__warn { padding: 4px 8px; border: 1px dashed currentColor; }
.editbar__btn { height: 30px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent); }
.editbar__btn:hover { background: var(--bg); color: var(--fg); }

.toast {
  position: fixed;
  z-index: 95;
  left: 50%;
  bottom: calc(var(--status-h) + 16px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  background: var(--fg);
  color: var(--bg);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-win);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .35s var(--ease-out), transform .45s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Cursor (ported from NYAHOME) ----------
   A 3px dot plus four corner brackets. The brackets sit wide at rest and
   tighten onto anything clickable; over a text field they shrink away and
   four bars spring out into an I-beam. Pressing fills the locked square.
   mix-blend-mode: difference inverts one light drawing against whatever
   is behind it, so it never branches on background color. The dot snaps to
   the pointer; the trail (brackets) eases behind it in effects.js. */
html.cursor-on,
html.cursor-on * { cursor: none !important; }

.cursor {
  position: fixed; top: 0; left: 0; z-index: 9800; pointer-events: none;
  mix-blend-mode: difference; opacity: 0; transition: opacity .18s ease;
}
.cursor.on { opacity: 1; }
.cursor-dot, .cursor-trail { position: absolute; top: 0; left: 0; will-change: transform; }
.cursor-dot { width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; background: var(--blend); }
.cursor-in { position: absolute; top: 0; left: 0; transition: transform .12s ease; }
.cursor-ring { position: absolute; top: 0; left: 0; transition: transform .3s ease, opacity .18s ease; }
.cursor-cn {
  position: absolute; top: 0; left: 0; width: 5px; height: 5px;
  border: 0 solid var(--blend);
  transition: transform .3s ease;
}
/* rest: spread wide */
.cursor-cn.c-tl { border-top-width: 1.5px; border-left-width: 1.5px; transform: translate(-13px, -13px); }
.cursor-cn.c-tr { border-top-width: 1.5px; border-right-width: 1.5px; transform: translate(8px, -13px); }
.cursor-cn.c-bl { border-bottom-width: 1.5px; border-left-width: 1.5px; transform: translate(-13px, 8px); }
.cursor-cn.c-br { border-bottom-width: 1.5px; border-right-width: 1.5px; transform: translate(8px, 8px); }
/* locked on: tight around a 16px square */
.cursor[data-state="interactive"] .c-tl { transform: translate(-8px, -8px); }
.cursor[data-state="interactive"] .c-tr { transform: translate(3px, -8px); }
.cursor[data-state="interactive"] .c-bl { transform: translate(-8px, 3px); }
.cursor[data-state="interactive"] .c-br { transform: translate(3px, 3px); }
/* text: brackets shrink away as four bars spring out into an 18px I-beam */
.cursor-bar {
  position: absolute; top: 0; left: 0;
  width: 1.5px; height: 7px; margin: -3.5px 0 0 -0.75px;
  background: var(--blend); opacity: 0;
  transform: translate(0, 0) rotate(90deg) scaleY(.3);
  transition: transform .3s ease, opacity .18s ease;
}
.cursor[data-state="text"] .cursor-ring { transform: scale(.35); opacity: 0; }
.cursor[data-state="text"] .cursor-bar { opacity: 1; }
.cursor[data-state="text"] .b-up { transform: translate(0, -4.5px) rotate(0deg) scaleY(1.2857); }
.cursor[data-state="text"] .b-down { transform: translate(0, 4.5px) rotate(0deg) scaleY(1.2857); }
.cursor[data-state="text"] .b-left { transform: translate(0, -9px) rotate(90deg) scaleY(.714); }
.cursor[data-state="text"] .b-right { transform: translate(0, 9px) rotate(90deg) scaleY(.714); }
/* pressed: quick squash, and the locked square fills solid */
.cursor-sq {
  position: absolute; top: 0; left: 0; width: 16px; height: 16px;
  margin: -8px 0 0 -8px; background: var(--blend);
  opacity: 0; transform: scale(.55);
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), opacity .14s ease;
}
.cursor.pressed .cursor-in { transform: scale(.88); transition-duration: .12s; }
.cursor[data-state="interactive"].pressed .cursor-sq { opacity: 1; transform: scale(1); }

/* Coordinate readout (X:0830 / Y:0081). Whole-pixel line-height keeps the
   pixel font crisp. */
.cursor-coord {
  position: fixed; z-index: 9400; pointer-events: none;
  font-family: var(--font-pixel); font-size: 9px; line-height: 12px;
  color: var(--blend); mix-blend-mode: difference;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .18s ease;
}
.cursor-coord.on { opacity: 1; }
.cursor-coord span { display: block; }
@media (max-width: 600px), (hover: none) { .cursor-coord { display: none; } }
@media (hover: none) { .cursor { display: none; } }

/* ---------- Entrance (home) ---------- */
.js .hero__char > span {
  transform: translateY(105%);
  font-variation-settings: "wdth" 62, "wght" 800;
}
.js.is-loaded .hero__char > span {
  transform: none;
  font-variation-settings: "wdth" 125, "wght" 800;
  transition:
    transform 1.3s var(--ease-out) calc(var(--i, 0) * 80ms),
    font-variation-settings 1.5s var(--ease-io) calc(var(--i, 0) * 80ms + 450ms);
}
.js.hero-ready .hero__char > span { transition: none; }
.js [data-intro] { opacity: 0; transform: translateY(18px); }
.js.is-loaded [data-intro] {
  opacity: 1;
  transform: none;
  transition:
    opacity 1s var(--ease-out) calc(var(--d, 0) * 110ms + 300ms),
    transform 1.2s var(--ease-out) calc(var(--d, 0) * 110ms + 300ms);
}

/* Theme toggle wipes the new theme in as a circle */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* Reduced motion: window open/close and entrances stay (they are short and
   triggered by the visitor); looping motion stops. */
@media (prefers-reduced-motion: reduce) {
  .status__dot::after,
  .editbar__dot { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero__meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__meta-focus { display: none !important; }
  .hero__lead { grid-column: 1 / span 8; }
  .desk__aside { grid-column: 9 / -1; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .index { display: block; }
  .hero__lead,
  .desk__aside { grid-column: 1 / -1; }
  .hero__sub { max-width: 46ch; }
}

@media (max-width: 560px) {
  :root { --header-h: 56px; --status-h: 40px; }
  .hero__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__meta p:first-child { display: none; }
  .hero__sub { display: none; }
  .desk__inner { gap: 22px; }
  .ticker { display: none; }
  .statusbar__inner { justify-content: space-between; }
}

@media (max-height: 620px) and (min-width: 861px) {
  .hero__meta { display: none; }
}
