/* ─────────────────────────────────────────────────────────────
   김두시 · @im.doosi — 실전 AI 루틴 아카이브 v2
   Paper + ink editorial, one dark band, hard offset shadows.
   No gradients, no glow, no blobs, no stock art.
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Pretendard";
  src: url("/assets/fonts/Pretendard-subset.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #faf8f5;
  --paper-2: #f2eee6;
  --paper-3: #fcfaf7;
  --card: #fffdfa;
  --ink: #161615;
  --ink-2: #35332e;
  --ink-3: #6b665f;
  --muted: #77726b;
  --line: #e3ded5;
  --line-strong: #cbc3b6;
  --accent: #ff6b3d;
  --accent-ink: #b03d18;
  --accent-soft: #ffe6dc;
  --night: #141413;
  --night-2: #1c1b19;
  --night-line: #34322d;
  --night-text: #f6f2ea;
  --night-dim: #c4bdb1;
  --night-muted: #938c81;
  --edge: 1.5px solid var(--ink);
  --sans: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, "Liberation Mono",
    "Noto Sans Mono", monospace;
  --wrap: 1180px;
  --pad: 32px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss06" 0;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

::selection { background: var(--accent-soft); color: var(--ink); }

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

.section--night :focus-visible {
  outline-color: var(--accent);
  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 {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  transition: top .2s;
}
.skip:focus { top: 12px; }

/* paper grain — very faint, keeps flat colour from looking like a mockup */
.grain {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: .028;
  background-image: url("/assets/grain.svg");
  background-size: 180px 180px;
  mix-blend-mode: multiply;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ── header ─────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 245, .9);
  backdrop-filter: saturate(1.1) blur(12px);
  -webkit-backdrop-filter: saturate(1.1) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s ease;
}
.site-header.is-scrolled { box-shadow: 0 2px 0 rgba(22, 22, 21, .06); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand img {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  object-fit: cover;
  background: var(--paper-3);
}
.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.brand-handle {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.01em;
  color: var(--muted);
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
}

.nav {
  margin-left: auto;
  display: flex;
  gap: 24px;
}
.nav a {
  position: relative;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  padding: 5px 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 0;
  background: var(--ink);
  transition: width .28s cubic-bezier(.2, .7, .2, 1);
}
.nav a:hover::after { width: 100%; }
.nav a.is-current {
  color: var(--ink);
  font-weight: 700;
}
.nav a.is-current::after { width: 100%; background: var(--accent); }

.ig-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  padding: 7px 13px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  transition: background .18s, color .18s, transform .16s, box-shadow .18s;
}
.ig-link:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--accent);
}
.ig-link svg { margin-top: 1px; }

/* ── hero ───────────────────────────────────────────────────── */

.hero { padding: 74px 0 104px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  gap: 64px;
  align-items: start;
}

.byline {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 30px;
}
.byline-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  object-fit: cover;
  background: var(--paper-3);
  box-shadow: 3px 3px 0 var(--accent);
}
.byline-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.35;
}
.byline-name span {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--muted);
  margin-left: 4px;
}
.byline-role {
  font-size: 11.5px;
  letter-spacing: .005em;
  color: var(--muted);
  margin-top: 2px;
}

h1 {
  font-size: clamp(40px, 5vw, 71px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.055em;
  margin-left: -0.025em;
  word-break: keep-all;
}
h1 .mark { color: var(--accent-ink); }

.lede {
  margin-top: 26px;
  max-width: 35ch;
  font-size: 16.5px;
  line-height: 1.78;
  color: var(--ink-2);
  letter-spacing: -0.012em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* page facts, set like a spec table */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 44px;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.fact {
  padding: 14px 16px 15px 0;
}
.fact + .fact {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.fact-k {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .07em;
  color: var(--muted);
}
.fact-v {
  display: block;
  margin-top: 5px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

/* ── buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 21px;
  border-radius: 10px;
  border: var(--edge);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, transform .16s, box-shadow .18s;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-3);
  box-shadow: 3px 3px 0 var(--accent);
}
.btn-primary:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--accent);
}
.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--accent);
}

.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper-3);
}

.btn-block { width: 100%; }

/* ── today's routine card ───────────────────────────────────── */

.routine-card {
  position: relative;
  background: var(--card);
  border: var(--edge);
  border-radius: 18px;
  padding: 22px 22px 20px;
  box-shadow: 7px 7px 0 var(--ink);
  transform: rotate(-0.55deg);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease;
}
.routine-card:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 10px 10px 0 var(--ink);
}
.routine-card::before {
  content: "";
  position: absolute;
  top: -1.5px; left: 22px;
  width: 46px; height: 4px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .09em;
  color: var(--muted);
  margin-top: 8px;
}
.card-date { color: var(--ink-3); letter-spacing: .03em; }

.card-title {
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.36;
  font-weight: 800;
  letter-spacing: -0.042em;
}

.card-desc {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* before → after */
.ba {
  margin-top: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  overflow: hidden;
}
.ba-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px dashed var(--line-strong);
}
.ba-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: -0.01em;
}
.ba-ex {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .09em;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 1px 4px;
}

.ba-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 10px 11px 0;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
}
.ba-btn {
  padding: 7px 6px;
  border: 0;
  background: var(--paper-3);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.ba-btn + .ba-btn { border-left: 1.5px solid var(--ink); }
.ba-btn:hover { background: var(--paper-2); }
.ba-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-3);
}

.ba-stage { padding: 11px; min-height: 148px; }
.ba-panel[hidden] { display: none; }

.ba-rows { display: grid; }
.ba-rows li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-3);
}
.ba-rows li::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cfc7bb;
  transform: translateY(-1px);
}
.ba-rows li:last-child { border-bottom: 0; }
.ba-rows li span {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #75706a;
}
.ba-rows li em {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-style: normal;
  font-size: 9.5px;
  color: var(--muted);
}
.ba-rows li.is-dim { opacity: .55; }

.ba-lines { display: grid; gap: 2px; }
.ba-lines li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.3px;
  line-height: 1.45;
}
.ba-lines li:last-child { border-bottom: 0; }
.ba-lines .n {
  color: var(--accent-ink);
  font-weight: 700;
  flex: 0 0 auto;
}
.ba-lines .t {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.015em;
  flex: 1 1 auto;
  min-width: 0;
}
.ba-lines em {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-style: normal;
  font-size: 9.5px;
  color: var(--muted);
}

.ba-note {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.ba-note strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-right: 2px;
}
.ba-note.is-good strong { color: var(--accent-ink); }

.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper-3);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--accent);
  transition: background .16s, box-shadow .16s, transform .14s;
}
.copy-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--accent);
}
.copy-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--accent); }
.copy-btn.is-copied {
  background: var(--accent);
  border-color: var(--accent);
  color: #241005;
  box-shadow: 2px 2px 0 var(--ink);
}
.copy-btn.is-copied .ico-copy { display: none; }
.copy-btn.is-copied::before {
  content: "";
  width: 12px; height: 7px;
  border-left: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(-45deg) translate(1px, -1px);
}

.copy-count {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .03em;
  color: var(--muted);
  white-space: nowrap;
}
.copy-count.is-zero { opacity: .72; }

.card-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.note-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  object-fit: cover;
  flex: 0 0 auto;
}

/* ── sections ───────────────────────────────────────────────── */

.section {
  border-top: 1px solid var(--line-strong);
  scroll-margin-top: 84px;
}
#top { scroll-margin-top: 0; }

.section-grid {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 56px;
  padding-top: 88px;
  padding-bottom: 96px;
}

.section-label {
  position: sticky;
  top: 100px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.section-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--accent-ink);
}
.section-word {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: -0.01em;
}
.section-label::after {
  content: "";
  width: 26px; height: 3px;
  margin-top: 12px;
  background: var(--ink);
}

.section-body { min-width: 0; }

h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.26;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.section-desc {
  margin-top: 14px;
  max-width: 58ch;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--muted);
  letter-spacing: -0.008em;
}

/* ── the dark band (section 01) ─────────────────────────────── */

.section--night {
  background: var(--night);
  border-top: 3px solid var(--accent);
  color: var(--night-text);
}
.section--night .wrap { position: relative; }
.section--night h2 { color: var(--night-text); }
.section--night .section-num { color: var(--accent); }
.section--night .section-word { color: var(--night-dim); }
.section--night .section-label::after { background: var(--night-line); }
.section--night .section-desc { color: var(--night-dim); }

/* ── tabs ───────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 2px;
  margin-top: 38px;
  border-bottom: 1px solid var(--line-strong);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 13px 15px 14px;
  border: 0;
  background: none;
  font-size: 13.7px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.012em;
  cursor: pointer;
  transition: color .2s;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] {
  color: var(--ink);
  font-weight: 800;
}
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 11px; right: 11px; bottom: -1.5px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.tag {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .07em;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 2px 5px;
  line-height: 1.3;
}
.tag-open {
  color: #241005;
  background: var(--accent);
  border-color: var(--accent);
}
.tag-soon {
  color: var(--muted);
  border-style: dashed;
}

.section--night .tabs { border-bottom-color: var(--night-line); }
.section--night .tab { color: var(--night-muted); }
.section--night .tab:hover { color: var(--night-text); }
.section--night .tab[aria-selected="true"] { color: var(--night-text); }
.section--night .tab .tag {
  border-color: var(--night-line);
  color: var(--night-muted);
}
.section--night .tab .tag-open {
  border-color: var(--accent);
  color: #241005;
}
.section--night .tag-soon { border-style: dashed; }

/* ── panels ─────────────────────────────────────────────────── */

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: 44px;
  padding-top: 28px;
  animation: panelIn .32s cubic-bezier(.2, .7, .2, 1) both;
}
.panel[hidden] { display: none; }
.panel:focus { outline: none; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.panel-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 6px;
}
.panel-meta span { position: relative; }
.panel-meta span + span::before {
  content: "/";
  position: absolute;
  left: -10px;
  color: var(--line-strong);
}
.section--night .panel-meta { color: var(--night-muted); }
.section--night .panel-meta span + span::before { color: var(--night-line); }

.steps {
  display: grid;
  gap: 24px;
}

.step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 14px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.step:first-child { border-top: 0; padding-top: 0; }

.step-num {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent-ink);
  padding-top: 4px;
}

.step h3 {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.028em;
  margin-bottom: 7px;
  line-height: 1.45;
}
.step p {
  font-size: 13.7px;
  line-height: 1.78;
  color: var(--ink-3);
  letter-spacing: -0.008em;
}

.inline-prompt {
  margin-top: 11px !important;
  padding: 9px 12px;
  background: var(--paper-2);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-size: 12px !important;
  line-height: 1.7 !important;
  color: var(--ink-2) !important;
}

.section--night .step { border-top-color: var(--night-line); }
.section--night .step h3 { color: var(--night-text); }
.section--night .step p { color: var(--night-dim); }
.section--night .step-num { color: var(--accent); }
.section--night .inline-prompt {
  background: rgba(250, 248, 245, .05);
  color: #e9e2d7 !important;
}

.panel-note {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.section--night .panel-note {
  border-top-color: var(--night-line);
  color: var(--night-muted);
}

/* input → output preview */

.io {
  margin-top: 26px;
  display: grid;
  gap: 8px;
}
.io-cap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.io-cap span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .09em;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 1px 4px;
  color: var(--ink-3);
}
.io-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper-3);
}
.io-k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}
.io-row p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  letter-spacing: -0.012em;
}
.io-arrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 24px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--accent-ink);
}
.io-arrow span {
  position: relative;
  width: 1.5px; height: 22px;
  background: linear-gradient(
    to bottom,
    var(--accent-ink) 0,
    var(--accent-ink) 15px,
    transparent 15px
  );
}
.io-arrow span::after {
  content: "";
  position: absolute;
  left: -4.25px; bottom: 0;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--accent-ink);
}
.io-row.is-out {
  border: 1.5px solid var(--ink);
  background: var(--card);
  box-shadow: 3px 3px 0 var(--accent-soft);
}
.io-row.is-out p { color: var(--ink); font-weight: 700; }

.section--night .io-cap { color: var(--night-muted); }
.section--night .io-cap span {
  border-color: var(--night-line);
  color: var(--night-muted);
}
.section--night .io-row {
  background: rgba(250, 248, 245, .04);
  border-color: var(--night-line);
}
.section--night .io-k { color: #a9a196; }
.section--night .io-row p { color: var(--night-dim); }
.section--night .io-arrow { color: var(--accent); }
.section--night .io-arrow span {
  background: linear-gradient(
    to bottom,
    var(--accent) 0,
    var(--accent) 15px,
    transparent 15px
  );
}
.section--night .io-arrow span::after { border-top-color: var(--accent); }
.section--night .io-row.is-out {
  background: rgba(255, 107, 61, .09);
  border-color: var(--accent);
  box-shadow: 3px 3px 0 rgba(255, 107, 61, .35);
}
.section--night .io-row.is-out p { color: var(--night-text); }

/* ── prompt terminal ────────────────────────────────────────── */

.term {
  position: sticky;
  top: 92px;
  align-self: start;
  border: 1.5px solid #2f2c27;
  border-radius: 14px;
  background: #0b0b0a;
  overflow: hidden;
  box-shadow: 5px 5px 0 rgba(255, 107, 61, .8);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 13px;
  background: #191816;
  border-bottom: 1px solid #262420;
}
.term-dots {
  display: inline-flex;
  gap: 5px;
  flex: 0 0 auto;
}
.term-dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3c3831;
}
.term-dots i:first-child { background: #5a5249; }
.term-file {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: #a29a8f;
  margin-right: auto;
}

.copy-btn-term {
  background: var(--paper);
  border-color: var(--paper);
  color: #161513;
  padding: 6px 10px;
  font-size: 11.5px;
  border-radius: 6px;
  box-shadow: 2px 2px 0 var(--accent);
}
.copy-btn-term:hover {
  background: #fff;
  box-shadow: 3px 3px 0 var(--accent);
}
.copy-btn-term.is-copied {
  background: var(--accent);
  border-color: var(--accent);
  color: #241005;
  box-shadow: 2px 2px 0 var(--paper);
}

.term-vars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 13px;
  border-bottom: 1px solid #221f1b;
  background: #121110;
}
.term-vars-k {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
  color: #7e766b;
  margin-right: 2px;
}
.pill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .01em;
  color: #ffb49b;
  background: rgba(255, 107, 61, .13);
  border: 1px solid rgba(255, 107, 61, .38);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1.5;
}

.term-body {
  margin: 0;
  padding: 17px 18px 19px;
  font-family: var(--sans);
  font-size: 13.4px;
  line-height: 2;
  color: #ece5da;
  letter-spacing: -0.004em;
  white-space: pre-wrap;
  tab-size: 2;
}
.term-body .tk {
  background: rgba(255, 107, 61, .16);
  box-shadow: inset 0 -1px 0 rgba(255, 107, 61, .45);
  border-radius: 3px;
  padding: 1px 3px;
  color: #ffd2c1;
}
.term-body .tn {
  color: var(--accent);
  font-weight: 700;
}

.term-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-top: 1px solid #221f1b;
  font-size: 10.5px;
  color: #8b8378;
  background: #121110;
}
.term-foot .copy-count { color: #8b8378; }

/* upcoming */

.upcoming {
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--paper-3);
  padding: 20px;
  align-self: start;
}
.upcoming-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .09em;
  color: var(--muted);
  margin-bottom: 14px;
}
.upcoming-list { display: grid; }
.upcoming-list li {
  font-size: 13.2px;
  line-height: 1.7;
  color: var(--ink-2);
  padding: 10px 0 10px 18px;
  border-top: 1px solid var(--line);
  position: relative;
}
.upcoming-list li:first-child { border-top: 0; padding-top: 0; }
.upcoming-list li::before {
  content: "";
  position: absolute;
  left: 2px; top: 18px;
  width: 5px; height: 5px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.upcoming-list li:first-child::before { top: 8px; }

.section--night .upcoming {
  border-color: #46413a;
  background: rgba(250, 248, 245, .055);
}
.section--night .upcoming-label { color: var(--night-muted); }
.section--night .upcoming-list li {
  color: var(--night-dim);
  border-top-color: var(--night-line);
}
.section--night .upcoming-list li::before { border-color: #4a453d; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.link-arrow:hover { border-bottom-color: var(--accent-ink); }
.link-arrow span { transition: transform .2s; }
.link-arrow:hover span { transform: translateX(3px); }
.section--night .link-arrow { color: var(--accent); }

/* ── patch log ──────────────────────────────────────────────── */

.log { margin-top: 32px; }

.log-head {
  display: grid;
  grid-template-columns: 54px 62px minmax(0, 1fr);
  gap: 16px;
  padding: 0 0 8px;
  border-bottom: 1.5px solid var(--ink);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .09em;
  color: var(--muted);
}

.log-list { border-bottom: 1px solid var(--line-strong); }

.log-row {
  display: grid;
  grid-template-columns: 54px 62px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  padding: 13px 10px 14px;
  border-bottom: 1px solid var(--line);
  transition: background .16s;
}
.log-row:last-child { border-bottom: 0; }
.log-row > div { min-width: 0; }
.log-row:hover { background: var(--paper-2); }

.log-date {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--ink-3);
  padding-top: 2px;
}
.log-title {
  font-size: 14.5px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.log-meta {
  margin-top: 3px;
  font-size: 12.2px;
  line-height: 1.6;
  color: var(--muted);
}

.log-tag {
  justify-self: start;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  color: var(--ink-3);
  background: var(--paper-3);
  white-space: nowrap;
  margin-top: 1px;
}
.tag-new {
  background: var(--accent);
  border-color: var(--accent);
  color: #241005;
}
.tag-ver {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-3);
}
.tag-old {
  background: transparent;
  border-color: var(--ink-3);
  color: var(--ink-3);
}
.tag-fix {
  background: var(--paper-2);
  border-color: var(--line-strong);
  color: var(--ink-3);
}
.tag-soon {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-strong);
  color: var(--muted);
}

.is-future .log-title { color: var(--muted); font-weight: 500; }
.is-future .log-date { color: #9b958c; }

/* ── tiers ──────────────────────────────────────────────────── */

.tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 40px;
  align-items: stretch;
}

.tier {
  display: flex;
  flex-direction: column;
  padding: 22px 20px;
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: 16px;
  transition: border-color .22s, box-shadow .22s, transform .22s;
}
.tier:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 var(--line-strong);
}

.tier-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .09em;
  color: var(--muted);
}

.tier h3 {
  margin-top: 14px;
  font-size: 17.5px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: -0.036em;
}
.tier-price {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: .01em;
}
.tier-price strong {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.025em;
}
.tier > p:not(.tier-price) {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.78;
  color: var(--ink-3);
  letter-spacing: -0.008em;
}

.tier-list {
  display: grid;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}
.tier-list li {
  position: relative;
  padding: 8px 0 8px 16px;
  font-size: 12.3px;
  line-height: 1.6;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.tier-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 15px;
  width: 6px;
  height: 1px;
  background: var(--line-strong);
}

.actions {
  margin-top: auto;
  padding-top: 20px;
  display: grid;
  gap: 10px;
}

/* featured tier — the one the eye should land on */
.tier-featured {
  background: var(--night);
  border: 1.5px solid var(--ink);
  color: var(--night-text);
  box-shadow: 6px 6px 0 var(--accent);
}
.tier-featured:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 8px 8px 0 var(--accent);
}
.tier-featured .tier-top { color: var(--night-muted); }
.tier-featured h3 { color: var(--night-text); }
.tier-featured .tier-price { color: var(--night-muted); }
.tier-featured .tier-price strong { color: var(--accent); }
.tier-featured > p:not(.tier-price) { color: var(--night-dim); }
.tier-featured .tier-list { border-top-color: var(--night-line); }
.tier-featured .tier-list li {
  color: #d9d2c6;
  border-bottom-color: var(--night-line);
}
.tier-featured .tier-list li::before { background: rgba(255, 107, 61, .6); }
.tier-featured .tag-open { color: #241005; }

.tier-featured .field {
  background: #201f1c;
  border-color: #3a3731;
  color: var(--night-text);
}
.tier-featured .field::placeholder { color: #7b746a; }
.tier-featured .field:focus {
  border-color: var(--accent);
  background: #24221f;
  box-shadow: 0 0 0 3px rgba(255, 107, 61, .16);
}
.tier-featured .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #241005;
  box-shadow: 3px 3px 0 var(--night-text);
}
.tier-featured .btn-primary:hover {
  background: #ff7d54;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--night-text);
}
.tier-featured .btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--night-text); }
.tier-featured .form-note { color: var(--night-muted); }
.tier-featured .form-note.is-bad { color: #ffb49b; }
.tier-featured .done-box {
  border-color: #4a4339;
  background: #1d1c19;
}
.tier-featured .done-label { color: var(--accent); }
.tier-featured .done-text { color: var(--night-dim); }
.tier-featured .done-text a { color: var(--accent); border-bottom-color: rgba(255, 107, 61, .45); }

/* forms */

.form {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.field {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper-3);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field::placeholder { color: #a8a29a; }
.field:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 22, 21, .06);
}
.field-area {
  resize: vertical;
  min-height: 78px;
  line-height: 1.65;
}
.field.is-error { border-color: var(--accent); }

.hp {
  position: absolute !important;
  left: -9999px;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* clipboard fallback box, kept off-screen without inline styles (CSP-friendly) */
.copy-proxy {
  position: fixed;
  top: -1000px;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-note {
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
}
.form-note.is-ok { color: #3f6b4e; }
.form-note.is-bad { color: var(--accent-ink); }

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.form-row .form-note { flex: 1; min-width: 120px; }

.inquiry { margin-top: 2px; }
.inquiry summary {
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color .2s;
}
.inquiry summary::-webkit-details-marker { display: none; }
.inquiry summary::before {
  content: "+";
  font-family: var(--mono);
  font-size: 12px;
  color: var(--line-strong);
  transition: color .2s;
}
.inquiry[open] summary::before { content: "–"; }
.inquiry summary:hover { color: var(--ink-2); }

.is-done .form { display: none; }
.is-done #waitlist-note { display: none; }

.done-box {
  margin-top: auto;
  border: 1px dashed #dcc3b6;
  background: #fff9f5;
  border-radius: 10px;
  padding: 16px 14px 14px;
}
.done-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .09em;
  color: var(--accent-ink);
}
.done-label::before {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(-45deg) translateY(-1px);
}
.done-text {
  margin-top: 9px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.done-text a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(176, 61, 24, .35);
}

/* ── footer ─────────────────────────────────────────────────── */

.site-footer {
  border-top: 1.5px solid var(--ink);
  padding: 44px 0 38px;
  background: var(--paper-2);
}
.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.footer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  object-fit: cover;
  background: var(--paper-3);
}
.footer-name span {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: .02em;
}
.footer-line {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-3);
}
.footer-links a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s, color .2s;
}
.footer-links a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.footer-fine {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .02em;
  color: #8b857c;
}
.footer-ver { color: var(--ink-3); }

/* ── entrance (first paint only, nothing hides content) ─────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

.hero-copy > * {
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-copy > :nth-child(1) { animation-delay: .02s; }
.hero-copy > :nth-child(2) { animation-delay: .06s; }
.hero-copy > :nth-child(3) { animation-delay: .12s; }
.hero-copy > :nth-child(4) { animation-delay: .18s; }
.hero-copy > :nth-child(5) { animation-delay: .24s; }

.routine-card {
  animation: fadeIn .9s ease .2s both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── responsive ─────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .hero-grid { gap: 44px; }
  h1 { font-size: clamp(38px, 5.4vw, 62px); }
  .section-grid { grid-template-columns: 136px minmax(0, 1fr); gap: 36px; }
  .panel { gap: 34px; }
}

@media (max-width: 900px) {
  :root { --pad: 26px; }
  .hero { padding: 52px 0 66px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .routine-card { max-width: 540px; transform: none; box-shadow: 5px 5px 0 var(--ink); }
  .routine-card:hover { transform: translateY(-2px); box-shadow: 6px 6px 0 var(--ink); }
  .facts { margin-top: 34px; }
  .section-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 58px;
    padding-bottom: 64px;
  }
  .section-label {
    position: static;
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }
  .section-label::after { display: none; }
  .panel { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .term { position: static; }
  .tiers { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .tier { padding: 22px; }
  .ba-stage { min-height: 0; }
}

@media (max-width: 700px) {
  .nav { display: none; }
  .header-inner { justify-content: space-between; }
  .brand-handle { display: none; }

  .log-head { display: none; }
  .log-row {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas: "date tag tag" "body body body";
    gap: 6px 10px;
    align-items: center;
    padding: 13px 0;
  }
  .log-date { grid-area: date; }
  .log-tag { grid-area: tag; justify-self: end; }
  .log-row > div { grid-area: body; }
  .log-row:hover { background: transparent; }
}

@media (max-width: 480px) {
  :root { --pad: 20px; }
  h1 { font-size: clamp(32px, 9vw, 40px); line-height: 1.12; }
  .lede { font-size: 15px; line-height: 1.75; margin-top: 20px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .byline { margin-bottom: 24px; }
  .byline-avatar { width: 44px; height: 44px; }
  .routine-card { padding: 18px 16px 16px; border-radius: 16px; }
  .card-title { font-size: 20px; }
  .ba-stage { padding: 9px; }
  .ba-btn { padding: 9px 6px; }
  .ba-rows li { font-size: 11.5px; }
  .ba-rows li span { max-width: 20ch; }
  .ba-lines li { font-size: 11.8px; }
  .ba-lines em { display: none; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fact { padding: 12px 8px 13px 0; }
  .fact + .fact { padding-left: 10px; }
  .fact-v { font-size: 14px; }
  .fact-k { font-size: 9px; letter-spacing: .04em; }
  .term-body { padding: 15px 15px 17px; font-size: 12.8px; line-height: 1.95; }
  .term-vars { padding: 9px 11px; }
  .tabs { margin-top: 26px; }
  .tab { padding: 12px 10px 13px; font-size: 12.8px; }
  .io-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px 12px; }
  .io-arrow { padding-left: 12px; }
  .log-title { font-size: 13.8px; }
  .footer-inner { flex-direction: column; gap: 20px; }
  .footer-fine { flex-direction: column; gap: 6px; }
  .section-desc { font-size: 13.8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
