:root {
  --paper: #e8e0d2;
  --paper-2: #f4efe6;
  --ink: #1b1814;
  --muted: #5f574c;
  --line: #cfc3b0;
  --rust: #9c4221;
  --rust-ink: #f7f1e8;
  --focus: #1b1814;
  --danger: #8b2e18;
  --header: 4.5rem;
}

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

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

html,
body {
  min-height: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 1px 1px, rgba(27, 24, 20, 0.07) 1px, transparent 0),
    var(--paper);
  background-size: 20px 20px, auto;
  font-family: "Figtree", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site {
  min-height: 100dvh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: var(--header) 1fr;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: env(safe-area-inset-top) 1.5rem 0;
  min-height: var(--header);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-2) 78%, transparent);
  backdrop-filter: blur(8px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  text-decoration: none;
  font-size: 1.15rem;
}

.rivet {
  width: 0.85rem;
  height: 0.85rem;
  border: 1.5px solid var(--rust);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--paper-2);
  background: var(--ink);
}

.langs {
  display: flex;
  gap: 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.langs a,
.langs span {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.25rem 0.55rem;
  text-decoration: none;
  touch-action: manipulation;
}

.langs a {
  color: var(--muted);
}

.langs a:hover {
  color: var(--ink);
}

.langs [aria-current="true"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--rust);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 24rem);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 2.5rem 0 max(4rem, env(safe-area-inset-bottom));
}

.hero {
  max-width: 36rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(2.2rem, 8vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  overflow-wrap: break-word;
}

h1 span {
  display: block;
}

.lede {
  margin: 1.4rem 0 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 1.5rem 1.4rem 1.35rem;
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--ink) 8%, transparent);
}

.card h2 {
  margin: 0 0 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card h2.machine {
  text-transform: none;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
}

label {
  display: block;
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 0.8rem;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.err {
  margin: 0 0 1rem;
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 600;
}

.ok {
  margin: 0 0 1rem;
  color: #2f4a32;
  font-size: 0.92rem;
  font-weight: 600;
}

button {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.9rem 1rem;
  min-height: 2.75rem;
  border: 0;
  background: var(--rust);
  color: var(--rust-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
}

button:hover {
  filter: brightness(1.06);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.text {
  width: auto;
  margin: 0;
  padding: 0.25rem 0.55rem;
  min-height: 2.5rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

button.text:hover {
  color: var(--ink);
  filter: none;
}

.logout {
  margin: 0;
}

.facts {
  display: grid;
  gap: 0.9rem;
  margin: 0 0 1.15rem;
}

.facts dt {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
  font-weight: 600;
}

.copy {
  margin-top: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
}

.hint {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

body[data-surface="panel"] {
  --paper: #161310;
  --paper-2: #1f1b17;
  --ink: #f0eadf;
  --muted: #b2a898;
  --line: #3d362e;
  --rust: #c45c32;
  --rust-ink: #1b1814;
  --focus: #f0eadf;
  background:
    radial-gradient(circle at 1px 1px, rgba(240, 234, 223, 0.05) 1px, transparent 0),
    var(--paper);
  background-size: 20px 20px, auto;
}

body[data-surface="panel"] input {
  background: #12100e;
  color: var(--ink);
}

body[data-surface="panel"] .card {
  box-shadow: 6px 6px 0 rgb(0 0 0 / 35%);
}

body[data-surface="panel"] .rivet {
  box-shadow: inset 0 0 0 3px var(--paper-2);
  background: var(--ink);
}

@media (max-width: 820px) {
  :root {
    --header: 3.5rem;
  }

  body {
    font-size: 1rem;
  }

  .top {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    width: min(1120px, calc(100% - 2rem));
    gap: 1.5rem;
    padding-top: 1.35rem;
    align-items: start;
  }

  .hero {
    max-width: none;
    order: 2;
  }

  .card {
    order: 1;
    width: 100%;
    box-shadow: 4px 4px 0 color-mix(in srgb, var(--ink) 8%, transparent);
  }

  h1 {
    font-size: clamp(1.85rem, 9vw, 2.4rem);
  }

  .lede {
    margin-top: 0.85rem;
    font-size: 1rem;
    max-width: none;
  }
}
