/* PadelFlow landing — "Nordic Court" v2 (desktop-first redesign).
   Global system per the design handoff; bespoke vignettes/diagrams inside
   pages use inline styles by convention. */

/* ---------- Fonts (self-hosted, OFL — licenses in ./fonts/) ---------- */
@font-face {
  font-family: 'Familjen Grotesk';
  src: url('/assets/fonts/FamiljenGrotesk-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Familjen Grotesk';
  src: url('/assets/fonts/FamiljenGrotesk-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/assets/fonts/InstrumentSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/assets/fonts/InstrumentSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/assets/fonts/InstrumentSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/IBMPlexMono-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/IBMPlexMono-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --ink: #0B1B2B;
  --ink-soft: #102033;
  --primary: #0F4C81;
  --primary-container: #D8E9F6;
  --accent: #2EC4B6;
  --accent-deep: #12A99B;
  --accent-ink: #06312D;
  --bg: #F6F8FA;
  --card: #FFFFFF;
  --text: #102033;
  --text-2: #52616F;
  --text-3: #7C8B99;
  --divider: #DDE5EC;
  --stroke: #C7D3DD;
  --hairline: #F1F5F8;
  --on-ink: #FFFFFF;
  --on-ink-70: rgba(255, 255, 255, 0.7);
  --on-ink-50: rgba(255, 255, 255, 0.5);
  /* v2 additions */
  --section-border: #E9EEF3;
  --card-border: #E3EAF0;
  --teal-tint: #D8F7F3;
  --teal-panel: #F2FBFA;
  --neg-text: #B45348;
  --neg-border: #E3B8B0;
  --disabled-bg: #E2E9EF;
  --disabled-text: #98A6B3;
  --r12: 12px;
  --r16: 16px;
  --r18: 18px;
  --r22: 22px;
  --font-display: 'Familjen Grotesk', 'Avenir Next', system-ui, sans-serif;
  --font-body: 'Instrument Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* Author display rules (e.g. .hw-steps { display: flex }) outrank the UA
   [hidden] rule, so JS-driven hiding needs this to win. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html.reduced-motion { scroll-behavior: auto; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(40px, 4.4vw, 62px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h2 {
  font-size: clamp(29px, 3.2vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h3 { font-size: 21px; line-height: 1.25; }
p { margin: 0 0 1em; }

.container { max-width: 1320px; margin: 0 auto; padding: 0 40px; }

.kicker {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 16px;
}
.on-ink .kicker, .band-ink .kicker { color: var(--accent); }

.lede { font-size: 18.5px; line-height: 1.6; color: var(--text-2); max-width: 56ch; }
.on-ink .lede, .band-ink .lede { color: var(--on-ink-70); }

/* ---------- Header (sticky, 74px, ink) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.site-header .bar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 40px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--on-ink);
}
.wordmark .mark {
  width: 11px;
  height: 11px;
  background: var(--accent);
  transform: rotate(45deg);
  flex: none;
}
.site-nav { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.site-nav a { color: rgba(255, 255, 255, 0.72); font-weight: 600; font-size: 15px; transition: color 150ms; }
.site-nav a:hover { color: var(--on-ink); }
.nav-download {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r12);
  background: var(--accent);
  color: var(--accent-ink) !important;
  transition: filter 150ms;
}
.nav-download:hover { filter: brightness(0.93); }
.lang-switch {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.09em;
  border: 1px solid var(--on-ink-50);
  border-radius: 999px;
  padding: 5px 12px;
}
.lang-switch:hover { border-color: var(--on-ink); }

/* Formats dropdown (kept from v1 by request; restyled for the 74px bar) */
.nav-drop { position: relative; }
.nav-drop > a::after { content: ' ▾'; font-size: 0.7em; opacity: 0.7; }
.drop-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -14px;
  z-index: 120;
  min-width: 240px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r16);
  box-shadow: 0 10px 30px rgba(11, 27, 43, 0.18);
  padding: 8px;
}
.nav-drop:hover .drop-menu,
.nav-drop:focus-within .drop-menu { display: block; }
.drop-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text) !important;
  font-weight: 500;
  font-size: 15px;
}
.drop-menu a:hover { background: var(--bg); }

/* ---------- Section bands ---------- */
.band { padding: 104px 0; }
.band-tight { padding: 64px 0; }
.band-ink { background: var(--ink); color: var(--on-ink); }
.band-ink h1, .band-ink h2, .band-ink h3 { color: var(--on-ink); }
.band-bg { background: var(--bg); }
.band-white {
  background: var(--card);
  border-top: 1px solid var(--section-border);
  border-bottom: 1px solid var(--section-border);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 57px;
  padding: 0 29px;
  border-radius: var(--r16);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16.5px;
  transition: filter 150ms, border-color 150ms;
}
.btn:hover { filter: brightness(0.93); }
.btn-accent { background: var(--accent); color: var(--accent-ink) !important; }
.btn-outline { border: 1.5px solid rgba(255, 255, 255, 0.45); color: var(--on-ink) !important; }
.btn-outline:hover { filter: none; border-color: var(--on-ink); }
.btn-ghost { border: 1.5px solid var(--stroke); color: var(--primary) !important; background: var(--card); }
.btn-primary { background: var(--primary); color: #fff !important; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.trust-line { font-size: 14.5px; color: var(--on-ink-50); margin-top: 18px; }

/* ---------- Pills ---------- */
.fact-pill {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 6px 13px;
  color: var(--text-2);
  background: var(--card);
}
.band-ink .fact-pill, .on-ink .fact-pill {
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
}
.facts-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 28px; }
.tag {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--teal-tint);
  border-radius: 999px;
  padding: 4px 11px;
}

/* ---------- Cards ---------- */
.card-lite {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r22);
  padding: 30px;
}
.card-dark {
  background: var(--ink-soft);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--r22);
  padding: 34px;
  color: var(--on-ink);
}
.showcase-shadow { box-shadow: 0 34px 90px rgba(0, 0, 0, 0.45); }

/* ---------- Hero grids ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.hero-visual { position: relative; min-height: 680px; }

/* Format switcher strip (format-page heroes) */
.fmt-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 40px; }
.fmt-strip .fmt-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--on-ink-50);
  margin-right: 6px;
}
.fmt-pill {
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 999px;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.75);
  transition: color 150ms, border-color 150ms;
}
a.fmt-pill:hover { color: var(--on-ink); border-color: rgba(255, 255, 255, 0.6); }
.fmt-pill.is-current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- Format explorer (homepage) ---------- */
.explorer { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; }
.ex-tabs { flex: 1 1 300px; display: flex; flex-direction: column; gap: 12px; }
.ex-tab {
  border-radius: var(--r16);
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
.ex-tab:hover { border-color: var(--stroke); }
.ex-tab .ex-name { font-family: var(--font-display); font-weight: 600; font-size: 17.5px; }
.ex-tab .ex-sub { font-size: 13.5px; color: var(--text-3); margin-top: 2px; }
.ex-tab.is-active { background: var(--ink); border-color: var(--ink); }
.ex-tab.is-active .ex-name { color: var(--on-ink); }
.ex-tab.is-active .ex-sub { color: rgba(255, 255, 255, 0.65); }
.ex-tab.is-active .tag { background: rgba(46, 196, 182, 0.18); color: var(--accent); }
.ex-panel {
  flex: 2.2 1 520px;
  background: var(--bg);
  border-radius: var(--r22);
  padding: 40px;
}

/* ---------- Walkthrough (homepage) ---------- */
.hw { display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap; }
.hw-left { flex: 1.2 1 400px; }
.hw-toggle {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}
.hw-seg {
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-2);
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
}
.hw-seg.is-active { background: var(--ink); color: var(--on-ink); }
.hw-steps { display: flex; flex-direction: column; gap: 10px; }
.hw-step {
  border-radius: var(--r16);
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--card-border);
  cursor: pointer;
  display: flex;
  gap: 14px;
  align-items: baseline;
  transition: background 150ms, border-color 150ms;
}
.hw-step .hw-num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--accent-deep);
}
.hw-step .hw-title { font-family: var(--font-display); font-weight: 600; font-size: 16.5px; }
.hw-step .hw-desc { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.hw-step.is-active { background: var(--ink); border-color: var(--ink); }
.hw-step.is-active .hw-num { color: var(--accent); }
.hw-step.is-active .hw-title { color: var(--on-ink); }
.hw-step.is-active .hw-desc { color: rgba(255, 255, 255, 0.65); }
.hw-caption {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 18px;
}
.hw-right { flex: 1 1 320px; display: flex; justify-content: center; }

/* ---------- Sticky side panel (format pages) ---------- */
.split-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); gap: 48px; align-items: start; }
.sticky-panel { position: sticky; top: 100px; }
.panel-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r22);
  padding: 26px;
  box-shadow: 0 14px 44px rgba(11, 27, 43, 0.08);
}
.prose { max-width: 620px; }
.prose p { color: var(--text-2); }

/* Numbered rule cards */
.num-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.num-card {
  background: var(--bg);
  border-radius: var(--r18);
  padding: 24px;
}
.num-card .num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--accent-deep);
  display: block;
  margin-bottom: 8px;
}
.num-card .txt { font-size: 15px; font-weight: 600; line-height: 1.5; }

/* Link cards (other formats) */
.link-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
a.link-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r18);
  padding: 24px;
  color: inherit;
  transition: border-color 150ms;
}
a.link-card:hover { border-color: var(--stroke); }
.link-card .lc-name { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.link-card .lc-sub { font-size: 14px; color: var(--text-2); margin: 4px 0 10px; }
.link-card .lc-go { font-weight: 600; font-size: 14px; color: var(--accent-deep); }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 12px; align-items: start; }
.faq details {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r16);
  padding: 0 22px;
}
.faq summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  padding: 18px 0;
  list-style: none;
  position: relative;
  padding-right: 32px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: 17px;
}
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--text-2); font-size: 15px; padding-bottom: 18px; margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--on-ink-50);
  padding: 64px 0 56px;
  font-size: 14.5px;
}
.site-footer .cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.site-footer h4 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--on-ink-70);
  margin: 0 0 1em;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.6em; }
.site-footer a { color: var(--on-ink-70); }
.site-footer a:hover { color: var(--on-ink); }
.site-footer .legal {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Motion ---------- */
@keyframes pf-drift-a {
  from { transform: translateY(-5px); }
  to { transform: translateY(7px); }
}
@keyframes pf-drift-b {
  from { transform: translateY(7px); }
  to { transform: translateY(-5px); }
}
.drift-a { animation: pf-drift-a 7s ease-in-out infinite alternate; }
.drift-b { animation: pf-drift-b 9s ease-in-out infinite alternate; }
@keyframes pf-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
  animation: pf-pulse 1.6s ease-in-out infinite;
}
html.reduced-motion .drift-a,
html.reduced-motion .drift-b,
html.reduced-motion .live-dot { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .drift-a, .drift-b, .live-dot { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .container, .site-header .bar { padding-left: 24px; padding-right: 24px; }
  .band { padding: 72px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-visual { min-height: 0; }
  .split-2col { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .faq-grid { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
@media (max-width: 560px) {
  .container, .site-header .bar { padding-left: 18px; padding-right: 18px; }
  .site-header .bar { height: auto; padding-top: 12px; padding-bottom: 12px; }
  .cta-row .btn { flex: 1 1 100%; }
}
