/* ==========================================================================
   G2 Ingegneria — Colors & Type foundations
   ==========================================================================
   Brand DNA: precise, engineered, calm, trustworthy. Teal + red + white.
   Typography: geometric sans for wordmark feel; humanist sans for UI.
   Italian-first copy. No emoji.
   ========================================================================== */

/* ---------- Webfonts ---------- */
/* Display / wordmark: Century Gothic — font ufficiale del brand, caricato
   localmente da /fonts (regular + bold).
   UI: Inter Tight — sans humanist neutro, regge bene piccoli corpi e tabelle.
   Mono: JetBrains Mono — per letture numeriche tecniche negli applicativi
   (valori di misura, codici, ID dei rapporti). */
@font-face {
  font-family: 'Century Gothic';
  src: url('../fonts/CenturyGothic-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Century Gothic';
  src: url('../fonts/CenturyGothic-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ==========================================================================
     COLORS — primitive palette
     ========================================================================== */

  /* Teal scale — extracted from the brand (#014455), built as an 11-step scale */
  --teal-50:  #E6EEF1;
  --teal-100: #C2D3DA;
  --teal-200: #9AB5BF;
  --teal-300: #6E93A1;
  --teal-400: #427586;
  --teal-500: #155A6E;   /* interactive teal */
  --teal-600: #014455;   /* BRAND TEAL — primary */
  --teal-700: #013847;
  --teal-800: #012C38;
  --teal-900: #00202A;
  --teal-950: #00141B;

  /* Red scale — extracted from the brand (#D40000) */
  --red-50:  #FBE6E6;
  --red-100: #F4B8B8;
  --red-200: #EC8686;
  --red-300: #E25151;
  --red-400: #DB2929;
  --red-500: #D40000;   /* BRAND RED — signature accent */
  --red-600: #B80000;
  --red-700: #990000;
  --red-800: #7A0000;
  --red-900: #5A0000;

  /* Neutrals — warm-cool balanced, paired with teal */
  --white:    #FFFFFF;
  --paper:    #F7F8F9;   /* page bg, cards on teal */
  --mist:     #EDEFF2;   /* surface 2 */
  --haze:     #DFE3E7;   /* borders on paper */
  --steel-100: #C9CFD4;
  --steel-200: #A6AFB6;
  --steel-300: #7F8A92;
  --steel-400: #5E6A73;
  --steel-500: #434F58;
  --steel-600: #2D3740;
  --steel-700: #1E272F;
  --steel-800: #131A20;
  --black:    #050A0E;

  /* Semantic — built from scales */
  --success: #1F7A4D;
  --success-bg: #E3F2EA;
  --warning: #C67A00;
  --warning-bg: #FBF1DD;
  --danger: var(--red-500);
  --danger-bg: var(--red-50);
  --info: var(--teal-500);
  --info-bg: var(--teal-50);

  /* ==========================================================================
     SEMANTIC ROLES — use these in components, not the primitives above
     ========================================================================== */

  --brand:         var(--teal-600);
  --brand-ink:     var(--white);     /* text/glyphs sitting on --brand */
  --brand-accent:  var(--red-500);   /* the red dot */
  --brand-muted:   var(--teal-50);   /* tinted surfaces */

  --bg:            var(--paper);
  --bg-elevated:   var(--white);
  --bg-sunken:     var(--mist);
  --bg-inverse:    var(--teal-600);

  --fg:            var(--steel-700);   /* primary text on light */
  --fg-muted:      var(--steel-500);
  --fg-subtle:     var(--steel-400);
  --fg-inverse:    var(--white);       /* text on teal */
  --fg-inverse-muted: #B7C7CD;

  --border:        var(--haze);
  --border-strong: var(--steel-200);
  --border-inverse: rgba(255,255,255,0.18);

  --focus-ring:    var(--red-500);     /* red is the focus color — on-brand */

  /* ==========================================================================
     TYPOGRAPHY — families
     ========================================================================== */

  --font-sans:     'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display:  'Century Gothic', 'Questrial', 'Inter Tight', sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Type scale — tuned for professional dashboards, not marketing */
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-30: 30px;
  --fs-38: 38px;
  --fs-48: 48px;
  --fs-60: 60px;
  --fs-80: 80px;

  --lh-tight:  1.1;
  --lh-snug:   1.25;
  --lh-normal: 1.5;
  --lh-loose:  1.7;

  /* ==========================================================================
     SPACING — 4px base grid
     ========================================================================== */
  --sp-0: 0;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;

  /* ==========================================================================
     RADII — conservative. The brand is architectural; avoid soft/bubbly.
     ========================================================================== */
  --r-0: 0px;
  --r-1: 2px;
  --r-2: 4px;     /* default for inputs, buttons */
  --r-3: 6px;
  --r-4: 8px;     /* cards */
  --r-5: 12px;
  --r-pill: 999px;

  /* ==========================================================================
     SHADOWS — restrained. Engineering tools should feel precise, not floaty.
     ========================================================================== */
  --shadow-0: none;
  --shadow-1: 0 1px 2px rgba(1, 68, 85, 0.06), 0 0 0 1px rgba(1, 68, 85, 0.04);
  --shadow-2: 0 2px 6px rgba(1, 68, 85, 0.08), 0 1px 2px rgba(1, 68, 85, 0.06);
  --shadow-3: 0 8px 20px rgba(1, 68, 85, 0.10), 0 2px 6px rgba(1, 68, 85, 0.06);
  --shadow-4: 0 20px 40px rgba(1, 68, 85, 0.16), 0 4px 10px rgba(1, 68, 85, 0.08);
  --shadow-focus: 0 0 0 3px rgba(212, 0, 0, 0.25);
  --shadow-inset-border: inset 0 0 0 1px var(--border);

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1.05);
  --dur-fast: 120ms;
  --dur-med:  200ms;
  --dur-slow: 320ms;
}

/* ==========================================================================
   SEMANTIC TYPE — drop these classnames onto elements, or use as @apply-style
   references when building components.
   ========================================================================== */

html, body {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.t-wordmark { /* for 'ingegneria'-style wordmarks, section labels */
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.t-display {
  font-family: var(--font-display);
  font-size: var(--fs-60);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  color: var(--fg);
}

.t-h1 {
  font-family: var(--font-sans);
  font-size: var(--fs-38);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
  color: var(--fg);
}

.t-h2 {
  font-family: var(--font-sans);
  font-size: var(--fs-30);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
  color: var(--fg);
}

.t-h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-24);
  font-weight: 600;
  line-height: var(--lh-snug);
  color: var(--fg);
}

.t-h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-20);
  font-weight: 600;
  line-height: var(--lh-snug);
  color: var(--fg);
}

.t-body {
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  color: var(--fg);
}

.t-body-sm {
  font-size: var(--fs-14);
  line-height: var(--lh-normal);
  color: var(--fg);
}

.t-muted {
  color: var(--fg-muted);
}

.t-caption {
  font-size: var(--fs-13);
  line-height: var(--lh-snug);
  color: var(--fg-muted);
}

.t-eyebrow { /* small caps label above a section title — on-brand */
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-accent);
}

.t-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.t-data { /* numeric readouts — R_c, MPa, kN — in the pro apps */
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--fg);
}

.t-code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 1px 6px;
  color: var(--steel-700);
}

/* Links default — understated, underline-on-hover, teal */
a {
  color: var(--teal-600);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-standard);
}
a:hover { border-bottom-color: currentColor; }
a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--r-1);
}

/* Selection — brand red */
::selection { background: var(--red-500); color: var(--white); }

/* Scrollbar on dark surfaces */
.on-brand ::-webkit-scrollbar { width: 10px; height: 10px; }
.on-brand ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: var(--r-pill); }
