/* 555.ad — base stylesheet for the public pages.
   The redirect interstitial has its own minimal sheet (/_/i.css) so it stays
   fast and never depends on this file. */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --border: #e4e4e1;
  --text: #1a1a19;
  --muted: #6b6b66;
  --accent: #d4451f;
  --accent-text: #ffffff;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171716;
    --surface: #211f1e;
    --border: #35322f;
    --text: #f2f0ee;
    --muted: #a3a09b;
    --accent: #ff6a3d;
    --accent-text: #1a1a19;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.site-head {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.35rem;
}

.brand-mark {
  color: var(--accent);
  font-family: var(--mono);
}

.brand-tld {
  color: var(--text);
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 0.75rem;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.08);
}

/* ---- forms ------------------------------------------------------------- */

.field {
  display: block;
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

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

.shorten {
  margin-bottom: 2rem;
}

.custom {
  margin-bottom: 1rem;
}

.custom summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.custom summary:hover {
  color: var(--text);
}

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

.alert {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--accent);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.95rem;
}

/* Turnstile renders an iframe of its own size; just give it room. */
.cf-turnstile {
  margin-bottom: 1.25rem;
}

.btn-quiet {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn-danger {
  background: #c0392b;
  color: #fff;
}

/* ---- result ------------------------------------------------------------ */

.result {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.result-main {
  flex: 1 1 18rem;
  display: flex;
  gap: 0.5rem;
}

.result-url {
  font-family: var(--mono);
  font-size: 1.05rem;
}

.result-qr .qr {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.target {
  font-family: var(--mono);
  font-size: 0.9em;
  /* Long destinations must wrap rather than widen the page. */
  overflow-wrap: anywhere;
}

.panel {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel h2 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.panel .input {
  margin: 0.75rem 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.site-foot {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
}

.site-foot nav {
  max-width: 46rem;
  margin: 0 auto;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-foot a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.site-foot a:hover {
  color: var(--text);
  text-decoration: underline;
}
