/* Orchestriq — design token condivisi dall'app (src/styles.css) e dal sito
   pubblico (site/build.mjs li concatena a site/site.css). */

/* ---------- 1. token ---------- */
:root {
  color-scheme: light;

  /* neutri */
  --bg: #f8f7fa;            /* tela */
  --surface: #ffffff;       /* card, pannelli */
  --surface-2: #eeedf2;     /* superficie secondaria, chip */
  --surface-hover: #f3f2f7;
  --heading: #1e0a3c;       /* titoli: 16.9:1 sulla tela */
  --text: #39364f;          /* testo: 10.8:1 */
  --text-muted: #686b80;    /* testo secondario: 4.9:1 sulla tela, 4.5:1 su surface-2 */
  --text-dim: var(--text-muted);
  --border: #dbdae3;        /* filo sottile */
  --border-strong: #c4c2d0; /* bordo dei campi */
  --border-hover: #a9a6ba;

  /* l'unico accento interattivo: salvia, il verde più scuro del marchio */
  --accent: #44735d;        /* bianco sopra 5.45:1; come testo 5.45:1 sul bianco, 5.10:1 sulla tela */
  --accent-strong: #3a6450; /* hover: 6.73:1 */
  --accent-soft: #e6f0ea;
  --accent-ink: #2c4d3d;    /* testo sul tenue: 8.06:1 */
  --on-accent: #ffffff;
  --ring: 0 0 0 3px rgba(68, 115, 93, 0.30);

  /* tinte tenui per stati e corsie: fondo · inchiostro (AA) · pallino */
  --tint-sage: #e3f0e8;   --ink-sage: #2c4d3d;   --dot-sage: #5f9a7c;   /* fatto */
  --tint-amber: #fdf1dc;  --ink-amber: #8a4b00;  --dot-amber: #e3a008;  /* da rifare, avvisi */
  --tint-red: #fde8e8;    --ink-red: #b42318;    --dot-red: #e5484d;    /* fallito */
  --tint-sky: #e6f0fb;    --ink-sky: #1d5a96;    --dot-sky: #3b82c4;    /* in corso */
  --tint-lilac: #f0ebfa;  --ink-lilac: #5a3e94;  --dot-lilac: #9a7fd1;  /* in coda */
  --tint-pink: #fbe9f3;   --ink-pink: #9d1f63;   --dot-pink: #d6409f;   /* attesa remota */
  --tint-gray: var(--surface-2); --ink-gray: #5f6277; --dot-gray: #9a9cad; /* annullato */
  --dot-coral: #d9734e;

  /* semantica */
  --primary: var(--accent);
  --success: var(--dot-sage);
  --warning: var(--dot-amber);
  --info: var(--dot-sky);
  --danger: #b42318;        /* testo e bordi di errore: 6.6:1 sul bianco */
  --warn: #8a4b00;          /* testo di avviso: 6.8:1 sul bianco */
  --ok: var(--dot-sage);

  /* alias storici usati negli stili inline dei componenti */
  --bg-raised: var(--surface);
  --bg-panel: var(--surface);
  --bg-hover: var(--surface-hover);
  --teal: var(--dot-sage);

  /* forma, movimento */
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius: 20px;
  --radius-sm: 8px;         /* campi */
  --radius-xs: 6px;
  --shadow-hairline: 0 1px 2px rgba(30, 10, 60, 0.06);
  --shadow-float: 0 12px 32px rgba(30, 10, 60, 0.10), 0 1px 2px rgba(30, 10, 60, 0.06); /* solo per ciò che galleggia: dialoghi, fogli, toast */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 140ms;
  --med: 180ms;

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  --topbar-h: 60px;
  --sidebar-w: 236px;
  --inspector-w: 340px;
  --jobs-h: 240px;
  --track-label-w: 190px;
}

/* tema scuro (facoltativo): stessa sobrietà, superfici notte */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121118;
    --surface: #1b1a23;
    --surface-2: #25242f;
    --surface-hover: #22212b;
    --heading: #f4f2fa;
    --text: #d9d7e3;
    --text-muted: #a09eb0;
    --border: #2f2e3a;
    --border-strong: #423f52;
    --border-hover: #5a576d;
    --accent: #95bba6;      /* sul fondo scuro 8.9:1; testo scuro sopra */
    --accent-strong: #b3d6c1;
    --accent-soft: #22332b;
    --accent-ink: #b3d6c1;
    --on-accent: #121118;
    --ring: 0 0 0 3px rgba(149, 187, 166, 0.4);
    --tint-sage: #1c3027;   --ink-sage: #9fd0b4;
    --tint-lilac: #2b2442;  --ink-lilac: #c9b6f5;
    --tint-amber: #3a2c12;  --ink-amber: #f2c46b;
    --tint-red: #3d1a1c;    --ink-red: #ff9b94;
    --tint-pink: #3a1a2e;   --ink-pink: #f59ac9;
    --tint-sky: #162a40;    --ink-sky: #8fc2f2;
    --ink-gray: #b4b2c4;
    --danger: #ff9b94;
    --warn: #f2c46b;
    --shadow-hairline: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-float: 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}

/* =====================================================================
   Orchestriq — sito pubblico (P1). Stesso linguaggio dell'app (token in
   src/tokens.css, concatenati prima di questo file da site/build.mjs):
   tela neutra, card bianche con filo sottile, un solo accento salvia.
   Qui un po' più espressivo: titoli grandi, molto spazio, fotogrammi.
   ===================================================================== */

@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/site/fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/site/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.6; letter-spacing: 0.01em; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--heading); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 16px; }
h2 { font-size: clamp(26px, 3.2vw, 36px); }
h3, .h3 { font-size: 19px; letter-spacing: -0.01em; line-height: 1.3; color: var(--heading); font-weight: 700; margin: 0 0 8px; }
p { margin: 0 0 16px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
img, svg, video { display: block; max-width: 100%; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--text-muted); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 820px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--surface); color: var(--heading);
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 20px;
  border-radius: 999px; border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent);
  font: 600 15px/1.2 var(--font); letter-spacing: 0.01em; text-decoration: none; white-space: nowrap;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.btn:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn.lg { min-height: 50px; padding: 12px 26px; font-size: 16px; }

/* ---------- testata ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--heading); text-decoration: none;
  font-weight: 700; font-size: 19px; letter-spacing: -0.02em; flex-shrink: 0; }
.brand:hover { color: var(--heading); }
.site-nav { flex: 1; }
.site-nav ul, .mobile-panel ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a, .mobile-panel ul a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
}
.site-nav a:hover, .mobile-panel ul a:hover { background: var(--surface-2); color: var(--heading); }
.site-nav a[aria-current='page'], .mobile-panel ul a[aria-current='page'] { background: var(--accent-soft); color: var(--accent-ink); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.lang { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.lang:hover { background: var(--surface-2); color: var(--heading); }
.lang-short { display: none; }
.signup-soon { color: var(--text-muted); font-weight: 600; font-size: 14px; white-space: nowrap; cursor: default; }
.signup-soon small { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  background: var(--surface-2); color: var(--ink-gray); }

.mobile-menu { display: none; margin-left: auto; }
.mobile-menu summary { list-style: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 999px; cursor: pointer; color: var(--heading); }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary:hover, .mobile-menu[open] summary { background: var(--surface-2); }
.mobile-panel { position: absolute; left: 12px; right: 12px; top: 64px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px; box-shadow: var(--shadow-float); }
.mobile-panel ul { flex-direction: column; }
.mobile-panel ul a { width: 100%; min-height: 48px; }
.mobile-actions { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }
.mobile-actions .btn { width: 100%; min-height: 48px; }
.mobile-actions .signup-soon { text-align: center; padding: 6px; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 88px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center; }
.eyebrow { display: inline-block; margin: 0 0 20px; padding: 4px 14px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.hero h1 { font-size: clamp(38px, 5.4vw, 68px); letter-spacing: -0.035em; line-height: 1.04; margin-bottom: 24px; }
.lead { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: var(--text); max-width: 640px; }
.lead-sm { font-size: 18px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 12px; }
.fine { color: var(--text-muted); font-size: 14px; }

.board { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 20px; }
.board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-weight: 700; color: var(--heading); font-size: 15px; }
.board-head .chip { margin-left: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip.ok { background: var(--tint-sage); color: var(--ink-sage); }
.chip.ok::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--dot-sage); }
.board-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.frame { margin: 0; }
.frame svg { width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: 14px; }
.frame figcaption { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }

/* ---------- sezioni ---------- */
.section { padding: 88px 0; }
.section.tight { padding: 32px 0 88px; }
.section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head p { color: var(--text-muted); font-size: 18px; }

.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: flow; }
.flow-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 20px; }
.flow-step p { color: var(--text-muted); font-size: 15px; margin: 0; }
.flow-num { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; margin-bottom: 16px; flex-shrink: 0; }
.badge { display: inline-block; vertical-align: middle; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  font-weight: 600; letter-spacing: 0; background: var(--tint-sky); color: var(--ink-sky); }

.cards { display: grid; gap: 16px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.section.alt .card { background: var(--bg); }
.card p { color: var(--text-muted); margin: 0; }
.card-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks .icon { color: var(--accent); flex-shrink: 0; margin-top: 3px; }
.checks.small { gap: 10px; font-size: 15px; }
.checks.small .icon { margin-top: 2px; }

.closing { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 56px 48px; text-align: center; }
.closing h2 { max-width: 720px; margin-left: auto; margin-right: auto; }
.closing p { color: var(--text-muted); font-size: 18px; max-width: 620px; margin: 0 auto 28px; }

/* ---------- pagine interne ---------- */
.page-hero { padding: 72px 0 24px; }
.page-hero .lead { max-width: 680px; }
.page-hero h1 { font-size: clamp(36px, 4.6vw, 56px); letter-spacing: -0.03em; }
.steps-detail { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps-detail > li { display: flex; gap: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.steps-detail h2 { font-size: 22px; margin-bottom: 8px; }
.steps-detail p { color: var(--text-muted); }
.faq { display: grid; gap: 10px; margin-top: 24px; }
.faq details { background: var(--bg); border: 1px solid var(--border); border-radius: 18px; padding: 4px 20px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--heading); padding: 14px 32px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 400; color: var(--accent); }
.faq details[open] summary::after { content: '\2212'; }
.faq details[open] summary { color: var(--accent-ink); }
.faq details p { color: var(--text-muted); }

.notice, .draft { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; border-radius: 18px; padding: 16px 20px; margin-bottom: 24px; border: 1px solid; }
.notice { background: var(--tint-sky); border-color: transparent; color: var(--ink-sky); }
.draft { background: var(--tint-amber); border-color: transparent; color: var(--ink-amber); }
.included { margin-top: 32px; }
.contact-card { display: flex; gap: 20px; align-items: flex-start; }
.contact-card .card-icon { margin: 0; flex-shrink: 0; }
.email { font-size: 20px; font-weight: 600; }
.placeholder { background: var(--tint-amber); color: var(--ink-amber); border-radius: 6px; padding: 1px 6px; font-weight: 600; }

.prose h2 { font-size: 22px; margin-top: 40px; }
.prose p { color: var(--text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); margin: 24px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-muted); font-weight: 600; font-size: 13px; }
tr:last-child td { border-bottom: none; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.film { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.film video, .film img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.film-body { padding: 20px; }
.film-body h2 { font-size: 20px; margin-bottom: 6px; }
.film-body p { color: var(--text-muted); margin-bottom: 8px; }
.film-body time { font-size: 13px; color: var(--text-muted); }

/* ---------- piede ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 56px 0 24px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-brand p { color: var(--text-muted); max-width: 380px; margin-top: 14px; font-size: 15px; }
.site-footer h2 { font-size: 14px; letter-spacing: 0; color: var(--text-muted); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-footer ul a { display: inline-block; padding: 4px 0; color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.site-footer ul a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 14px; }
.footer-bottom .lang { padding-left: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .flow { grid-template-columns: repeat(3, 1fr); }
  .signup-soon { display: none; }
}
@media (max-width: 900px) {
  .site-nav, .header-actions { display: none; }
  .mobile-menu { display: block; }
  .mobile-panel .signup-soon { display: block; }
  .hero { padding: 48px 0 64px; }
  .hero-grid, .split { grid-template-columns: 1fr; gap: 40px; }
  .cards.three { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr 1fr; }
  .section { padding: 64px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .header-row { min-height: 64px; }
  .flow { grid-template-columns: 1fr; }
  .flow-step { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; padding: 20px; }
  .flow-step .flow-num { margin: 0; grid-row: span 2; }
  .cta-row .btn { width: 100%; }
  .board { padding: 14px; border-radius: var(--radius-lg); }
  .board-grid { gap: 8px; }
  .closing { padding: 40px 20px; }
  .steps-detail > li { flex-direction: column; gap: 8px; padding: 22px; }
  .card { padding: 22px; }
  .page-hero { padding: 48px 0 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
