/* kilde — site styles
   Palette: deep water-dark with a spring-blue accent.
   Dark by default, light under prefers-color-scheme: light. */

:root {
  --bg: #08090c;
  --bg-elev: #0e1116;
  --bg-elev-2: #141922;
  --border: #1e2530;
  --border-strong: #2a3342;
  --text: #e8ecf2;
  --text-dim: #9aa6b8;
  --text-faint: #6b7688;
  --accent: #58c4f0;
  --accent-soft: rgba(88, 196, 240, 0.12);
  --accent-line: rgba(88, 196, 240, 0.32);
  --code-bg: #0b0e13;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 48px -24px rgba(0, 0, 0, 0.9);
  --radius: 14px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-elev: #f7f9fb;
    --bg-elev-2: #eef2f7;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #10151c;
    --text-dim: #4a5566;
    --text-faint: #77839a;
    --accent: #0b7fb0;
    --accent-soft: rgba(11, 127, 176, 0.09);
    --accent-line: rgba(11, 127, 176, 0.28);
    --code-bg: #0e1116;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 40px -24px rgba(15, 23, 42, 0.35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #04121a; padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 20px;
  height: 62px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text); font-weight: 600; font-size: 1.06rem;
  letter-spacing: -0.015em;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 22px; height: 22px; display: block; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.nav a { color: var(--text-dim); font-size: 0.9rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.lang-switch {
  font-size: 0.8rem; color: var(--text-faint);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 3px 11px; letter-spacing: 0.03em;
}
.lang-switch:hover { color: var(--text); border-color: var(--accent-line); text-decoration: none; }

/* ---------- hero ---------- */

.hero {
  position: relative; overflow: hidden;
  padding: 92px 0 64px;
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: ""; position: absolute; inset: -40% 0 auto 50%;
  width: 900px; height: 900px; transform: translateX(-50%);
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 62%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-line); border-radius: 999px;
  padding: 5px 13px; margin-bottom: 26px;
}
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1.12; letter-spacing: -0.035em; font-weight: 650;
  max-width: 20ch;
}
.hero .lede {
  margin: 0 0 32px; max-width: 60ch;
  font-size: clamp(1.03rem, 2.2vw, 1.18rem);
  color: var(--text-dim);
}
.hero .lede strong { color: var(--text); font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px;
  font-size: 0.94rem; font-weight: 550; letter-spacing: -0.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #04121a; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.btn svg { width: 17px; height: 17px; }

.hero-note { margin: 18px 0 0; font-size: 0.85rem; color: var(--text-faint); }

/* ---------- terminal ---------- */

.terminal {
  margin-top: 44px;
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
}
.terminal-bar i {
  width: 11px; height: 11px; border-radius: 50%; display: block;
  background: #2b3441;
}
.terminal-bar span {
  margin-left: 8px; font: 500 0.78rem var(--mono); color: #6b7688;
}
.terminal pre {
  margin: 0; padding: 20px 22px 24px;
  font: 400 0.88rem/1.85 var(--mono);
  color: #cdd6e3;
  overflow-x: auto;
}
.terminal .c { color: #5b6879; }
.terminal .p { color: #58c4f0; user-select: none; }
.terminal .o { color: #8b96a8; }
.terminal .g { color: #7fd6a0; }

/* ---------- sections ---------- */

section { padding: 76px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: 0; }
.section-head { max-width: 62ch; margin-bottom: 42px; }
.section-head h2 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
  letter-spacing: -0.028em; font-weight: 640; line-height: 1.25;
}
.section-head p { margin: 0; color: var(--text-dim); }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(276px, 1fr)); }
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 26px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card .ico {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: var(--accent-soft); color: var(--accent);
}
.card .ico svg { width: 18px; height: 18px; }
.card h3 { margin: 0 0 8px; font-size: 1.02rem; font-weight: 600; letter-spacing: -0.015em; }
.card p { margin: 0; font-size: 0.92rem; color: var(--text-dim); line-height: 1.65; }
.card code { font: 0.86em var(--mono); color: var(--text); background: var(--bg-elev-2); padding: 1px 5px; border-radius: 5px; }

/* install */

.install-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.snippet {
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
}
.snippet h3 {
  margin: 0 0 12px; font-size: 0.76rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: #6b7688; font-weight: 600;
}
.snippet pre { margin: 0; font: 400 0.87rem/1.9 var(--mono); color: #cdd6e3; }
.snippet .c { color: #5b6879; }
.snippet .p { color: #58c4f0; user-select: none; }

/* requirements */

.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 62ch; }
.req-list li {
  position: relative; padding-left: 20px;
  color: var(--text-dim); font-size: 0.95rem;
}
.req-list li::before {
  content: ""; position: absolute; left: 0; top: 0.72em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.req-list code {
  font: 0.88em var(--mono); background: var(--bg-elev-2);
  padding: 1px 6px; border-radius: 5px; color: var(--text);
}
.req-list strong { color: var(--text); font-weight: 600; }

/* name story */

.story { max-width: 66ch; }
.story p { color: var(--text-dim); margin: 0 0 18px; }
.story p:last-child { margin-bottom: 0; }
.story em { color: var(--accent); font-style: italic; }
.pull {
  margin: 32px 0 0; padding: 20px 26px;
  border-left: 2px solid var(--accent-line);
  background: var(--bg-elev);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text); font-size: 1.05rem; line-height: 1.6;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 46px 0 40px;
  font-size: 0.88rem;
}
.footer-top {
  display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between;
  padding-bottom: 28px; border-bottom: 1px solid var(--border);
}
.footer-top .brand { font-size: 1rem; }
.footer-tag { margin: 8px 0 0; color: var(--text-faint); max-width: 34ch; font-size: 0.85rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 40px; }
.footer-links div { display: grid; gap: 9px; align-content: start; }
.footer-links b {
  font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 600;
}
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  padding-top: 24px; color: var(--text-faint); font-size: 0.83rem;
}
.footer-bottom a { color: var(--text-faint); }

/* ---------- legal pages ---------- */

.legal { padding: 64px 0 88px; }
.legal .wrap { max-width: 760px; }
.legal h1 {
  margin: 0 0 10px; font-size: clamp(2rem, 5vw, 2.6rem);
  letter-spacing: -0.032em; font-weight: 650; line-height: 1.2;
}
.legal .updated {
  margin: 0 0 14px; color: var(--text-faint); font-size: 0.86rem;
  letter-spacing: 0.02em;
}
.legal .summary {
  margin: 0 0 44px; padding: 18px 22px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--radius); color: var(--text); font-size: 0.95rem;
}
.legal .summary strong { font-weight: 600; }
.legal h2 {
  margin: 44px 0 14px; font-size: 1.22rem; font-weight: 620;
  letter-spacing: -0.018em; line-height: 1.35;
  padding-top: 20px; border-top: 1px solid var(--border);
}
.legal h2:first-of-type { border-top: 0; padding-top: 0; }
.legal h3 { margin: 26px 0 10px; font-size: 1.02rem; font-weight: 600; }
.legal p, .legal li { color: var(--text-dim); }
.legal p { margin: 0 0 16px; }
.legal ul, .legal ol { margin: 0 0 16px; padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal code { font: 0.88em var(--mono); background: var(--bg-elev-2); padding: 2px 6px; border-radius: 5px; color: var(--text); }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 0.92rem; }
.legal th, .legal td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal th { color: var(--text); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.legal td { color: var(--text-dim); }
.legal .toc {
  margin: 0 0 44px; padding: 20px 24px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
}
.legal .toc b { display: block; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.legal .toc ol { margin: 0; padding-left: 20px; }
.legal .toc li { margin-bottom: 6px; font-size: 0.92rem; }
.legal .back { display: inline-block; margin-bottom: 26px; font-size: 0.88rem; color: var(--text-dim); }
.legal .back:hover { color: var(--accent); text-decoration: none; }

/* error page */
.error-page { padding: 120px 0; text-align: center; }
.error-page h1 { font-size: 4rem; margin: 0 0 8px; letter-spacing: -0.04em; }
.error-page p { color: var(--text-dim); margin: 0 0 28px; }

@media (max-width: 640px) {
  .hero { padding: 62px 0 52px; }
  section { padding: 56px 0; }
  .site-header .wrap { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; gap: 12px; }
  .nav { gap: 16px; width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
