:root {
  --bg: #FFFFFF;
  --ink: #15171B;
  --sub: #6B7079;
  --faint: #C9CDD3;
  --line: #E7E9ED;
  --panel: #F3F4F6;
  --accent: #1E5BFF;

  --d-bg: #0D0F13;
  --d-panel: #15181E;
  --d-ink: #ECEEF2;
  --d-sub: #8B919C;
  --d-faint: #3A3F49;
  --d-line: #23272F;
  --d-accent: #7EA2FF;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1200px;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --roll: cubic-bezier(.75, 0, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D0F13;
    --ink: #ECEEF2;
    --sub: #8B919C;
    --faint: #3A3F49;
    --line: #23272F;
    --panel: #15181E;
    --accent: #7EA2FF;
    --d-bg: #15181E;
    --d-panel: #0D0F13;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; background: var(--ink); color: var(--bg); border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  text-decoration-color: var(--faint);
  transition: text-decoration-color .2s, color .2s;
  /* larger touch target without moving the text */
  padding-block: 10px; margin-block: -10px;
}
.link:hover { text-decoration-color: currentColor; color: var(--accent); }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 var(--gutter);
  font-size: 14px;
  transition: background-color .3s, box-shadow .3s, color .3s;
}
.nav.is-solid {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 var(--line);
}
.nav.is-dark { background: color-mix(in srgb, var(--d-bg) 84%, transparent); color: var(--d-ink); box-shadow: 0 1px 0 var(--d-line); }
.nav-name { font-weight: 700; letter-spacing: -0.02em; text-decoration: none; opacity: 0; transition: opacity .3s; }
.nav.is-solid .nav-name { opacity: 1; }
.nav nav { display: flex; gap: clamp(16px, 2.6vw, 32px); }
.nav nav a { text-decoration: none; color: var(--sub); transition: color .2s; padding: 12px 8px; margin: -12px -8px; }
.nav nav a:hover { color: var(--ink); }
.nav.is-dark nav a { color: var(--d-sub); }
.nav.is-dark nav a:hover { color: var(--d-ink); }

/* Hero */
.hero {
  position: sticky; top: 0; z-index: 0;
  height: 100vh; height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero-inner { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); will-change: transform, opacity; }
.word {
  font-weight: 800;
  font-size: var(--word-size, 17vw);
  line-height: 1;
  letter-spacing: -0.055em;
  margin-left: -0.05em;
}
.word-inner {
  display: inline-flex; align-items: flex-start;
  opacity: 0; transform: translateY(.12em);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.hero.is-ready .word-inner { opacity: 1; transform: none; }
.part { position: relative; display: block; }
.part-j { width: var(--s-w, .62em); transition: width .8s var(--roll); }
.hero.is-j .part-j { width: var(--j-w, .5em); }
.clip { display: block; height: 1em; overflow: hidden; padding-bottom: .02em; }
.roll { display: flex; flex-direction: column; transition: transform .8s var(--roll); }
.glyph { display: block; width: max-content; height: 1em; line-height: 1; }
.hero.is-j .roll { transform: translateY(-1em); }
.glyph.j { color: var(--accent); transition: color 1.2s var(--ease) .9s; }
.hero.is-noted .glyph.j { color: var(--ink); }

.note {
  position: absolute; top: calc(100% + .3em); left: .06em; right: .1em;
  font-size: clamp(12px, .075em, 15px); font-weight: 500; letter-spacing: 0; line-height: 1.4;
  color: var(--sub); white-space: nowrap;
}
.bracket {
  display: block; height: 8px; margin-bottom: 8px;
  border: 1px solid currentColor; border-top: 0;
  transform: scaleX(0); transform-origin: left;
  transition: transform .7s var(--ease);
}
.note-text { display: block; opacity: 0; transform: translateY(-4px); transition: opacity .6s var(--ease) .25s, transform .6s var(--ease) .25s; }
.part-rest .bracket { transition-delay: .12s; }
.part-rest .note-text { transition-delay: .37s; }
.hero.is-noted .bracket { transform: none; }
.hero.is-noted .note-text { opacity: 1; transform: none; }

.hero-desc {
  margin-top: clamp(72px, 12vh, 120px);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 40px;
  opacity: 0; transition: opacity .9s var(--ease) .5s;
}
.hero.is-noted .hero-desc { opacity: 1; }
.hero-desc p { max-width: 31em; color: var(--sub); font-size: 17px; }

/* Content sheet slides over the pinned hero */
.sheet { position: relative; z-index: 1; background: var(--bg); }

/* Intro */
.intro { padding: clamp(120px, 20vh, 220px) 0 clamp(100px, 16vh, 180px); }
.reveal {
  font-size: clamp(26px, 3.5vw, 46px);
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: -0.035em;
  max-width: 23em;
}
.reveal .w { color: var(--faint); transition: color .35s; }
.reveal .w.is-on { color: var(--ink); }
.profile {
  margin-top: clamp(64px, 10vh, 112px);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.profile > div { padding: 18px 16px 0 0; }
.profile dt { font-size: 14px; color: var(--sub); margin-bottom: 4px; }
.profile dd { font-weight: 600; }

/* Groups */
.group { padding: clamp(100px, 16vh, 180px) 0; border-top: 1px solid var(--line); }
.group-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 24px;
  margin-bottom: clamp(56px, 9vh, 100px);
}
.group-name { font-size: 15px; font-weight: 600; color: var(--sub); padding-top: .6em; }
.group-title {
  font-size: clamp(32px, 4.6vw, 62px);
  font-weight: 700; line-height: 1.25; letter-spacing: -0.045em;
}

/* Fromise: sticky phone, scrolling features */
.fromise { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); }
.app-id { display: flex; gap: 20px; align-items: flex-start; }
.app-icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 0 0 1px var(--line); background: #fff; flex: none; }
.app-name { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.app-sub { color: var(--sub); font-size: 15px; margin: 4px 0 8px; }
.app-id .link { font-size: 15px; }
.features { margin-top: 8px; }
.feature {
  min-height: 62vh; display: flex; flex-direction: column; justify-content: center;
  opacity: .28; transition: opacity .5s var(--ease);
}
.feature.is-active { opacity: 1; }
.feature h4 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.35; margin-bottom: 12px; }
.feature p { color: var(--sub); max-width: 24em; }
.feature:last-child { min-height: 50vh; }

.fromise-stage { position: relative; }
.stage {
  position: sticky; top: max(84px, calc(50vh - 300px + 30px));
  aspect-ratio: 4 / 5; width: 100%; max-width: 480px; margin-left: auto;
  background: var(--panel); border-radius: 28px; overflow: hidden;
}
.shot {
  position: absolute; left: 50%; bottom: 0; width: 72%;
  transform: translate(-50%, 6%); opacity: 0;
  transition: opacity .6s var(--ease), transform .8s var(--ease);
  -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent);
}
.shot.is-active { opacity: 1; transform: translate(-50%, 0); }

/* Project rows */
.projects { margin-top: clamp(72px, 12vh, 128px); border-top: 1px solid var(--line); }
.projects > li { border-bottom: 1px solid var(--line); }
.group-head + .projects { margin-top: 0; }
.project {
  display: grid; grid-template-columns: minmax(0, 1fr) 5em 7em; gap: 24px; align-items: baseline;
  padding: 32px 0; text-decoration: none;
}
.project h3 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.3; margin-bottom: 8px; transition: color .2s; }
.project p { color: var(--sub); max-width: 38em; }
.project-kind { font-size: 14px; color: var(--sub); }
.project-open { font-size: 14px; text-align: right; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: .28em; }
.project-open.is-muted { color: var(--sub); text-decoration: none; }
a.project:hover h3 { color: var(--accent); }
a.project:hover .project-open { text-decoration-color: currentColor; }

/* Runner */
.runner { background: var(--d-bg); color: var(--d-ink); border-top: 0; }
.runner .group-name { color: var(--d-sub); }
.runner-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 24px; }
.runner-id, .xlate, .runner-why { grid-column: 2; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--d-sub); padding: 4px 12px 4px 10px; border: 1px solid var(--d-line); border-radius: 99px; margin-bottom: 20px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--d-accent); animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.runner-name { font-size: clamp(34px, 4.4vw, 56px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.15; }
.runner-sub { color: var(--d-sub); margin-top: 6px; }
.runner-desc { margin-top: 24px; font-size: clamp(18px, 1.6vw, 21px); max-width: 28em; }
.runner-link { margin-top: 16px; font-size: 15px; }
.runner .link { color: var(--d-ink); text-decoration-color: var(--d-faint); }
.runner .link:hover { color: var(--d-accent); text-decoration-color: currentColor; }

.xlate { margin-top: clamp(56px, 9vh, 96px); }
.panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pane { background: var(--d-panel); border: 1px solid var(--d-line); border-radius: 16px; padding: 18px 22px 22px; min-width: 0; }
.pane-title { font-family: var(--mono); font-size: 13px; color: var(--d-sub); margin-bottom: 14px; }
.code { font-family: var(--mono); font-size: clamp(12.5px, 1.15vw, 15px); line-height: 2; overflow-x: auto; letter-spacing: 0; }
.code li { white-space: pre; color: var(--d-sub); transition: color .3s, opacity .4s, transform .4s var(--ease); }
#codeX li.is-cur { color: var(--d-ink); }
#codeA li { opacity: 0; transform: translateX(-6px); }
#codeA li.is-on { opacity: 1; transform: none; color: var(--d-ink); }
#codeA li.is-cur { color: var(--d-accent); }
.xlate figcaption { margin-top: 16px; font-size: 15px; color: var(--d-sub); max-width: 34em; }

.runner-why { margin-top: clamp(64px, 10vh, 112px); padding-top: 24px; border-top: 1px solid var(--d-line); }
.runner-why h4 { font-size: 15px; font-weight: 600; color: var(--d-sub); margin-bottom: 10px; }
.runner-why p { max-width: 34em; }

/* Letter */
.letter { padding: clamp(120px, 20vh, 220px) 0; }
.letter-body { max-width: 30em; margin-left: 25%; font-size: clamp(19px, 1.8vw, 23px); line-height: 1.85; letter-spacing: -0.02em; font-weight: 500; display: grid; gap: 1.1em; }
.sign { margin-top: .8em; font-weight: 700; display: flex; flex-direction: column; line-height: 1.5; }
.sign span { font-size: 15px; font-weight: 400; color: var(--sub); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 14px; color: var(--sub); }
.footer-inner { display: flex; gap: 12px 28px; flex-wrap: wrap; }
.footer .copy { margin-left: auto; }

/* Tablet and phone */
@media (max-width: 900px) {
  .group-head, .runner-body { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .runner-id, .xlate, .runner-why { grid-column: 1; }
  .group-name { padding-top: 0; }
  .profile { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
  .profile > div { border-bottom: 1px solid var(--line); padding: 14px 0; }
  .profile > div:last-child { grid-column: 1 / -1; }

  .fromise { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .fromise-stage { order: -1; margin: 0 calc(var(--gutter) * -1); }
  .stage {
    position: static; aspect-ratio: auto; max-width: none; border-radius: 0; background: none;
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 0 var(--gutter); scroll-padding-inline: var(--gutter); scrollbar-width: none;
  }
  .stage::-webkit-scrollbar { display: none; }
  .shot, .shot.is-active {
    position: static; transform: none; opacity: 1; flex: 0 0 64%; width: 64%;
    scroll-snap-align: start; background: var(--panel); border-radius: 22px; padding: 20px 20px 0;
    -webkit-mask-image: none; mask-image: none;
  }
  .feature { min-height: 0; opacity: 1; padding: 22px 0; border-top: 1px solid var(--line); }
  .feature:last-child { min-height: 0; }
  .features { margin-top: 28px; }

  .project { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 26px 0; }
  .project-main { grid-column: 1 / -1; }
  .project-kind { grid-row: 2; }
  .project-open { grid-row: 2; }

  .panes { grid-template-columns: minmax(0, 1fr); }
  .letter-body { margin-left: 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav nav { gap: 16px; font-size: 13px; }
  .nav-name { font-size: 14px; }
  .hero-desc p { font-size: 16px; }
  .app-icon { width: 64px; height: 64px; border-radius: 15px; }
  .app-name { font-size: 26px; }
  .shot, .shot.is-active { flex-basis: 78%; width: 78%; }
}

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