/* Shared look for every numeri.xyz page.
   Radius rule: surfaces 28px, inputs 14px, everything you can press is a full pill. */

@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #eaf2fb;
  --sky: #cfe3f7;
  --surface: #ffffff;
  --surface-2: #f3f7fc;
  --ink: #14213d;
  --muted: #55607a;
  --line: #d3dceb;
  --accent: #f2b632;
  --accent-ink: #14213d;
  --danger: #b3261e;
  --star: transparent;
  --shadow: 0 18px 50px rgba(12, 19, 48, .08);
  --sans: "Outfit", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --shell: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0c1330;
    --sky: #121c44;
    --surface: #16204a;
    --surface-2: #1b2756;
    --ink: #eef1fb;
    --muted: #a5aecb;
    --line: #26325f;
    --accent: #ffd166;
    --danger: #ffb4ab;
    --star: rgba(255, 255, 255, .7);
    --shadow: 0 18px 50px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0c1330;
  --sky: #121c44;
  --surface: #16204a;
  --surface-2: #1b2756;
  --ink: #eef1fb;
  --muted: #a5aecb;
  --line: #26325f;
  --accent: #ffd166;
  --danger: #ffb4ab;
  --star: rgba(255, 255, 255, .7);
  --shadow: 0 18px 50px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
}
body.tool-page { --shell: 880px; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(var(--shell), calc(100% - 32px)); margin-inline: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Sky band: night with stars in dark mode, morning sky in light mode. */
.sky {
  position: relative;
  overflow: hidden;
  background: var(--sky);
  border-radius: 0 0 40px 40px;
}
.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 64%, var(--star) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 44% 18%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 57% 42%, var(--star) 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 71% 12%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 30%, var(--star) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 93% 70%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 80%, var(--star) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 36% 88%, var(--star) 50%, transparent 51%);
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}
.wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.03em;
  text-decoration: none;
}
.wordmark span { color: var(--muted); font-weight: 500; }
.head-right { display: flex; align-items: center; gap: 14px; }
.by {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.by b { color: var(--ink); font-weight: 500; }
.by img { width: 18px; height: 18px; }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}

/* Shelf hero (numeri.xyz) */
.shelf-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: 32px;
  padding: 40px 0 72px;
}
.shelf-hero h1 {
  margin: 0;
  font-size: clamp(46px, 6.6vw, 80px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1;
}
.shelf-hero h1 em {
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: .12em;
  text-underline-offset: .1em;
}
:root[data-theme="dark"] .shelf-hero h1 em { color: var(--accent); text-decoration: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shelf-hero h1 em { color: var(--accent); text-decoration: none; }
}
.shelf-hero p {
  max-width: 30rem;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 19px;
}

/* Sheep illustration */
.dream {
  position: relative;
  justify-self: center;
  width: min(100%, 440px);
  aspect-ratio: 400 / 367;
}
.dream img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(8, 14, 40, .25));
}

/* Shelf tool cards: three equal columns; examples and actions align along the bottom. */
.tools {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: -32px;
}
.tools .card { display: flex; flex-direction: column; padding: 28px; }
.tools .meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 26px; }
.tools h2 {
  margin: 10px 0 0;
  font-size: clamp(26px, 2.6vw, 32px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.tools p { margin: 8px 0 24px; color: var(--muted); }
.tools .code {
  margin-top: auto;
  padding: 14px 16px;
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.tools .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 22px; }
.tools .text-link { font-size: 15px; font-weight: 500; text-underline-offset: 4px; text-decoration-color: var(--line); }
.tools .text-link:hover { text-decoration-color: currentColor; }
.soon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 36px;
  color: var(--muted);
  font-size: 15px;
}
.pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border: 1px dashed var(--line);
  border-radius: 999px;
}
.pill code { font-family: var(--mono); font-size: 13px; color: var(--ink); }

/* Tool page hero */
.tool-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 28px 0 76px;
}
.tool-hero.with-art { grid-template-columns: minmax(0, 1fr) minmax(0, 260px); }
.tool-hero h1 {
  margin: 6px 0 0;
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.02;
}
.tool-hero .lede {
  max-width: 34rem;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 19px;
}
.tool-hero .dream { width: 100%; }

/* Cards */
.stack {
  position: relative;
  display: grid;
  gap: 20px;
  margin-top: -40px;
}
.card {
  min-width: 0;
  padding: 30px 32px 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card > h2, .section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.card > h2 + p, .section-title + p { margin: 6px 0 0; color: var(--muted); }
.host { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.quiet:hover { border-color: var(--muted); }
.btn.small { min-height: 32px; padding: 0 14px; font-size: 13px; }

/* Code examples */
.code {
  margin: 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  overflow-x: auto;
  white-space: pre;
}
.code .dim { color: var(--muted); }
.code .hit { color: var(--ink); font-weight: 500; }
.code a { text-decoration: none; }
.code a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* Forms and generated URLs */
label, .field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 500;
}
.form-row { display: flex; gap: 10px; min-width: 0; }
input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
}
input::placeholder { color: var(--muted); opacity: 1; }
input[aria-invalid="true"] { border-color: var(--danger); }
.error { margin: 8px 0 0; color: var(--danger); font-size: 15px; }
.error:empty { display: none; }
.result { margin-top: 20px; }
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.result-label { font-size: 15px; font-weight: 500; }
.result-url {
  margin: 0;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.result-url:empty::before { content: "\00a0"; }

/* "Use it directly" mappings */
.maps { display: grid; gap: 10px; margin-top: 18px; }
.map {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-2);
}
.map .url { margin: 0; font-family: var(--mono); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.map .to { font-weight: 500; }
.map .arrow { margin: 2px 0; color: var(--muted); font-family: var(--mono); font-size: 14px; line-height: 1.2; }
.map .about { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.note { margin: 18px 0 0; color: var(--muted); font-size: 15px; }
.note + .note { margin-top: 6px; }

footer.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 88px;
  padding: 24px 0 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
footer.site-footer a { text-underline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .7s cubic-bezier(.16, 1, .3, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}

@media (max-width: 900px) {
  .tools { grid-template-columns: minmax(0, 1fr); margin-top: -28px; }
}
@media (max-width: 820px) {
  .by span { display: none; }
  .tools .card { padding: 24px; }
  .shelf-hero { grid-template-columns: minmax(0, 1fr); padding: 20px 0 60px; gap: 18px; }
  .shelf-hero .dream { width: min(80%, 320px); grid-row: 1; }
  .sky { border-radius: 0 0 28px 28px; }
  .card { padding: 24px; }
}
@media (max-width: 640px) {
  .tool-hero.with-art { grid-template-columns: minmax(0, 1fr) 112px; gap: 12px; }
  .tool-hero { padding-bottom: 64px; }
  .tool-hero .lede { font-size: 17px; }
}
@media (max-width: 520px) {
  .form-row { flex-direction: column; }
  .form-row .btn { align-self: flex-start; }
}
