/* ==========================================================================
   Tipografia Digitale — Digital Press Console
   Distinctive visual system: dark console UI with CMYK production accents
   ========================================================================== */

:root {
  /* CMYK-derived palette */
  --cyan: #00b3d6;
  --magenta: #e6007e;
  --yellow: #ffd400;
  --key: #14161c;

  --ink-900: #0c0e13;
  --ink-800: #11141b;
  --ink-700: #171b24;
  --ink-600: #1f2430;
  --ink-500: #2b3140;
  --line: #2c3342;
  --line-soft: #232a37;

  --paper: #f3f0e9;
  --paper-soft: #e8e3d7;

  --text: #e9edf4;
  --text-dim: #aeb6c6;
  --text-faint: #7b8499;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --maxw: 1200px;
  --gutter: clamp(18px, 4vw, 48px);

  --grad-cmyk: linear-gradient(115deg, var(--cyan), var(--magenta) 45%, var(--yellow));
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);

  --mono: "SFMono-Regular", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { line-height: 1.1; margin: 0; font-weight: 700; letter-spacing: -0.02em; }

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

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--grad-cmyk);
}

.section { padding-block: clamp(64px, 9vw, 120px); position: relative; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-top: 16px; }
.section-head p { color: var(--text-dim); margin-top: 16px; font-size: 1.05rem; }

/* ---------- Scroll progress ---------- */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad-cmyk);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ---------- Command-style nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 14, 19, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}
.brand .dots { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.brand .dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.brand .dots i:nth-child(1) { background: var(--cyan); }
.brand .dots i:nth-child(2) { background: var(--magenta); }
.brand .dots i:nth-child(3) { background: var(--yellow); }
.brand .dots i:nth-child(4) { background: var(--paper); }

.cmd {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
}
.cmd .k {
  font-size: 0.68rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text-faint);
  background: var(--ink-900);
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover { background: var(--ink-700); color: var(--text); }
.nav-cta {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-900) !important;
  transition: transform 0.2s;
}
.nav-cta:hover { transform: translateY(-1px); }

/* ---------- Command palette overlay ---------- */
.palette-backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 7, 10, 0.72);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.palette-backdrop.open { display: flex; }
.palette {
  width: min(560px, 92vw);
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.palette input {
  width: 100%;
  border: 0;
  background: var(--ink-700);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  outline: none;
}
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 320px; overflow-y: auto; }
.palette li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.palette li a:hover, .palette li a:focus { background: var(--ink-600); color: var(--text); }
.palette li a span.tag { font-family: var(--mono); font-size: 0.7rem; color: var(--text-faint); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 24px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--paper); color: var(--ink-900); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--cyan); }

/* ---------- Animated gradient border (shared) ---------- */
.gborder { position: relative; border-radius: var(--radius); background: var(--ink-800); }
.gborder::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-cmyk);
  background-size: 220% 220%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: borderflow 6s linear infinite;
  opacity: 0.55;
  pointer-events: none;
}
@keyframes borderflow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==========================================================================
   HERO — Press console
   ========================================================================== */
.hero { position: relative; padding-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(56px, 8vw, 96px); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 4rem);
  margin-top: 20px;
  letter-spacing: -0.035em;
}
.hero h1 .grad {
  background: var(--grad-cmyk);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead { color: var(--text-dim); font-size: 1.12rem; margin-top: 22px; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-meta {
  display: flex;
  gap: 28px;
  margin-top: 36px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}
.hero-meta b { display: block; color: var(--text); font-size: 1.05rem; font-family: var(--sans); }

/* Press console panel */
.console {
  position: relative;
  padding: 18px;
  background: var(--ink-800);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.console-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line-soft);
}
.console-bar .led { width: 9px; height: 9px; border-radius: 50%; }
.console-bar .led.c { background: var(--cyan); }
.console-bar .led.m { background: var(--magenta); }
.console-bar .led.y { background: var(--yellow); }
.console-bar .status { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; }
.console-bar .status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #44e0a0; box-shadow: 0 0 8px #44e0a0;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.console-figure { position: relative; margin: 14px 0; border-radius: var(--radius); overflow: hidden; }
.console-figure img { width: 100%; height: 240px; object-fit: cover; }
.console-figure .scan {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,179,214,0.12) 50%, transparent 100%);
  background-size: 100% 200%;
  animation: scan 4s linear infinite;
  pointer-events: none;
}
@keyframes scan { 0% { background-position: 0 -100%; } 100% { background-position: 0 100%; } }

/* CMYK production cards */
.cmyk-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.cmyk-card {
  background: var(--ink-700);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
}
.cmyk-card .chan {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
}
.cmyk-card.c .chan { color: var(--cyan); }
.cmyk-card.m .chan { color: var(--magenta); }
.cmyk-card.y .chan { color: var(--yellow); }
.cmyk-card.k .chan { color: var(--paper); }
.cmyk-card .bar { height: 5px; border-radius: 3px; background: var(--ink-500); margin: 9px 0 7px; overflow: hidden; }
.cmyk-card .bar span { display: block; height: 100%; border-radius: 3px; }
.cmyk-card.c .bar span { background: var(--cyan); width: 72%; }
.cmyk-card.m .bar span { background: var(--magenta); width: 58%; }
.cmyk-card.y .bar span { background: var(--yellow); width: 64%; }
.cmyk-card.k .bar span { background: var(--paper); width: 88%; }
.cmyk-card small { font-family: var(--mono); font-size: 0.64rem; color: var(--text-faint); }

/* ==========================================================================
   SIGNATURE — CMYK digital press console (bento dashboard)
   ========================================================================== */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(150px, auto);
  gap: 16px;
}
.bento .cell {
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.bento .cell h3 { font-size: 1.1rem; margin-bottom: 8px; }
.bento .cell p { color: var(--text-dim); font-size: 0.9rem; margin: 0; }
.cell-wide { grid-column: span 2; }
.cell-tall { grid-row: span 2; }
.cell-figure { padding: 0; }
.cell-figure img { width: 100%; height: 100%; object-fit: cover; min-height: 180px; }
.cell .metric { font-family: var(--mono); font-size: 2rem; font-weight: 700; background: var(--grad-cmyk); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cell .label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); }

/* gauge meter */
.gauge { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.gauge-row { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 12px; font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim); }
.gauge-row .track { height: 6px; background: var(--ink-600); border-radius: 4px; overflow: hidden; }
.gauge-row .track i { display: block; height: 100%; border-radius: 4px; }

/* ==========================================================================
   FORMAT GRID
   ========================================================================== */
.format-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.format-card {
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.25s, border-color 0.25s;
}
.format-card:hover { transform: translateY(-4px); border-color: var(--line); }
.format-card .ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-family: var(--mono); font-weight: 700;
  background: var(--ink-600);
  color: var(--cyan);
  margin-bottom: 16px;
}
.format-card h3 { font-size: 1.15rem; }
.format-card p { color: var(--text-dim); font-size: 0.9rem; margin-top: 10px; }
.format-card .spec { margin-top: 14px; font-family: var(--mono); font-size: 0.72rem; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 6px; }
.format-card .spec span { border: 1px solid var(--line-soft); border-radius: 6px; padding: 2px 8px; }

/* ==========================================================================
   PAPER / FINISH — tabs (primary interaction)
   ========================================================================== */
.finish { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(28px, 4vw, 52px); align-items: start; }
.segmented {
  display: inline-flex;
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px;
  gap: 4px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.segmented button {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.segmented button[aria-selected="true"] { background: var(--paper); color: var(--ink-900); }
.segmented button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.finish-panel { display: none; }
.finish-panel.active { display: block; animation: fadein 0.4s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.finish-panel h3 { font-size: 1.5rem; margin-bottom: 12px; }
.finish-panel p { color: var(--text-dim); }
.finish-panel ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.finish-panel li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.92rem; color: var(--text-dim); }
.finish-panel li::before { content: ""; width: 7px; height: 7px; margin-top: 8px; border-radius: 2px; background: var(--grad-cmyk); flex-shrink: 0; }

.finish-figure { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.finish-figure img { width: 100%; height: 380px; object-fit: cover; }

/* ==========================================================================
   WORKFLOW RAIL
   ========================================================================== */
.rail { position: relative; display: grid; gap: 0; }
.rail-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line-soft);
}
.rail-step:last-child { border-bottom: 0; }
.rail-num {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--ink-700);
  border: 1px solid var(--line);
  color: var(--cyan);
}
.rail-step h3 { font-size: 1.25rem; }
.rail-step p { color: var(--text-dim); margin-top: 8px; max-width: 60ch; }
.rail-figure { margin-top: 14px; border-radius: var(--radius); overflow: hidden; }
.rail-figure img { width: 100%; height: 200px; object-fit: cover; }

/* ==========================================================================
   FAQ accordion
   ========================================================================== */
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq-item {
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-item button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 20px 22px;
  cursor: pointer;
}
.faq-item button:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.faq-item .icon { font-family: var(--mono); color: var(--cyan); transition: transform 0.3s; flex-shrink: 0; }
.faq-item[open] .icon, .faq-item.open .icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.faq-answer p { padding: 0 22px 22px; margin: 0; color: var(--text-dim); }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 52px); align-items: start; }
.contact-figure { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.contact-figure img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; }

.form-card { padding: clamp(24px, 3vw, 36px); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%;
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 12px 14px;
  transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--cyan); }
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.78rem; color: var(--text-faint); margin-top: 8px; }
.form-status { font-family: var(--mono); font-size: 0.82rem; margin-top: 14px; min-height: 1.2em; color: var(--cyan); }

.contact-details { margin-top: 26px; display: grid; gap: 16px; }
.detail { display: flex; gap: 14px; align-items: flex-start; }
.detail .dk { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); width: 92px; flex-shrink: 0; padding-top: 2px; }
.detail .dv { color: var(--text); font-size: 0.95rem; }
.detail .dv a:hover { color: var(--cyan); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { border-top: 1px solid var(--line-soft); padding-block: 56px 36px; background: var(--ink-900); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer h4 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 16px; }
.footer p { color: var(--text-dim); font-size: 0.9rem; margin: 6px 0; }
.footer a { color: var(--text-dim); font-size: 0.9rem; display: block; padding: 4px 0; }
.footer a:hover { color: var(--text); }
.footer-legal {
  margin-top: 40px; padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.74rem; color: var(--text-faint);
}
.footer-fiscal { font-family: var(--mono); font-size: 0.74rem; color: var(--text-faint); margin-top: 14px; line-height: 1.9; }

/* Legal page styling */
.legal { padding-block: clamp(48px, 7vw, 90px); }
.legal-doc { max-width: 820px; }
.legal-doc h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 12px; }
.legal-doc .updated { font-family: var(--mono); font-size: 0.78rem; color: var(--text-faint); margin-bottom: 36px; }
.legal-doc h2 { font-size: 1.3rem; margin: 36px 0 12px; }
.legal-doc h3 { font-size: 1.05rem; margin: 24px 0 8px; }
.legal-doc p, .legal-doc li { color: var(--text-dim); font-size: 0.96rem; }
.legal-doc ul { padding-left: 20px; }
.legal-doc li { margin: 6px 0; }
.legal-doc a { color: var(--cyan); }
.legal-fiscal { background: var(--ink-800); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 22px; margin: 28px 0; font-family: var(--mono); font-size: 0.84rem; line-height: 2; }

/* ==========================================================================
   Reveal-on-scroll (progressive enhancement; visible by default)
   ========================================================================== */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .finish { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .cell-wide { grid-column: span 2; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 620px) {
  .cmyk-cards { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .cell-wide { grid-column: span 1; }
  .footer-grid { grid-template-columns: 1fr; }
  .cmd { display: none; }
  .hero-meta { gap: 18px; }
}
