/* PANIGI — Riviera. Light by default, dark follows the system or the toggle (data-theme). */
:root {
  --notte: #0D1826;
  --marina: #13233A;
  --amalfi: #1F5A8F;
  --crema: #F4F0E6;
  --cedro: #CBD66B;

  --font-display: 'Bodoni Moda', Didot, 'Bodoni 72', serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, sans-serif;

  --bg: var(--crema);
  --surface: #EAE4D6;
  --line: #D6CFBF;
  --text: var(--marina);
  --text-body: #2E3A4E;
  --text-muted: #5A6272;
  --accent-text: var(--amalfi);
  --button-bg: var(--marina);
  --button-text: var(--crema);
  --focus: var(--amalfi);

  --gutter: clamp(16px, 5vw, 72px);
  --max: 1280px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--notte);
    --surface: #15233A;
    --line: #26364F;
    --text: #F1ECE2;
    --text-body: #CDD4DE;
    --text-muted: #A9B4C4;
    --accent-text: var(--cedro);
    --button-bg: var(--cedro);
    --button-text: var(--notte);
    --focus: var(--cedro);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: var(--notte);
  --surface: #15233A;
  --line: #26364F;
  --text: #F1ECE2;
  --text-body: #CDD4DE;
  --text-muted: #A9B4C4;
  --accent-text: var(--cedro);
  --button-bg: var(--cedro);
  --button-text: var(--notte);
  --focus: var(--cedro);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.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;
}

/* ── Type ─────────────────────────────── */
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  margin: 0;
  font-size: 12px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow::before { content: ""; width: 40px; height: 1px; background: var(--accent-text); flex-shrink: 0; }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  /* Browsers pick Bodoni's finest optical size for big text, whose hairlines vanish on screen.
     Pin sturdier cuts: upright at 28 (matches the logo), italic at 18 and a touch heavier. */
  font-variation-settings: "opsz" 28;
  letter-spacing: -.01em;
  line-height: 1.02;
  margin: 0;
}
.display em { font-style: italic; font-weight: 450; font-variation-settings: "opsz" 18; color: var(--accent-text); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* Light mode: cedro is a highlighter under the words, never the text itself */
:root:not([data-theme="dark"]) .display em.mark { box-shadow: inset 0 -.26em 0 var(--cedro); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .display em.mark { box-shadow: none; } }

.lede { color: var(--text-body); font-size: clamp(17px, 1.6vw, 19px); max-width: 34em; margin: 0; }

/* ── Buttons ──────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 26px;
  border-radius: 4px;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  transition: transform .15s ease, opacity .15s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--button-bg); color: var(--button-text); }
.btn-ghost { border: 1px solid var(--text); color: var(--text); font-weight: 500; }
.btn svg { flex-shrink: 0; }

/* ── Nav ──────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 84px; gap: 24px; }

.wordmark {
  display: block;
  width: 164px; aspect-ratio: 9778 / 1673;
  background: currentColor;
  -webkit-mask: url(wordmark.svg) center / contain no-repeat;
  mask: url(wordmark.svg) center / contain no-repeat;
}
.nav-home { color: var(--text); padding: 10px 0; }

.nav-links { display: flex; align-items: center; gap: 36px; font-size: 14px; letter-spacing: .06em; }
.nav-links a:not(.btn) { color: var(--text-body); }
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-links .btn { min-height: 44px; padding: 0 20px; font-size: 14px; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--text-muted); }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

@media (max-width: 760px) {
  .nav-links .nav-text { display: none; }
  .nav-links { gap: 12px; }
  .wordmark { width: 120px; }
}

/* ── Hero ─────────────────────────────── */
.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(64px, 9vw, 120px); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
.hero-copy { display: flex; flex-direction: column; gap: 30px; }
.hero .display { font-size: clamp(44px, 5.4vw, 80px); }
@media (min-width: 1200px) { .hero .display em { white-space: nowrap; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.roster {
  margin-top: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 28px;
}
.roster a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.roster a:last-child { border-bottom: 0; }
.roster-name { display: block; font-family: var(--font-display); font-size: 26px; line-height: 1.2; }
.roster-sub { display: block; font-size: 13px; color: var(--text-muted); }
.roster a:hover .roster-name { color: var(--accent-text); }

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .roster { margin-top: 0; max-width: 480px; }
}

/* ── Status pills ─────────────────────── */
.status {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted);
}
.status-live { padding: 5px 10px; border-radius: 4px; background: var(--cedro); color: var(--notte); }

/* ── Sections ─────────────────────────── */
.section { padding: clamp(72px, 10vw, 128px) 0; border-top: 1px solid var(--line); }
.section-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head .display { font-size: clamp(40px, 5.5vw, 64px); }

/* ── Apps ─────────────────────────────── */
.featured {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 5vw, 72px);
  padding: clamp(28px, 4vw, 48px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  margin-bottom: 24px;
}
.featured-main { display: flex; flex-direction: column; gap: 18px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-num { font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--text-muted); }
.app-icons { display: flex; gap: 14px; }
.app-icons img { width: 64px; height: 64px; border-radius: 15px; }
.featured .app-name { font-size: clamp(48px, 6vw, 72px); }
.app-cat { margin: 0; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }
.app-desc { margin: 0; color: var(--text-body); }
.app-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--text);
}
a.chip:hover { border-color: var(--text); }
.chip-muted { color: var(--text-muted); }
.text-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--accent-text); padding: 10px 0; }

.why { border-left: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.why-label { margin: 0; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--text-muted); }
.why blockquote { margin: 0; font-family: var(--font-display); font-style: italic; font-size: clamp(19px, 1.8vw, 22px); line-height: 1.5; color: var(--text); }

.app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.app-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line); border-radius: 16px;
}
.app-card .app-name { font-size: 36px; }
.app-card .why { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.app-card .why blockquote { font-size: 17px; }

@media (max-width: 860px) {
  .featured, .app-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Hire ─────────────────────────────── */
.hire { background: var(--marina); color: var(--crema); border-top: 0; }
.hire .eyebrow { color: #A9B4C4; }
.hire .eyebrow::before { background: var(--cedro); }
.hire .display em { color: var(--cedro); box-shadow: none; }
.hire-inner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 64px; align-items: end; }
.hire .display { font-size: clamp(44px, 6vw, 76px); margin-top: 18px; }
.hire p.body { color: #CDD4DE; margin: 24px 0 0; max-width: 36em; }
.hire-cta { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.hire .btn-primary { background: var(--cedro); color: var(--notte); }
.hire-note { margin: 0; font-size: 14px; color: #A9B4C4; }
:root[data-theme="dark"] .hire { background: #15233A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hire { background: #15233A; } }
@media (max-width: 860px) { .hire-inner { grid-template-columns: minmax(0, 1fr); gap: 36px; } }

/* ── About ────────────────────────────── */
.about-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); }
.about .display { font-size: clamp(44px, 6vw, 72px); margin: 18px 0 28px; }
.about-body p { margin: 0 0 16px; color: var(--text-body); max-width: 34em; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stat { padding: 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-num { margin: 0; font-family: var(--font-display); font-size: 52px; line-height: 1; }
.stat-label { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); }
.values { list-style: none; margin: 32px 0 0; padding: 0; }
.values li { display: flex; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text-body); }
.values li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cedro); flex-shrink: 0; transform: translateY(-2px); }
@media (max-width: 860px) { .about-inner { grid-template-columns: minmax(0, 1fr); } }

/* ── Footer ───────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 64px 0 40px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer .wordmark { width: 170px; color: var(--text); }
.footer-tag { margin: 16px 0 0; font-family: var(--font-display); font-style: italic; color: var(--text-muted); }
.footer-label { margin: 0 0 14px; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--text-muted); }
.footer-links { display: flex; flex-direction: column; gap: 4px; }
.footer-links a { color: var(--text-body); padding: 4px 0; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-muted); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Legal pages ──────────────────────── */
.page-head { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 64px); border-bottom: 1px solid var(--line); }
.page-head .display { font-size: clamp(48px, 7vw, 88px); margin: 20px 0 28px; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 14px; color: var(--text-muted); }
.legal-meta strong { color: var(--text); font-weight: 600; }
.legal { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); padding: clamp(48px, 7vw, 80px) 0; }
.toc { position: sticky; top: 108px; align-self: start; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 12px; padding: 7px 0; font-size: 14px; color: var(--text-body); }
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-display); font-style: italic; color: var(--text-muted); }
.toc a:hover { color: var(--text); }
.legal-body { max-width: 44em; color: var(--text-body); }
.legal-body > p:first-child { font-size: 19px; color: var(--text); }
.legal-body section { padding-top: 40px; margin-top: 40px; border-top: 1px solid var(--line); }
.legal-body h2 { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.2; color: var(--text); margin: 0 0 18px; display: flex; gap: 16px; align-items: baseline; }
.legal-body h2 span { font-style: italic; font-size: 20px; color: var(--text-muted); }
.legal-body strong { color: var(--text); font-weight: 600; }
.legal-body ul { padding-left: 1.2em; }
.legal-body li { margin-bottom: 8px; }
.legal-body a { color: var(--accent-text); border-bottom: 1px solid currentColor; }
.callout { margin: 24px 0; padding: 20px 24px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.contact-block { margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; }
.contact-block p { margin: 0 0 6px; }
@media (max-width: 860px) {
  .legal { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
}

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

/* ── Multi-page bits ──────────────────── */
.nav-links a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -1px 0 currentColor; }
.page-head .lede { margin-top: 4px; }
.section-foot { margin-top: 36px; }
.offer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 8px; }
.offer .app-card h3 { font-size: 30px; }
@media (max-width: 860px) { .offer { grid-template-columns: minmax(0, 1fr); } }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact-email { font-family: var(--font-display); font-size: clamp(34px, 5vw, 56px); line-height: 1.1; color: var(--text); overflow-wrap: anywhere; }
.contact-email:hover { color: var(--accent-text); }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--text-body); }
.contact-list li:first-child { border-top: 1px solid var(--line); }
.contact-list strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }

/* Same sturdier optical size for every other Bodoni setting (see .display) */
.contact-email, .stat-num, .roster-name, .card-num, .legal-body h2 { font-variation-settings: "opsz" 28; }
.why blockquote, .footer-tag { font-variation-settings: "opsz" 18; }
