:root {
  --ink: #090909;
  --ink-2: #111111;
  --paper: #f0eadc;
  --paper-muted: #b9b4a8;
  --red: #f13b32;
  --line: #383735;
  --page: min(1180px, calc(100vw - 40px));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--paper);
  background: var(--ink);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  z-index: 10;
  mix-blend-mode: soft-light;
}

a {
  color: inherit;
}

button,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 14px;
  z-index: 100;
}

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

.site-header {
  width: var(--page);
  min-height: 78px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.06em;
  font-size: 1.25rem;
}

.brand-mark {
  color: var(--red);
  font-size: 1.6rem;
  transform: translateY(2px);
}

nav {
  display: flex;
  gap: 28px;
}

nav a,
.header-x,
.footer-links a {
  color: var(--paper-muted);
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  transition: color 160ms ease;
}

nav a:hover,
nav a:focus-visible,
.header-x:hover,
.header-x:focus-visible,
.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--paper);
}

.header-x {
  justify-self: end;
}

.hero {
  width: var(--page);
  margin: 0 auto;
  min-height: 760px;
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  gap: 48px;
  align-items: center;
  padding: 64px 0 84px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--red);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--red);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 28px;
  font-size: clamp(4.4rem, 9vw, 8rem);
  line-height: 0.8;
  letter-spacing: -0.09em;
  font-weight: 950;
}

h1 span {
  color: var(--red);
  position: relative;
}

h1 span::after {
  content: "";
  position: absolute;
  left: 3%;
  right: -3%;
  bottom: -11px;
  border-bottom: 5px wavy var(--red);
}

h2 {
  margin-bottom: 24px;
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
  font-weight: 950;
}

.hero-lede {
  max-width: 560px;
  color: var(--paper-muted);
  font-size: clamp(1.08rem, 1.7vw, 1.35rem);
}

.hero-lede strong {
  color: var(--paper);
}

.hero-actions,
.certificate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--paper);
  border-radius: 0;
  padding: 12px 18px;
  color: var(--paper);
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled),
.button:focus-visible:not(:disabled) {
  transform: translate(-2px, -2px);
}

.button-primary {
  background: var(--paper);
  color: var(--ink);
}

.button-red {
  border-color: var(--red);
  background: var(--red);
  color: var(--ink);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.launch-state {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.launch-state span {
  color: var(--paper-muted);
}

.launch-state strong {
  color: var(--red);
  text-align: right;
}

.hero-art {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--ink-2);
  transform: rotate(0.8deg);
  box-shadow: 14px 14px 0 var(--red);
}

.hero-art img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hero-art figcaption {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  color: var(--paper-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.generator-section {
  width: var(--page);
  margin: 0 auto;
  padding: 112px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 850px;
  margin-bottom: 48px;
}

.section-heading > p:last-child {
  color: var(--paper-muted);
  font-size: 1.1rem;
}

.generator-grid {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 24px;
  align-items: stretch;
}

.terminal,
.certificate {
  border: 1px solid var(--line);
  background: var(--ink-2);
}

.terminal {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.terminal label,
.certificate-label,
.certificate-topline,
.certificate-footer span,
.status-panel span,
.archive-grid span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.input-wrap {
  position: relative;
  margin: 12px 0 18px;
  flex: 1;
}

textarea {
  width: 100%;
  min-height: 210px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 18px 18px 42px;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.08rem;
  line-height: 1.55;
  outline: none;
}

textarea:focus {
  border-color: var(--paper);
  box-shadow: 5px 5px 0 var(--red);
}

textarea::placeholder {
  color: #66635d;
}

#character-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: var(--paper-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
}

.terminal-button {
  width: 100%;
}

.privacy-note {
  margin: 16px 0 0;
  color: var(--paper-muted);
  font-size: 0.78rem;
}

.certificate {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  box-shadow: 10px 10px 0 #201f1e;
}

.certificate-topline {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--red);
}

.certificate-body {
  flex: 1;
  padding: 30px 30px 20px;
}

.certificate-label {
  margin-bottom: 8px;
  color: var(--paper-muted);
}

.certificate-body p {
  margin-bottom: 30px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.2rem, 2.4vw, 2.1rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.broken-output {
  color: var(--paper);
  text-decoration: underline wavy var(--red) 2px;
  text-underline-offset: 8px;
}

.correction-line {
  width: 64px;
  margin: 2px 0 25px;
  border-bottom: 6px solid var(--red);
  transform: rotate(-4deg);
}

.certificate-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 88px;
  padding: 12px 20px 12px 30px;
  border-top: 1px solid var(--line);
}

.certificate-footer > div {
  display: grid;
  gap: 3px;
}

.certificate-footer span {
  color: var(--paper-muted);
}

.certificate-footer strong {
  color: var(--red);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}

.certificate-footer img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.certificate-actions {
  padding: 18px 20px;
  border-top: 1px solid var(--line);
}

.certificate.is-empty .certificate-body,
.certificate.is-empty .certificate-footer {
  opacity: 0.52;
}

.manifest {
  width: var(--page);
  margin: 0 auto;
  padding: 112px 0;
  display: grid;
  grid-template-columns: 0.22fr 1fr 0.55fr;
  gap: 48px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.manifest-number {
  align-self: start;
  color: var(--line);
  font-size: clamp(5rem, 11vw, 10rem);
  font-weight: 950;
  line-height: 0.75;
  letter-spacing: -0.08em;
}

.manifest-copy > p:not(.eyebrow):not(.manifest-callout) {
  max-width: 690px;
  color: var(--paper-muted);
  font-size: 1.08rem;
}

.manifest-callout {
  margin: 32px 0 0;
  color: var(--red);
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 950;
  letter-spacing: -0.06em;
}

.manifest-art {
  position: relative;
  border: 1px solid var(--line);
}

.manifest-art img {
  aspect-ratio: 1;
  object-fit: cover;
}

.red-caret {
  position: absolute;
  right: -24px;
  top: -62px;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 8rem;
  font-weight: 900;
  transform: rotate(11deg);
}

.archive {
  width: var(--page);
  margin: 0 auto;
  padding: 112px 0;
  border-bottom: 1px solid var(--line);
}

.archive-heading {
  margin-bottom: 38px;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.archive-grid article {
  min-height: 245px;
  padding: 26px;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.archive-grid article:nth-child(2) {
  transform: translateY(10px) rotate(-0.6deg);
  border: 1px solid var(--red);
  position: relative;
  z-index: 2;
}

.archive-grid span {
  color: var(--red);
}

.archive-grid p {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.04rem;
}

.status-section {
  width: var(--page);
  margin: 0 auto;
  padding: 112px 0;
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 64px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.status-copy > p:last-child {
  max-width: 650px;
  color: var(--paper-muted);
  font-size: 1.08rem;
}

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

.status-panel > div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}

.status-panel span {
  color: var(--paper-muted);
}

.status-panel strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  text-align: right;
}

.status-panel .button {
  width: calc(100% - 24px);
  margin: 12px;
}

footer {
  width: var(--page);
  min-height: 190px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
}

.footer-brand {
  font-size: 2.2rem;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.footer-brand span {
  color: var(--red);
}

footer > p {
  margin: 0;
  color: var(--paper-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-art {
    animation: imperfectFloat 6s steps(2, end) infinite;
  }

  .brand-mark,
  .red-caret {
    animation: correctionBlink 2.8s steps(2, end) infinite;
  }
}

@keyframes imperfectFloat {
  0%, 100% { transform: translate(0, 0) rotate(0.8deg); }
  50% { transform: translate(-3px, 3px) rotate(-0.4deg); }
}

@keyframes correctionBlink {
  0%, 72%, 100% { opacity: 1; }
  73%, 88% { opacity: 0.2; }
}

@media (max-width: 900px) {
  :root {
    --page: min(100% - 28px, 720px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  nav {
    display: none;
  }

  .hero,
  .generator-grid,
  .manifest,
  .status-section {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 52px;
    gap: 48px;
  }

  .hero-art {
    order: -1;
    box-shadow: 8px 8px 0 var(--red);
  }

  h1 {
    font-size: clamp(4rem, 20vw, 7rem);
  }

  .manifest-number {
    display: none;
  }

  .manifest-art {
    max-width: 420px;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }

  .archive-grid article:nth-child(2) {
    transform: none;
  }

  footer {
    grid-template-columns: 1fr;
    padding: 52px 0;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .site-header {
    min-height: 66px;
  }

  .header-x {
    font-size: 0.7rem;
  }

  .hero {
    min-height: auto;
    padding-bottom: 68px;
  }

  .hero-actions,
  .certificate-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .launch-state {
    flex-direction: column;
    gap: 6px;
  }

  .launch-state strong {
    text-align: left;
  }

  .generator-section,
  .manifest,
  .archive,
  .status-section {
    padding: 80px 0;
  }

  .terminal,
  .certificate-body {
    padding: 20px;
  }

  .certificate-topline {
    padding: 15px 16px;
  }

  .certificate-footer {
    padding-left: 20px;
  }

  .status-panel > div {
    flex-direction: column;
    gap: 4px;
  }

  .status-panel strong {
    text-align: left;
  }
}
