/* Digital Ranking — site styles (hand-written, no framework) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
}

:root {
  --bg: hsl(228 12% 8%);
  --fg: hsl(210 20% 95%);
  --card: hsl(228 12% 11%);
  --secondary: hsl(228 10% 16%);
  --muted: hsl(215 14% 55%);
  --primary: hsl(217 91% 60%);
  --primary-hover: hsl(217 91% 66%);
  --primary-fg: hsl(228 12% 4%);
  --accent: hsl(160 84% 39%);
  --border: hsl(228 10% 18%);
  --danger: hsl(0 84% 60%);
  --radius: .5rem;
  --container: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0; }
svg.icon { width: 1.25rem; height: 1.25rem; flex: none; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--primary); color: var(--primary-fg);
  padding: .5rem 1rem; border-radius: var(--radius); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 48rem; }
.prose-width { max-width: 44rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: hsl(228 12% 8% / .9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.logo {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1.25rem; letter-spacing: .12em; text-decoration: none; color: var(--fg);
}
.logo::before { content: ""; width: 6px; height: 1.25rem; border-radius: 2px; background: var(--accent); }
.logo span { color: var(--primary); }
.nav { display: flex; align-items: center; gap: 2rem; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: .9rem; transition: color .15s; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--primary); }
.menu-toggle {
  display: none; background: none; border: 0; color: var(--fg); padding: .5rem; cursor: pointer;
}
.menu-toggle svg { width: 1.5rem; height: 1.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  height: 2.75rem; padding: 0 2rem; border-radius: calc(var(--radius) - 2px);
  font: inherit; font-size: .9rem; font-weight: 500; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, opacity .15s;
}
.btn svg { width: 1rem; height: 1rem; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: var(--bg); color: var(--fg); border-color: var(--border); }
.btn-outline:hover { background: var(--secondary); }
.btn-ghost { background: none; color: var(--fg); }
.btn-ghost:hover { background: var(--secondary); }
.btn-sm { height: 2.25rem; padding: 0 .75rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  background-size: cover; background-position: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, hsl(228 12% 8% / .55), hsl(228 12% 8% / .35) 50%, hsl(228 12% 8% / .8));
}
.hero > .container { position: relative; }
.hero-home { padding: 7rem 0 7.5rem; background-image: url("/assets/img/home-hero.jpg"); }
.hero-page { padding: 6rem 0; }
.hero-about { background-image: url("/assets/img/about-hero.jpg"); }
.hero-services { background-image: url("/assets/img/services-hero.jpg"); }
.hero-contact { background-image: url("/assets/img/contact-hero.jpg"); }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 700; letter-spacing: -.03em; }
.hero-page h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); }
.hero h1 .hl { color: var(--primary); display: block; }
.hero .lead { margin: 1.5rem auto 0; max-width: 40rem; font-size: 1.15rem; color: var(--muted); }
.hero-page .lead { margin-top: 1rem; font-size: 1.1rem; }
.hero-actions { margin-top: 2.5rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 6rem 0; border-bottom: 1px solid var(--border); }
.section-plain { border-bottom: 0; }
.section-head { text-align: center; margin-bottom: 4rem; }
.eyebrow {
  display: block; font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--primary); margin-bottom: .75rem;
}
.eyebrow-accent { color: var(--accent); }
.section-head h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); font-weight: 700; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; transition: border-color .2s;
}
.card:hover { border-color: hsl(217 91% 60% / .35); }
.card h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: .75rem; }
.card p { color: var(--muted); font-size: .9rem; line-height: 1.65; }
.card > .icon { width: 1.5rem; height: 1.5rem; color: var(--accent); margin-bottom: 1.25rem; }
.card-sm { padding: 1.5rem; display: flex; flex-direction: column; }
.card-sm h3 { font-size: 1.05rem; margin-bottom: .6rem; }
.card-sm p { font-size: .85rem; flex: 1; }
.card-link {
  margin-top: 1.25rem; display: inline-flex; align-items: center; gap: .35rem;
  color: var(--primary); font-size: .85rem; font-weight: 500; text-decoration: none;
}
.card-link svg { width: .9rem; height: .9rem; transition: transform .15s; }
.card-link:hover svg { transform: translateX(3px); }
.card-title-accent { color: var(--accent); }

/* Five steps */
.steps { text-align: center; }
.step-icon {
  width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem; border-radius: 999px;
  display: grid; place-items: center;
  background: hsl(160 84% 39% / .1); border: 1px solid hsl(160 84% 39% / .3); color: var(--accent);
}
.step-icon svg { width: 1.4rem; height: 1.4rem; }
.step-no { display: block; font-size: .75rem; font-weight: 600; color: var(--accent); margin-bottom: .35rem; }
.steps h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: .5rem; }
.steps p { color: var(--muted); font-size: .85rem; }

/* Difference */
.vs { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; font-size: .9rem; color: var(--muted); }
.pill { padding: .25rem .6rem; border-radius: 4px; font-size: .8rem; font-weight: 600; }
.pill-good { background: hsl(160 84% 39% / .12); color: var(--accent); }
.pill-bad { background: var(--secondary); color: var(--muted); }

/* CTA */
.cta { text-align: center; padding: 6rem 0; border-bottom: 1px solid var(--border); }
.cta .container > .icon { width: 2rem; height: 2rem; color: var(--accent); margin: 0 auto 1.25rem; }
.cta h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); font-weight: 700; }
.cta p { margin: 1rem auto 2rem; max-width: 36rem; color: var(--muted); font-size: 1.1rem; }

/* Long-form text (about, services) */
.text-block p { color: var(--muted); line-height: 1.75; font-size: 1.05rem; }
.text-block p + p { margin-top: 1.25rem; }
.text-block h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); font-weight: 700; margin-bottom: 1.5rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; max-width: 62rem; margin: 0 auto; }
.contact-grid h2 { font-size: 1.6rem; font-weight: 700; }
.contact-grid .sub { color: var(--muted); margin-top: .5rem; font-size: .95rem; }
.form { margin-top: 2rem; display: grid; gap: 1.5rem; }
.field label { display: block; font-size: .9rem; font-weight: 500; margin-bottom: .6rem; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--fg);
  background: var(--bg); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px);
  padding: .6rem .8rem;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.field textarea { min-height: 8rem; resize: vertical; }
.check { display: flex; gap: .75rem; align-items: flex-start; font-size: .85rem; color: var(--muted); }
.check input { width: 1rem; height: 1rem; margin-top: .2rem; accent-color: var(--primary); flex: none; }
.check a { color: var(--primary); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: .9rem; border-radius: var(--radius); padding: .75rem 1rem; display: none; }
.form-status.show { display: block; }
.form-status.error { background: hsl(0 84% 60% / .1); color: hsl(0 84% 72%); border: 1px solid hsl(0 84% 60% / .3); }
.success-box { text-align: center; padding: 3rem 1rem; }
.success-box > .icon { width: 3rem; height: 3rem; color: var(--accent); margin: 0 auto 1rem; }
.success-box h2 { font-size: 1.6rem; }
.success-box p { color: var(--muted); margin-top: .75rem; }
.book-card { padding: 2rem; }
.book-card > .icon { color: var(--primary); width: 2rem; height: 2rem; }
.book-card h3 { font-size: 1.6rem; font-weight: 700; margin-bottom: 1rem; }
.book-card p { font-size: .95rem; }
.book-card .btn { margin-top: 1.5rem; }

/* ---------- Legal pages ---------- */
.legal { padding: 5rem 0 6rem; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 700; margin-bottom: .75rem; }
.legal .updated { color: var(--muted); font-size: .9rem; margin-bottom: 3rem; }
.legal h2 { font-size: 1.3rem; font-weight: 600; margin: 2.5rem 0 1rem; }
.legal h3 { font-size: 1.05rem; font-weight: 600; margin: 1.75rem 0 .75rem; }
.legal p, .legal li { color: var(--muted); line-height: 1.75; }
.legal p + p { margin-top: .75rem; }
.legal ul { padding-left: 1.25rem; margin: .75rem 0; }
.legal li + li { margin-top: .35rem; }
.legal strong { color: var(--fg); font-weight: 600; }
.legal a { color: var(--primary); }
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: var(--radius); }
.legal table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.legal th { text-align: left; background: var(--card); color: var(--fg); font-weight: 600; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.legal td { color: var(--muted); padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal tr:last-child td { border-bottom: 0; }
.legal code { font-size: .8rem; color: var(--fg); }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 5rem 0; }
.notfound .code { font-size: 4rem; font-weight: 700; color: var(--primary); }
.notfound p { color: var(--muted); margin: .5rem 0 2rem; font-size: 1.15rem; }

/* ---------- Footer ---------- */
.site-footer { padding: 2.5rem 0; }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.site-footer p { color: var(--muted); font-size: .85rem; }
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-nav a, .footer-nav button {
  color: var(--muted); font: inherit; font-size: .85rem; text-decoration: none;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.footer-nav a:hover, .footer-nav button:hover { color: var(--fg); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: hsl(228 12% 11% / .97); border-top: 1px solid var(--border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 1rem 0;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner .container { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.cookie-text { display: flex; gap: .75rem; align-items: flex-start; font-size: .85rem; color: var(--muted); }
.cookie-text > .icon { color: var(--accent); margin-top: .1rem; }
.cookie-text a { color: var(--primary); }
.cookie-actions { display: flex; gap: .5rem; flex: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); row-gap: 3rem; }
}
@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; top: 4rem; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: .5rem 1.5rem 1.5rem;
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: .9rem 0; font-size: 1rem; border-bottom: 1px solid var(--border); }
  .nav .btn { margin-top: 1rem; }
  .section, .cta { padding: 4.5rem 0; }
  .hero-home { padding: 5rem 0; }
  .hero-page { padding: 4.5rem 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .cookie-banner .container { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: flex-end; flex-wrap: wrap; }
  .site-footer .container { flex-direction: column-reverse; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
