/* Fadeout — quiet editorial page: one wide column, generous air, ink on paper.
   Single light theme by choice (the product's look); every color is set explicitly. */
:root {
  --paper: #fafaf8;
  --wash: #f1f1ee;
  --ink: #1d1d1f;
  --ink-2: #4e4f54;
  --ink-3: #8a8b90;
  --rule: #e3e3df;
  --alert: #a3341f;

  --serif: "Noto Serif Thai", "Noto Serif", Georgia, serif;
  --sans: "IBM Plex Sans Thai", "Leelawadee UI", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 3.2vw, 2.25rem);
  --step-4: clamp(2.25rem, 5.6vw, 3.75rem);

  --measure: 36rem;
  --page: 68rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: var(--step-0);
  line-height: 1.75;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 3px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 300; text-wrap: balance; margin: 0; }
p { margin: 0; }
b, strong { font-weight: 500; }

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-block: 28px;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: var(--step-1); letter-spacing: 0.02em; text-decoration: none;
}
.wordmark img { width: 26px; height: 26px; border-radius: 6px; }
.nav { display: flex; gap: 24px; flex-wrap: wrap; font-size: var(--step--1); }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ink); text-decoration: underline; }

.lang {
  font: inherit; font-size: var(--step--1); color: var(--ink);
  background: transparent; border: 1px solid var(--rule); border-radius: 999px;
  padding: 4px 14px; cursor: pointer;
}
.lang:hover { border-color: var(--ink); }
.top-right { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

/* illustrations: ink line drawings on paper */
svg.ill { display: block; width: 100%; height: auto; overflow: visible; }
svg.ill .s { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
svg.ill .f { fill: var(--ink); }
svg.ill .p { fill: #fff; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
svg.ill .w { fill: var(--wash); }
svg.ill text { font-family: var(--sans); }

.label {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-weight: 400; font-size: var(--step-0); letter-spacing: 0.02em;
  padding: 16px 30px; border: 1px solid var(--ink); border-radius: 2px;
  text-decoration: none; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--paper); color: var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

.note { color: var(--ink-3); font-size: var(--step--1); }
.err { color: var(--alert); }

footer.foot {
  border-top: 1px solid var(--rule);
  margin-top: 96px; padding-block: 40px 56px;
  display: flex; gap: 24px 48px; flex-wrap: wrap; justify-content: space-between;
  color: var(--ink-3); font-size: var(--step--1);
}
footer.foot a { color: var(--ink-2); }

/* small centered pages (success, request link) */
.solo { max-width: 34rem; margin: 0 auto; padding-block: 12vh 0; text-align: center; display: grid; gap: 20px; justify-items: center; }
.solo h1 { font-size: var(--step-3); }
.solo .mark { width: 84px; }
.status { min-height: 140px; display: grid; gap: 14px; justify-items: center; align-content: center; }
.status .file { font-family: var(--mono); font-size: var(--step--1); color: var(--ink-2); }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--rule); border-top-color: var(--ink);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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