/* ============================================================
   SWISS AI · Design System "Perimeter"
   Sibling of Operal Atmosphere — ink, gold, glass, Swiss grid.
   ============================================================ */

:root {
  --ink: #0b0c10;
  --ink-2: #101218;
  --panel: #12141a;
  --gold: #d4a843;
  --gold-lite: #e6c877;
  --gold-deep: #9a7b2e;
  --swiss-red: #da291c;
  --text: #f2f1ec;
  --muted: #a7abb5;
  --line: rgba(255, 255, 255, 0.12);
  --gold-line: rgba(212, 168, 67, 0.28);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-2: rgba(255, 255, 255, 0.09);
  --maxw: 1200px;
  --font-display: "Space Grotesk", "Helvetica Neue", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; }
.h-display { font-size: clamp(3rem, 8vw, 6.2rem); }
.h-section { font-size: clamp(1.9rem, 4vw, 3rem); }
.h-card { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 60ch; }
.gold { background: linear-gradient(100deg, var(--gold-lite), var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* coordinate eyebrow — jurisdiction encoded in structure */
.coord {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.coord::before { content: ""; width: 28px; height: 1px; background: var(--gold-line); }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 60;
  background: rgba(11, 12, 16, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: 0.01em; }
.brand-mark .dot { color: var(--gold); }
.brand-by { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.navlinks { display: flex; gap: 28px; }
.navlinks a { font-size: 14px; color: #c7cad2; transition: color 0.2s; }
.navlinks a:hover { color: #fff; }
.navmeta { display: flex; align-items: center; gap: 14px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 100px; overflow: hidden;
  font-size: 11px; font-weight: 600; font-family: var(--font-mono); }
.lang a { padding: 5px 11px; color: var(--muted); }
.lang a.on { background: var(--gold); color: var(--ink); }
@media (max-width: 900px) { .navlinks { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; font-family: var(--font-body);
  border-radius: 8px; padding: 14px 26px; cursor: pointer; border: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, filter 0.2s;
  white-space: nowrap;
}
.btn-gold { background: linear-gradient(100deg, var(--gold-lite), var(--gold)); color: #231a05; }
.btn-gold:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 12px 34px rgba(212, 168, 67, 0.3); }
.btn-glass { background: var(--glass); border: 1px solid var(--line); color: var(--text); }
.btn-glass:hover { background: var(--glass-2); }
.btn-sm { padding: 9px 18px; font-size: 13.5px; }

/* ---------- hero with jurisdiction perimeter ---------- */
.hero { position: relative; padding: 96px 0 110px; overflow: hidden; }
.hero-inner {
  position: relative;
  padding: clamp(36px, 6vw, 72px);
  border-radius: 16px;
}
/* the perimeter: a line that draws itself around the content */
.perimeter { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.perimeter rect {
  fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: 0.85;
  stroke-dasharray: 4000; stroke-dashoffset: 4000;
  animation: draw 2.6s cubic-bezier(0.6, 0, 0.2, 1) 0.3s forwards;
  vector-effect: non-scaling-stroke;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.perimeter-tag {
  position: absolute; top: -9px; left: 32px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); background: var(--ink); padding: 0 10px;
  opacity: 0; animation: fadein 0.8s ease 2.4s forwards;
}
@keyframes fadein { to { opacity: 1; } }
.hero h1 { margin: 20px 0 22px; }
.hero .lede { margin-bottom: 36px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-facts { display: flex; gap: 34px; flex-wrap: wrap; margin-top: 52px; }
.fact .coord { color: var(--muted); }
.fact .coord::before { background: var(--line); }
.fact strong { display: block; font-family: var(--font-display); font-size: 1.35rem; margin-top: 6px; font-weight: 600; }

/* topographic contour backdrop */
.topo {
  position: absolute; inset: -10% -20%; z-index: -1; opacity: 0.5; pointer-events: none;
}
.topo path { fill: none; stroke: rgba(212, 168, 67, 0.09); stroke-width: 1; }
.topo .major { stroke: rgba(212, 168, 67, 0.16); }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: -1; }

/* ---------- sections ---------- */
section { position: relative; padding: 96px 0; }
section.tight { padding: 64px 0; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head h2 { margin: 16px 0 18px; }

/* trust strip */
.trust { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 26px 0; background: var(--ink-2); }
.trust-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.trust-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.trust-items { display: flex; gap: 28px; flex-wrap: wrap; font-family: var(--font-display); font-size: 15px; font-weight: 500; color: #d8dae0; }
.trust-items span { display: inline-flex; align-items: center; gap: 9px; }
.trust-items span::before { content: ""; width: 5px; height: 5px; background: var(--gold); border-radius: 50%; }

/* cards */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 940px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px;
  padding: 30px 28px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover { border-color: var(--gold-line); transform: translateY(-3px); }
.card .coord { margin-bottom: 16px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 14.5px; }
.card-risk { border-left: 2px solid rgba(218, 41, 28, 0.55); border-radius: 4px 14px 14px 4px; }
.card-risk .coord { color: #e0837b; }
.card-risk .coord::before { background: rgba(218, 41, 28, 0.4); }

/* swiss badge — the one red element */
.ch-badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 100px; padding: 8px 16px; color: var(--text);
  background: var(--glass);
}
.ch-cross {
  width: 14px; height: 14px; background: var(--swiss-red); border-radius: 2px;
  position: relative; flex: none;
}
.ch-cross::before, .ch-cross::after { content: ""; position: absolute; background: #fff; }
.ch-cross::before { width: 8px; height: 2px; top: 6px; left: 3px; }
.ch-cross::after { width: 2px; height: 8px; top: 3px; left: 6px; }

/* process steps — a real sequence */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 940px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 30px 28px 30px 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; color: var(--gold);
  display: block; margin-bottom: 18px;
}
.step h3 { margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 14.5px; }

/* access models */
.tier { display: flex; flex-direction: column; }
.tier ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.tier li { font-size: 14px; color: #d0d3da; padding-left: 22px; position: relative; }
.tier li::before { content: "→"; position: absolute; left: 0; color: var(--gold); font-family: var(--font-mono); font-size: 12px; }
.tier .tier-for { margin-top: auto; padding-top: 22px; font-size: 13px; color: var(--muted); font-style: italic; }
.tier-hi { border-color: var(--gold-line); background: linear-gradient(180deg, rgba(212, 168, 67, 0.07), var(--glass)); }

/* imagery */
.figure { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.figure img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85) brightness(0.8); }
.figure figcaption {
  position: absolute; left: 18px; bottom: 14px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase;
  color: rgba(242, 241, 236, 0.85); background: rgba(11, 12, 16, 0.65); padding: 6px 12px; border-radius: 6px;
  backdrop-filter: blur(8px);
}
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
@media (max-width: 940px) { .split { grid-template-columns: 1fr; } }

/* check band */
.band {
  border: 1px solid var(--gold-line); border-radius: 18px;
  padding: clamp(36px, 5vw, 64px);
  background:
    radial-gradient(700px 320px at 12% 0%, rgba(212, 168, 67, 0.13), transparent 65%),
    var(--panel);
  text-align: left;
  position: relative; overflow: hidden;
}
.band h2 { margin: 14px 0 14px; }
.band .lede { margin-bottom: 30px; }

/* partnership */
.partner-card .role { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.partner-card h3 { font-size: 1.5rem; }
.partner-card p { margin-top: 10px; }

/* FAQ */
.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0; font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--gold); font-size: 18px; transition: transform 0.25s; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 0 24px; color: var(--muted); font-size: 15px; max-width: 64ch; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 56px 0 40px; background: var(--ink-2); }
.foot { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot-left p { color: var(--muted); font-size: 13.5px; max-width: 44ch; margin-top: 12px; }
.foot-links { display: flex; gap: 48px; flex-wrap: wrap; }
.foot-links h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; font-weight: 500; }
.foot-links ul { list-style: none; padding: 0; display: grid; gap: 9px; }
.foot-links a { font-size: 14px; color: #c7cad2; }
.foot-links a:hover { color: #fff; }
.foot-meta { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- check page ---------- */
.check-shell { max-width: 760px; margin: 0 auto; padding: 72px 32px 110px; }
.check-progress { height: 3px; background: var(--line); border-radius: 3px; margin: 34px 0 40px; overflow: hidden; }
.check-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-lite), var(--gold)); width: 0%; transition: width 0.4s ease; }
.q-card { background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 36px; }
.q-dim { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.q-title { font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.7rem); font-weight: 600; line-height: 1.25; margin-bottom: 26px; }
.q-opts { display: grid; gap: 12px; }
.q-opt {
  text-align: left; background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; font-size: 15px; color: var(--text); cursor: pointer; font-family: var(--font-body);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.q-opt:hover { border-color: var(--gold-line); background: rgba(212, 168, 67, 0.06); transform: translateX(3px); }
.q-nav { display: flex; justify-content: space-between; margin-top: 26px; }
.q-back { background: none; border: none; color: var(--muted); font-size: 13.5px; cursor: pointer; font-family: var(--font-mono); letter-spacing: 0.08em; }
.q-back:hover { color: var(--text); }

/* result */
.score-hero { text-align: center; padding: 20px 0 8px; }
.score-num { font-family: var(--font-display); font-size: clamp(4.5rem, 12vw, 7rem); font-weight: 700; line-height: 1; }
.score-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.score-verdict { font-family: var(--font-display); font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 600; margin: 26px auto 12px; max-width: 24ch; line-height: 1.3; }
.score-sub { color: var(--muted); max-width: 52ch; margin: 0 auto; font-size: 15px; }
.dims { display: grid; gap: 18px; margin: 44px 0; text-align: left; }
.dim-row .dim-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 8px; }
.dim-row .dim-head b { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }
.dim-bar { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.dim-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-lite)); width: 0; transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s; }
.result-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }
.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .perimeter rect { animation: none; stroke-dashoffset: 0; }
  .perimeter-tag { animation: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .btn, .q-opt { transition: none; }
}
