:root {
  --bg: #1b00c8;
  --fg: #deddd7;
  --signal: #deddd7;
  --muted: #aaa4dc;
  --faint: #aaa4dc;
  --danger: #ffc1c1;
  --success: #b7f0c5;
  --control-line: var(--muted);
  --page-pad: clamp(18px, 2.8vw, 44px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --line: color-mix(in srgb, var(--fg) 38%, transparent);
  --soft-line: color-mix(in srgb, var(--fg) 16%, transparent);
  --font-mono: "SF Mono", "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo, Monaco, Consolas, monospace;
  color-scheme: dark;
}

html[data-theme="2"] {
  --bg: #171719;
  --fg: #e3e1db;
  --signal: #e3e1db;
  --muted: #aaa9aa;
  --faint: #aaa9aa;
  --danger: #ffb6b6;
  --success: #a9e5b9;
  color-scheme: dark;
}

html[data-theme="3"] {
  --bg: #1b00c8;
  --fg: #deddd7;
  --signal: #deddd7;
  --muted: #aaa4dc;
  --faint: #aaa4dc;
  --danger: #ffc1c1;
  --success: #b7f0c5;
  color-scheme: dark;
}

html[data-theme="4"] {
  --bg: #090b09;
  --fg: #57e879;
  --signal: #57e879;
  --muted: #40ad61;
  --faint: #40ad61;
  --danger: #ffaaaa;
  --success: #57e879;
  color-scheme: dark;
}

html[data-theme="5"] {
  --bg: #ffe916;
  --fg: #1b00c8;
  --signal: #1b00c8;
  --muted: #6a547f;
  --faint: #6a547f;
  --danger: #83002b;
  --success: #075221;
  color-scheme: light;
}

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

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 280px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

a,
button,
input {
  font: inherit;
}

a {
  color: inherit;
}

button {
  border: 0;
  color: inherit;
}

a,
button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: calc(var(--safe-top) + 10px);
  left: calc(var(--safe-left) + 10px);
  padding: 8px 12px;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.site-frame {
  width: 100%;
  min-height: calc(100vh - var(--safe-top) - var(--safe-bottom));
  min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom));
  border-right: 1px solid var(--soft-line);
  border-left: 1px solid var(--soft-line);
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  padding: 0 var(--page-pad);
  gap: 28px;
}

.brand,
.topbar-meta,
.eyebrow,
.section-index,
.label,
.meta,
.tag,
.statusbar,
.footer,
.system-rail {
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

.brand {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: 16px;
  font-weight: 600;
  text-decoration: none;
}

.brand::after {
  width: 1px;
  height: 22px;
  background: var(--line);
  content: "";
}

.topbar-end {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(16px, 2.4vw, 38px);
}

.topbar-meta {
  color: var(--muted);
  white-space: nowrap;
}

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1vw, 16px);
}

.topnav a,
.topnav button,
.theme-toggle {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.topnav a:hover,
.topnav a[aria-current="page"],
.topnav button:hover,
.theme-toggle:hover,
.topnav a:focus-visible,
.topnav button:focus-visible,
.theme-toggle:focus-visible {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.theme-toggle {
  gap: 8px;
  white-space: nowrap;
}

html:not(.js) .theme-toggle {
  display: none;
}

.theme-dot {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  background: currentColor;
}

.index-hero {
  display: grid;
  min-height: calc(100svh - 124px - var(--safe-top) - var(--safe-bottom));
  grid-template-columns: 96px minmax(0, 1.45fr) minmax(340px, 0.8fr);
}

.system-rail {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(48px, 7vh, 82px) 22px 28px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.rail-mark {
  display: grid;
  gap: 10px;
}

.rail-mark::before {
  width: 10px;
  height: 10px;
  background: var(--fg);
  content: "";
}

.rail-index {
  display: grid;
  gap: 14px;
}

.rail-index span:last-child {
  margin-top: 24px;
}

.hero-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(54px, 9vh, 112px) clamp(30px, 5vw, 80px);
}

.eyebrow {
  margin-bottom: clamp(34px, 5vh, 62px);
  color: var(--muted);
  font-size: 13px;
}

.display-name {
  max-width: 100%;
  font-size: clamp(3.5rem, 8.2vw, 9.4rem);
  font-weight: 600;
  letter-spacing: -0.09em;
  line-height: 0.82;
  text-transform: uppercase;
  text-wrap: balance;
}

.display-name span {
  display: block;
}

.hero-role {
  margin-top: clamp(24px, 4vh, 42px);
  font-size: clamp(1rem, 1.7vw, 1.6rem);
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.hero-aside {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 8vh, 96px) clamp(28px, 4vw, 60px);
  border-left: 1px solid var(--line);
}

.manifesto {
  display: grid;
  gap: 14px;
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.65;
}

.manifesto li {
  position: relative;
  padding-left: 18px;
}

.manifesto li::before {
  position: absolute;
  left: 0;
  color: var(--muted);
  content: "·";
}

.primary-link {
  display: inline-flex;
  width: fit-content;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin-top: clamp(36px, 7vh, 72px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  color: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 160ms ease, color 160ms ease;
}

.primary-link::before {
  content: "[";
}

.primary-link::after {
  content: "→ ]";
  transition: transform 160ms ease;
}

.primary-link:hover,
.primary-link:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.primary-link:hover::after,
.primary-link:focus-visible::after {
  transform: translateX(4px);
}

.statusbar {
  display: grid;
  min-height: 56px;
  grid-template-columns: 1fr auto;
  border-top: 1px solid var(--line);
  align-items: center;
  padding: 0 var(--page-pad);
  gap: 24px;
  font-size: 12px;
}

.status-copy {
  color: var(--muted);
}

.status-copy::before {
  margin-right: 10px;
  color: var(--fg);
  content: ">_";
}

.status-links {
  display: flex;
  align-items: center;
}

.status-links a,
.status-links button {
  min-height: 36px;
  padding: 8px 18px;
  border-left: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-decoration: none;
  text-transform: uppercase;
}

.status-links a:hover,
.status-links button:hover,
.status-links a:focus-visible,
.status-links button:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.content-section {
  display: grid;
  grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.section-heading {
  padding: clamp(32px, 5vw, 72px) var(--page-pad);
  border-right: 1px solid var(--line);
}

.section-index {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.section-heading h2 {
  max-width: 8ch;
  font-size: clamp(1.5rem, 3vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.95;
  text-transform: uppercase;
}

.section-body {
  min-width: 0;
  padding: clamp(32px, 5vw, 72px) var(--page-pad);
}

.directory-list {
  border-top: 1px solid var(--line);
}

.directory-row {
  display: grid;
  min-height: 82px;
  grid-template-columns: 54px minmax(150px, 0.75fr) minmax(220px, 1.25fr) auto 24px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.directory-row:hover,
.directory-row:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.directory-number,
.directory-meta {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.directory-row:hover .directory-number,
.directory-row:hover .directory-meta,
.directory-row:focus-visible .directory-number,
.directory-row:focus-visible .directory-meta {
  color: var(--bg);
}

.directory-title {
  min-width: 0;
  font-size: clamp(17px, 1.8vw, 25px);
  font-weight: 500;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.directory-description {
  min-width: 0;
  max-width: 64ch;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.directory-row:hover .directory-description,
.directory-row:focus-visible .directory-description {
  color: var(--bg);
}

.directory-arrow {
  font-size: 20px;
  transition: transform 160ms ease;
}

.directory-row:hover .directory-arrow,
.directory-row:focus-visible .directory-arrow {
  transform: translateX(5px);
}

.note-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.note-row {
  display: grid;
  min-height: 72px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.note-row:hover,
.note-row:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.note-title {
  font-size: clamp(16px, 1.6vw, 22px);
}

.note-date,
.note-type {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.note-row:hover .note-date,
.note-row:hover .note-type,
.note-row:focus-visible .note-date,
.note-row:focus-visible .note-type {
  color: var(--bg);
}

.contact-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
}

.contact-copy {
  max-width: 30ch;
  font-size: clamp(1.65rem, 4vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.contact-actions {
  display: grid;
  min-width: min(100%, 300px);
  border-top: 1px solid var(--line);
}

.text-action {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
}

.text-action:hover,
.text-action:focus-visible {
  padding-right: 10px;
  padding-left: 10px;
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.footer {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-pad);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  gap: 24px;
}

/* Interior pages */
.page-hero {
  display: grid;
  min-height: clamp(360px, 58svh, 620px);
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.page-hero-rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 5vw, 72px) var(--page-pad);
  border-right: 1px solid var(--line);
}

.breadcrumb {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
}

.breadcrumb:hover,
.breadcrumb:focus-visible {
  color: var(--fg);
}

.page-count {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.page-hero-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(44px, 8vw, 112px) var(--page-pad);
}

.page-title {
  font-size: clamp(3.8rem, 11.5vw, 11rem);
  font-weight: 600;
  letter-spacing: -0.09em;
  line-height: 0.78;
  text-transform: uppercase;
}

.page-lede {
  max-width: 58ch;
  margin-top: clamp(32px, 5vw, 62px);
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 19px);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.project-card {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 3vw, 42px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.project-card h3 {
  margin-top: 40px;
  font-size: clamp(1.8rem, 4vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.project-card p {
  max-width: 48ch;
  margin-top: 26px;
  color: var(--muted);
  font-size: 14px;
}

.project-card:hover p,
.project-card:focus-visible p {
  color: var(--bg);
}

.project-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 54px;
  font-size: 12px;
  text-transform: uppercase;
}

.repo-status {
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
}

.repo-status button {
  padding: 2px 5px;
  background: transparent;
  color: inherit;
  text-transform: uppercase;
}

/* Blog */
.blog-index .page-title {
  max-width: 7ch;
}

.post-list {
  border-top: 1px solid var(--line);
}

.post-row {
  display: grid;
  min-height: 112px;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.post-row:hover,
.post-row:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.post-row-title {
  font-size: clamp(1.25rem, 2.7vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.post-row-meta {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.post-row:hover .post-row-meta,
.post-row:focus-visible .post-row-meta {
  color: var(--bg);
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
}

.article-rail {
  padding: clamp(32px, 5vw, 72px) var(--page-pad);
  border-right: 1px solid var(--line);
}

.article-main {
  min-width: 0;
  padding: clamp(44px, 8vw, 118px) var(--page-pad) clamp(70px, 10vw, 150px);
}

.article-title {
  max-width: 13ch;
  font-size: clamp(2.7rem, 7vw, 7.5rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.9;
  text-wrap: balance;
}

.article-meta {
  display: flex;
  max-width: 760px;
  align-items: center;
  justify-content: space-between;
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.prose {
  max-width: 760px;
  margin-top: clamp(64px, 9vw, 118px);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.85;
  letter-spacing: -0.02em;
}

.prose p + p {
  margin-top: 1.65em;
}

.prose code {
  padding: 0.12em 0.35em;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.prose a {
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* Contact */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  border-top: 1px solid var(--line);
}

.contact-panel,
.form-panel {
  min-width: 0;
  padding: clamp(34px, 5vw, 72px) var(--page-pad);
}

.contact-panel {
  border-right: 1px solid var(--line);
}

.panel-heading {
  margin-bottom: clamp(32px, 5vw, 58px);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.contact-list {
  border-top: 1px solid var(--line);
}

.contact-row {
  display: grid;
  min-height: 62px;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.contact-row:hover,
.contact-row:focus-visible {
  padding-right: 8px;
  padding-left: 8px;
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.contact-value {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-row:hover .contact-value,
.contact-row:focus-visible .contact-value {
  color: var(--bg);
}

.vcard-action {
  width: 100%;
  margin-top: 36px;
}

.contact-form {
  display: grid;
  gap: 26px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--control-line);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font-size: 17px;
}

.field input::placeholder {
  color: var(--faint);
}

.field input:focus {
  border-bottom-color: var(--fg);
  box-shadow: 0 1px 0 var(--fg);
}

.field input.invalid {
  border-bottom-color: var(--danger);
  box-shadow: 0 1px 0 var(--danger);
}

.form-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-top: 12px;
}

.privacy-note {
  max-width: 46ch;
  color: var(--muted);
  font-size: 11px;
}

.submit-button {
  min-width: 142px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  text-transform: uppercase;
}

.submit-button:hover,
.submit-button:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.submit-button:disabled {
  opacity: 0.35;
}

.form-message {
  min-height: 24px;
  font-size: 13px;
}

.form-message.error {
  color: var(--danger);
}

.form-message.ok {
  color: var(--success);
}

.form-message a {
  color: inherit;
}

.success-actions {
  display: none;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.success-actions.visible {
  display: flex;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
}

.consent-row input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--fg);
}

.consent-row input.invalid {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.inline-button {
  padding: 2px 4px;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.shake {
  animation: shake 260ms ease-out;
}

/* Error */
.error-hero {
  display: flex;
  min-height: calc(100svh - 68px - var(--safe-top) - var(--safe-bottom));
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(42px, 7vw, 96px) var(--page-pad);
}

.error-hero-full {
  min-height: calc(100svh - var(--safe-top) - var(--safe-bottom));
}

.error-code {
  font-size: clamp(8rem, 30vw, 28rem);
  font-weight: 600;
  letter-spacing: -0.13em;
  line-height: 0.7;
}

.error-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.error-message {
  max-width: 36ch;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 24px);
}

/* Progressive reveal */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal-fallback 420ms ease 700ms forwards;
  transition: opacity 420ms ease, transform 420ms ease;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: none;
}

@keyframes reveal-fallback {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.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;
}

@media (max-width: 1100px) {
  .topbar-meta {
    display: none;
  }

  .index-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  }

  .system-rail {
    display: none;
  }

  .directory-row {
    grid-template-columns: 46px minmax(140px, 0.8fr) minmax(180px, 1.2fr) auto 24px;
  }

  .contact-strip {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 14px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 60px;
    gap: 12px;
  }

  .topbar-nav {
    min-height: 112px;
    padding-bottom: 52px;
  }

  .error-hero {
    min-height: calc(100svh - 60px - var(--safe-top) - var(--safe-bottom));
  }

  .error-hero-full {
    min-height: calc(100svh - var(--safe-top) - var(--safe-bottom));
  }

  .topnav {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    padding: 0 var(--page-pad);
    overflow-x: auto;
    border-top: 1px solid var(--line);
    scrollbar-width: none;
  }

  .topnav::-webkit-scrollbar {
    display: none;
  }

  .topnav a {
    min-height: 42px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .brand::after {
    display: none;
  }

  .index-hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: clamp(430px, 66svh, 620px);
    padding: 54px var(--page-pad);
  }

  .display-name {
    font-size: clamp(3.35rem, 17vw, 7.6rem);
  }

  .hero-aside {
    padding: 44px var(--page-pad) 58px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .statusbar {
    grid-template-columns: 1fr;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .status-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
  }

  .status-links a,
  .status-links button {
    border-left: 0;
    border-right: 1px solid var(--line);
    text-align: center;
  }

  .content-section,
  .page-hero,
  .article-shell {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .page-hero-rail,
  .article-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .section-heading h2 {
    max-width: none;
  }

  .page-hero {
    min-height: auto;
  }

  .page-hero-rail {
    min-height: 112px;
  }

  .page-hero-main {
    min-height: 360px;
  }

  .page-title {
    font-size: clamp(3.6rem, 14vw, 7rem);
  }

  .project-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-card {
    min-height: 260px;
  }

  .article-main {
    padding-top: 64px;
  }
}

@media (max-width: 620px) {
  :root {
    --page-pad: 18px;
  }

  body {
    line-height: 1.5;
  }

  .topbar-end {
    gap: 4px;
  }

  .theme-toggle {
    min-width: 44px;
    min-height: 44px;
    padding: 6px 8px;
  }

  .js .theme-name,
  .js .theme-label {
    display: none;
  }

  .eyebrow {
    margin-bottom: 32px;
  }

  .hero-copy {
    min-height: 58svh;
  }

  .hero-role {
    font-size: 14px;
  }

  .manifesto {
    font-size: 15px;
  }

  .primary-link {
    width: 100%;
  }

  .directory-row {
    min-height: 104px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px 0;
  }

  .directory-description {
    grid-column: 2 / 4;
    grid-row: 2;
    padding-right: 16px;
  }

  .directory-meta {
    display: none;
  }

  .directory-arrow {
    grid-column: 3;
    grid-row: 1;
  }

  .note-row,
  .post-row {
    min-height: 92px;
    gap: 12px;
    padding: 14px 0;
  }

  .note-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .post-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .note-title {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .note-date,
  .post-row-meta {
    grid-column: 2;
  }

  .note-type {
    display: none;
  }

  .contact-copy {
    font-size: clamp(2.2rem, 12vw, 4rem);
  }

  .contact-actions {
    min-width: 0;
  }

  .footer {
    min-height: 92px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
  }

  .page-hero-main {
    min-height: 320px;
  }

  .page-title {
    max-width: 100%;
    font-size: clamp(3rem, 16vw, 6rem);
  }

  .project-card {
    min-height: 230px;
  }

  .contact-row {
    grid-template-columns: 78px minmax(0, 1fr) auto;
  }

  .form-footer {
    flex-direction: column;
  }

  .submit-button {
    width: 100%;
  }

  .article-title {
    font-size: clamp(2.6rem, 14vw, 5rem);
  }

  .article-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .error-code {
    font-size: clamp(7rem, 42vw, 12rem);
  }

  .error-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

@media print {
  :root {
    --bg: #ffffff;
    --fg: #000000;
  }

  .topbar,
  .statusbar,
  .theme-toggle,
  .skip-link {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .site-frame {
    border: 0;
  }
}
