/* ============================================================
   main.css — Updated coherent palette with softer light/dark modes
   ============================================================ */

/* ── 1. Design Tokens ─────────────────────────────────────── */
:root {
  /* ── Refreshed Light Palette (slate-based, low fatigue) ──
     Backgrounds are very light grey (not pure white)
     Text uses a softer near-black
     Borders are subtle, surfaces slightly deeper
  */
  --bg-color:          #F8FAFC;   /* soft off-white slate */
  --surface-color:     #F1F5F9;   /* subtle card/panel background */
  --border-color:      #E2E8F0;   /* muted borders */
  --text-color:        #0F172A;   /* slate-900, easier than #111827 */
  --text-muted:        #475569;   /* slate-600 for secondary text */

  /* Orange — action / accent (unchanged) */
  --accent-color:      #FF7800;
  --accent-hover:      #D96300;

  /* Cyan/Blue — brand / links
     Light mode uses darker cyan for AA contrast on new bg (#F8FAFC) */
  --brand-color:       #0088AA;   /* passes AA (4.8:1 on #F8FAFC) */
  --brand-hover:       #006688;
  --brand-bright:      #00D0FF;   /* full logo colour – use on dark bg only */

  --link-color:        var(--brand-color);
  --link-hover:        var(--brand-hover);

  /* Dark panel — harmonised deep slate */
  --panel-dark:        #1A355B;   /* slate-900 for footer/sidebar */

  /* Typography & spacing remain unchanged */
  --font-display:  Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --font-body:     Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --font-mono:     'Courier New', Courier, monospace;

  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.375rem;
  --text-2xl:   1.75rem;
  --text-3xl:   2.25rem;
  --text-4xl:   3rem;
  --text-5xl:   4rem;

  --leading-tight:  1.2;
  --leading-snug:   1.4;
  --leading-normal: 1.65;

  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.5rem;
  --space-6:  2rem;
  --space-8:  3rem;
  --space-10: 4rem;
  --space-12: 6rem;

  --container-max: 1160px;
  --container-pad: clamp(1.25rem, 5vw, 2.5rem);
  --navbar-height: 4rem;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 12px;

  /* Softer shadows for less harshness */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --duration:    200ms;
  --duration-md: 350ms;
}

/* ── 2. Dark Mode – Softer & Less Contrasty ───────────────── */
[data-theme='dark'] {
  /* Dark background lifted from near-black to medium-dark slate
     Text is light but not pure white – reduces eye strain */
  --bg-color:      #1E293B;   /* slate-800, much lighter than #0D1117 */
  --surface-color: #334155;   /* slate-700 for cards/panels */
  --border-color:  #475569;   /* slate-600 for visible but calm separation */
  --text-color:    #E2E8F0;   /* slate-200, soft off-white */
  --text-muted:    #94A3B8;   /* slate-400 for less important text */

  /* Orange stays vivid – contrast on #1E293B is ~6:1 (fine) */
  --accent-color:  #FF7800;
  --accent-hover:  #FF9933;

  /* Cyan can use full brightness in dark mode */
  --brand-color:   #00D0FF;
  --brand-hover:   #33DAFF;
  --brand-bright:  #00D0FF;

  --link-color:    var(--brand-color);
  --link-hover:    var(--brand-hover);

  /* Dark panel – slightly darker than main bg for depth */
  --panel-dark:    #0C1E3A;   /* slate-900 */

  /* Shadows more pronounced but appropriate for dark mode */
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:     0 8px 24px rgba(0,0,0,0.5);
}

/* ── 2. Dark Mode Overrides ───────────────────────────────── */
[data-theme='dark'] {
  --bg-color:      #161b22;
  --surface-color: #161B22;
  --border-color:  #30363D;
  --text-color:    #DEDEDE;
  --text-muted:    #8B949E;

  /* Orange stays vivid on dark — no contrast issue */
  --accent-color:  #FF7800;
  --accent-hover:  #FF9933;

  /* Cyan can use its full logo brightness on dark bg */
  --brand-color:   #00D0FF;
  --brand-hover:   #33DAFF;
  --brand-bright:  #00D0FF;

  --link-color:    var(--brand-color);
  --link-hover:    var(--brand-hover);

  /* Dark panel slightly lighter than bg in dark mode for visible separation */
  --panel-dark:    #0C1E3A;

  --shadow-sm:     0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:     0 12px 40px rgba(0,0,0,0.6);
}

/* ── 3. Box Model Reset ───────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── 4. Root / HTML / Body ────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  transition: background-color var(--duration-md) var(--ease-out),
              color            var(--duration-md) var(--ease-out);
}

body {
  background-color: var(--bg-color);
  color:            var(--text-color);
  font-family:      var(--font-body);
  font-size:        var(--text-base);
  font-weight:      400;
  line-height:      var(--leading-normal);
  min-height:       100dvh;
  display:          flex;
  flex-direction:   column;
}

/* ── 5. Typography Baseline ───────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color:       var(--text-color);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl);  }
h5 { font-size: var(--text-lg);  }
h6 { font-size: var(--text-base);}

p {
  max-width: 68ch;
  margin-bottom: var(--space-4);
}
p:last-child { margin-bottom: 0; }

a {
  color:               var(--link-color);
  text-decoration:     underline;
  text-underline-offset: 3px;
  transition: color var(--duration) var(--ease-out);
}
a:hover { color: var(--link-hover); }

strong, b { font-weight: 500; }
em, i     { font-style: italic; }
small     { font-size: var(--text-sm); }

code, kbd, samp {
  font-family:   var(--font-mono);
  font-size:     0.875em;
  background:    var(--surface-color);
  padding:       0.1em 0.35em;
  border-radius: var(--radius-sm);
}

pre {
  font-family:   var(--font-mono);
  font-size:     var(--text-sm);
  background:    var(--surface-color);
  border:        1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding:       var(--space-5);
  overflow-x:    auto;
  margin-bottom: var(--space-5);
}
pre code { background: none; padding: 0; }

/* ── 6. Lists ─────────────────────────────────────────────── */
ul, ol {
  padding-left:  var(--space-5);
  margin-bottom: var(--space-4);
}
li + li { margin-top: var(--space-2); }

/* ── 7. Media ─────────────────────────────────────────────── */
img, video, svg { display: block; max-width: 100%; height: auto; }
figure          { margin: 0; }
figcaption      { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-2); }

/* ── 8. Form Primitives ───────────────────────────────────── */
button, input, select, textarea { font-family: var(--font-body); font-size: var(--text-base); }
button { cursor: pointer; border: none; background: transparent; }

/* ── 9. Divider ───────────────────────────────────────────── */
hr {
  border:     none;
  border-top: 1px solid var(--border-color);
  margin:     var(--space-8) 0;
}

/* ── 10. Layout Utilities ─────────────────────────────────── */
.container {
  width:     100%;
  max-width: var(--container-max);
  margin:    0 auto;
  padding:   0 var(--container-pad);
}

.site-main {
  flex:           1;
  padding-top:    calc(var(--navbar-height) + var(--space-10));
  padding-bottom: var(--space-12);
}

/* ── 11. Navbar ───────────────────────────────────────────── */
.navbar {
  position:         fixed;
  top: 0; left: 0; right: 0;
  height:           var(--navbar-height);
  z-index:          100;
  background:       var(--bg-color);
  border-bottom:    1px solid var(--border-color);
  backdrop-filter:  blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color var(--duration-md) var(--ease-out),
              border-color      var(--duration-md) var(--ease-out);
}

.navbar__inner {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  height:          100%;
}

.navbar__brand {
  display:         flex;
  align-items:     center;
  gap:             var(--space-3);
  font-family:     var(--font-display);
  font-size:       var(--text-xl);
  color:           var(--text-color);
  text-decoration: none;
  letter-spacing:  -0.01em;
  font-weight:     700;
  transition:      color var(--duration) var(--ease-out);
}
.navbar__brand:hover { color: var(--brand-color); }

.navbar__logo {
  display:    block;
  width:      2rem;      /* 32px — matches width/height attrs */
  height:     2rem;
  flex-shrink: 0;
  /* Prevent SVG from inheriting text colour transition on hover */
  transition: opacity var(--duration) var(--ease-out);
}
.navbar__brand:hover .navbar__logo { opacity: 0.85; }

.navbar__brand-name {
  /* Inherits font/colour from .navbar__brand */
  line-height: 1;
}

.navbar__right {
  display:     flex;
  align-items: center;
  gap:         var(--space-5);
}

.navbar__nav {
  display:     flex;
  align-items: center;
  gap:         var(--space-4);
  list-style:  none;
  padding:     0;
  margin:      0;
}

/* Each li is a flex container so the <a> aligns by flex rules,
   not by inline baseline — prevents the active link from sitting
   at a different height than its siblings */
.navbar__nav li {
  display:     flex;
  align-items: center;
  margin-top:  0;   /* cancel global li + li { margin-top } */
}

.navbar__nav a {
  position:        relative;  /* anchor for ::after underline */
  font-size:       var(--text-sm);
  font-weight:     500;
  letter-spacing:  0.03em;
  text-transform:  uppercase;
  color:           var(--text-muted);
  text-decoration: none;
  /* Consistent padding — never changes between states */
  padding:         0.25em 0;
  transition:      color var(--duration) var(--ease-out);
}

/* Underline drawn as ::after — lives outside normal flow,
   never adds height, never shifts siblings */
.navbar__nav a::after {
  content:          '';
  position:         absolute;
  bottom:           -2px;
  left:             0;
  right:            0;
  height:           2px;
  background:       var(--brand-color);
  border-radius:    1px;
  transform:        scaleX(0);
  transform-origin: left center;
  transition:       transform var(--duration) var(--ease-out);
}

.navbar__nav a:hover,
.navbar__nav a.active {
  color: var(--brand-color);
}

.navbar__nav a:hover::after,
.navbar__nav a.active::after {
  transform: scaleX(1);
}

/* Theme toggle */
.theme-toggle {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           2.25rem;
  height:          2.25rem;
  border-radius:   50%;
  background:      var(--surface-color);
  border:          1px solid var(--border-color);
  color:           var(--text-color);
  cursor:          pointer;
  transition: background     var(--duration) var(--ease-out),
              border-color   var(--duration) var(--ease-out),
              transform      var(--duration) var(--ease-out);
}
.theme-toggle:hover { background: var(--border-color); transform: rotate(15deg); }

.theme-toggle svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }

/* Icon visibility controlled by theme */
.theme-toggle .icon-moon { display: none;  }
.theme-toggle .icon-sun  { display: block; }
[data-theme='dark'] .theme-toggle .icon-moon { display: block; }
[data-theme='dark'] .theme-toggle .icon-sun  { display: none;  }

/* ── 12. Footer ───────────────────────────────────────────── */
.site-footer {
  background:  var(--surface-color);
  border-top:  1px solid var(--border-color);
  padding:     var(--space-6) 0;
  transition: background-color var(--duration-md) var(--ease-out),
              border-color      var(--duration-md) var(--ease-out);
}

.site-footer__inner {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             var(--space-3);
}

.site-footer__copy {
  font-size: var(--text-sm);
  color:     var(--text-muted);
}

.site-footer__legal {
  font-size:  var(--text-xs);
  color:      var(--text-muted);
  text-align: right;
}

.site-footer__legal a {
  color:               var(--text-muted);
  text-decoration:     underline;
  text-underline-offset: 2px;
}
.site-footer__legal a:hover { color: var(--text-color); }

/* ── 13. Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
}

/* ── 13. Mobile hamburger + sidebar ──────────────────────── */

/* Hide desktop nav on mobile */
@media (max-width: 768px) {
  .navbar__desktop-nav { display: none; }
}

/* Hide hamburger on desktop */
.navbar__hamburger { display: none; }

@media (max-width: 768px) {
  .navbar__hamburger {
    display:         flex;
    flex-direction:  column;
    justify-content: center;
    gap:             5px;
    width:           2.25rem;
    height:          2.25rem;
    padding:         0.35rem;
    background:      transparent;
    border:          none;
    cursor:          pointer;
    border-radius:   var(--radius-md);
    transition:      background var(--duration) var(--ease-out);
  }
  .navbar__hamburger:hover {
    background: var(--surface-color);
  }
}

.navbar__hamburger-bar {
  display:       block;
  width:         100%;
  height:        2px;
  background:    var(--text-color);
  border-radius: 2px;
  transition:    background var(--duration) var(--ease-out);
}

/* ── Backdrop ── */
.nav-backdrop {
  display:    none;
  position:   fixed;
  inset:      0;
  z-index:    200;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity:    0;
  transition: opacity var(--duration-md) var(--ease-out);
}
.nav-backdrop.is-visible {
  display: block;
  opacity: 1;
}

/* ── Sidebar drawer ── */
.nav-sidebar {
  position:   fixed;
  top:        0;
  right:      0;
  bottom:     0;
  z-index:    300;
  width:      min(280px, 80vw);
  background: var(--bg-color);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display:    flex;
  flex-direction: column;
  padding:    var(--space-5);
  /* Start off-screen to the right */
  transform:  translateX(100%);
  transition: transform var(--duration-md) var(--ease-out);
}
.nav-sidebar.is-open {
  transform: translateX(0);
}

/* Close button */
.nav-sidebar__close {
  align-self:      flex-end;
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           2.25rem;
  height:          2.25rem;
  border-radius:   var(--radius-md);
  background:      transparent;
  border:          none;
  color:           var(--text-color);
  cursor:          pointer;
  margin-bottom:   var(--space-5);
  transition:      background var(--duration) var(--ease-out);
}
.nav-sidebar__close:hover { background: var(--surface-color); }
.nav-sidebar__close svg   { width: 1.25rem; height: 1.25rem; display: block; }

/* Sidebar nav list */
.nav-sidebar__nav {
  list-style: none;
  padding:    0;
  margin:     0;
  display:    flex;
  flex-direction: column;
  gap:        var(--space-1);
}

.nav-sidebar__nav li { margin-top: 0; } /* cancel global li+li rule */

.nav-sidebar__link {
  display:         block;
  padding:         0.75em var(--space-4);
  border-radius:   var(--radius-md);
  font-size:       var(--text-base);
  font-weight:     500;
  letter-spacing:  0.03em;
  text-transform:  uppercase;
  color:           var(--text-muted);
  text-decoration: none;
  transition:      background var(--duration) var(--ease-out),
                   color      var(--duration) var(--ease-out);
}
.nav-sidebar__link:hover {
  background: var(--surface-color);
  color:      var(--text-color);
}
.nav-sidebar__link.active {
  background: color-mix(in srgb, var(--brand-color) 10%, transparent);
  color:      var(--brand-color);
  font-weight: 700;
}

/* ── 14. Focus Visible ────────────────────────────────────── */
:focus-visible {
  outline:        2px solid var(--accent-color);
  outline-offset: 3px;
  border-radius:  var(--radius-sm);
}

/* ── 15. Page Header (contact & inner pages) ──────────────── */
/*
 * How the offset works:
 *   - Section layouts set .site-main { padding-top: 0 } in head-extra
 *     so .page-header can sit flush against the top of the viewport.
 *   - .page-header itself adds padding-top equal to navbar height +
 *     breathing room so the text clears the fixed bar.
 *   - No negative margin-top needed — simpler and more robust.
 *   - z-index kept below navbar (100) so it scrolls under it cleanly.
 */
.page-header {
  position:       relative;
  z-index:        10;
  background:     var(--panel-dark);
  padding-top:    calc(var(--navbar-height) + var(--space-10));
  padding-bottom: var(--space-10);
  text-align:     center;
}
.page-header__inner {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            var(--space-3);
}
.page-header__heading {
  font-family:   var(--font-display);
  font-size:     clamp(1.75rem, 4vw, var(--text-4xl));
  font-weight:   700;
  color:         #ffffff;
  margin:        0;
  max-width:     22ch;
}
.page-header__heading::after {
  content:       '';
  display:       block;
  width:         3.5rem;
  height:        3px;
  background:    var(--accent-color);
  margin:        var(--space-3) auto 0;
  border-radius: 2px;
}
.page-header__sub {
  font-size:   var(--text-lg);
  color:       rgba(255, 255, 255, 0.75);
  max-width:   54ch;
  margin:      0;
  line-height: var(--leading-snug);
}

/* Date line inside page-header — shown on blog posts */
.page-header__date {
  display:     flex;
  align-items: center;
  gap:         var(--space-2);
  font-size:   var(--text-sm);
  color:       rgba(255, 255, 255, 0.60);
  margin:      0;
}
.page-header__date svg {
  width:       1rem;
  height:      1rem;
  flex-shrink: 0;
}

/* Category badge inside page-header */
.page-header__badge {
  display:       inline-block;
  padding:       0.25em 0.9em;
  border-radius: var(--radius-lg);
  font-size:     var(--text-xs);
  font-weight:   700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.page-header__badge--tutorial { background: #E0F7FF; color: #006688; }
.page-header__badge--showcase { background: #FFF3E0; color: #D96300; }
.page-header__badge--news     { background: #F0F4FF; color: #1E40AF; }

/* ── 16. Contact Page Layout ──────────────────────────────── */
.contact-body {
  background: var(--surface-color);
  padding:    var(--space-10) 0 var(--space-12);
}

/* Two-column grid: form left, sidebar right */
.contact-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   var(--space-6);
  align-items:           start;
}
@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ── 17. Contact Form Card ────────────────────────────────── */
.cform-card {
  background:    var(--bg-color);
  border:        1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding:       var(--space-6);
  box-shadow:    var(--shadow-sm);
}
.cform-card__heading {
  font-family:   var(--font-display);
  font-size:     var(--text-2xl);
  font-weight:   400;
  margin-bottom: var(--space-4);
}

/* Form groups */
.cform__group   { margin-bottom: var(--space-4); }
.cform__label   {
  display:       block;
  font-size:     var(--text-sm);
  font-weight:   500;
  margin-bottom: var(--space-2);
  color:         var(--text-color);
}
.cform__required { color: var(--accent-color); }

/* Shared control base */
.cform__control {
  width:         100%;
  background:    var(--bg-color);
  color:         var(--text-color);
  border:        1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding:       0.65em 0.9em;
  font-family:   var(--font-body);
  font-size:     var(--text-base);
  line-height:   var(--leading-normal);
  outline:       none;
  appearance:    none;
  -webkit-appearance: none;
  transition:    border-color var(--duration) var(--ease-out),
                 box-shadow   var(--duration) var(--ease-out);
}
.cform__control::placeholder { color: var(--text-muted); }
.cform__control:focus {
  border-color: var(--accent-color);
  box-shadow:   0 0 0 3px color-mix(in srgb, var(--accent-color) 15%, transparent);
}

/* Textarea */
.cform__textarea { resize: vertical; min-height: 160px; }

/* Select with custom chevron */
.cform__select-wrap { position: relative; }
.cform__select      { padding-right: 2.5rem; cursor: pointer; }
.cform__chevron {
  position:       absolute;
  right:          0.75rem;
  top:            50%;
  transform:      translateY(-50%);
  pointer-events: none;
  color:          var(--text-muted);
}
.cform__chevron svg { width: 1rem; height: 1rem; display: block; }

/* File dropzone */
.cform__dropzone {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             var(--space-3);
  width:           100%;
  padding:         0.85em 1em;
  border:          2px dashed var(--border-color);
  border-radius:   var(--radius-md);
  color:           var(--text-muted);
  font-size:       var(--text-sm);
  cursor:          pointer;
  transition:      border-color var(--duration) var(--ease-out),
                   color        var(--duration) var(--ease-out);
}
.cform__dropzone:hover    { border-color: var(--accent-color); color: var(--accent-color); }
.cform__dropzone-icon     { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.cform__file-input        { display: none; }

/* Submit button */
.cform__submit {
  display:       block;
  width:         100%;
  padding:       0.8em 1em;
  margin-top:    var(--space-5);
  background:    var(--accent-color);
  color:         #ffffff;
  font-family:   var(--font-body);
  font-size:     var(--text-base);
  font-weight:   500;
  border:        none;
  border-radius: var(--radius-md);
  cursor:        pointer;
  transition:    background var(--duration) var(--ease-out),
                 transform  var(--duration) var(--ease-out);
}
.cform__submit:hover  { background: var(--accent-hover); transform: translateY(-1px); }
.cform__submit:active { transform: none; }

/* ── Privacy / GDPR checkbox ─────────────────────────────── */
.cform__group--privacy {
  margin-bottom: var(--space-4);
}

/* Outer label wraps checkbox + text so the whole row is clickable */
.cform__privacy-label {
  display:     flex;
  align-items: flex-start;
  gap:         var(--space-3);
  cursor:      pointer;
}

/* The checkbox itself */
.cform__checkbox {
  /* Remove browser default, draw our own */
  appearance:    none;
  -webkit-appearance: none;
  flex-shrink:   0;
  width:         1.125rem;
  height:        1.125rem;
  margin-top:    0.15em;   /* optical alignment with first line of text */
  border:        2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background:    var(--bg-color);
  cursor:        pointer;
  transition:    border-color var(--duration) var(--ease-out),
                 background   var(--duration) var(--ease-out);
  /* Checkmark via background-image — no extra elements needed */
  background-position: center;
  background-repeat:   no-repeat;
  background-size:     0.7rem;
}

/* Hover */
.cform__checkbox:hover {
  border-color: var(--accent-color);
}

/* Checked state — orange fill with white checkmark SVG */
.cform__checkbox:checked {
  background-color: var(--accent-color);
  border-color:     var(--accent-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6l3 3 5-5'/%3E%3C/svg%3E");
}

/* Focus ring — keyboard accessibility */
.cform__checkbox:focus-visible {
  outline:        2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Invalid / submitted-without-check highlight */
.cform__checkbox:required:invalid {
  border-color: #DC2626;
}

/* Text beside the checkbox */
.cform__privacy-text {
  font-size:   var(--text-sm);
  color:       var(--text-muted);
  line-height: var(--leading-snug);
}

/* The Privacy Policy link inside the label */
.cform__privacy-link {
  color:               var(--brand-color);
  text-decoration:     underline;
  text-underline-offset: 2px;
  font-weight:         500;
}
.cform__privacy-link:hover {
  color: var(--brand-hover);
}

/* ── 18. Contact Sidebar ──────────────────────────────────── */
.csidebar {
  display:        flex;
  flex-direction: column;
  gap:            var(--space-5);
}

/* Card base */
.csidebar__card {
  border-radius: var(--radius-lg);
  padding:       var(--space-7, 2.25rem);
  box-shadow:    var(--shadow-sm);
}
.csidebar__card--light {
  background: var(--bg-color);
  border:     1px solid var(--border-color);
}
.csidebar__card--dark { background: var(--panel-dark); }

.csidebar__heading {
  font-family:   var(--font-display);
  font-size:     var(--text-xl);
  font-weight:   400;
  margin-bottom: var(--space-5);
  color:         var(--text-color);
}
.csidebar__heading--on-dark { color: #ffffff; }

/* Numbered guidelines */
.cguidelines {
  list-style:     none;
  padding:        0;
  margin:         0;
  display:        flex;
  flex-direction: column;
  gap:            var(--space-4);
}
.cguidelines__item {
  display:     flex;
  gap:         var(--space-4);
  align-items: flex-start;
}
.cguidelines__num {
  flex-shrink:     0;
  width:           1.75rem;
  height:          1.75rem;
  border-radius:   50%;
  background:      var(--accent-color);
  color:           #ffffff;
  font-size:       var(--text-sm);
  font-weight:     500;
  display:         flex;
  align-items:     center;
  justify-content: center;
  margin-top:      0.1em;
}
.cguidelines__text {
  font-size:   var(--text-sm);
  color:       var(--text-color);
  line-height: var(--leading-normal);
  margin:      0;
  max-width:   none;
}
.cguidelines__text strong { font-weight: 500; }

/* Optional .Content prose beneath guidelines */
.csidebar__content {
  margin-top: var(--space-5);
  font-size:  var(--text-sm);
  color:      var(--text-muted);
}

/* Direct contacts list */
.cdirect {
  list-style:     none;
  padding:        0;
  margin:         0;
  display:        flex;
  flex-direction: column;
  gap:            var(--space-5);
}
.cdirect__item {
  display:     flex;
  gap:         var(--space-4);
  align-items: flex-start;
}
.cdirect__icon-wrap {
  flex-shrink:     0;
  width:           2rem;
  height:          2rem;
  border-radius:   var(--radius-md);
  background:      rgba(196, 80, 26, 0.18);
  color:           var(--accent-color);
  display:         flex;
  align-items:     center;
  justify-content: center;
  margin-top:      0.1em;
}
.cdirect__icon-wrap svg { width: 1rem; height: 1rem; }
.cdirect__body {
  display:        flex;
  flex-direction: column;
  gap:            var(--space-1);
}
.cdirect__label {
  font-size:   var(--text-sm);
  font-weight: 500;
  color:       #ffffff;
}
.cdirect__value {
  font-size:       var(--text-sm);
  color:           rgba(255, 255, 255, 0.70);
  text-decoration: none;
  line-height:     var(--leading-snug);
}
a.cdirect__value:hover { color: #ffffff; }

/* ── 19. Services page ────────────────────────────────────── */

/* Outer section — light background, generous vertical rhythm */
.services-list {
  background:     var(--bg-color);
  padding-top:    var(--space-10);
  padding-bottom: var(--space-12);
}

.services-list__empty {
  text-align: center;
  color:      var(--text-muted);
  padding:    var(--space-10) 0;
}

/* ── Service row ── */
.svc-row {
  display:         flex;
  flex-direction:  row;          /* default: text LEFT, image RIGHT */
  align-items:     center;
  gap:             var(--space-10);
  padding:         var(--space-10) 0;
  border-bottom:   1px solid var(--border-color);
}
.svc-row:last-child { border-bottom: none; }

/* Flip: image LEFT, text RIGHT */
.svc-row--flip { flex-direction: row-reverse; }

/* Each column takes equal width */
.svc-row__text,
.svc-row__media {
  flex:     1 1 0;
  min-width: 0;
}

/* ── Text column ── */
.svc-row__title {
  font-family:   var(--font-display);
  font-size:     clamp(1.5rem, 3vw, var(--text-3xl));
  font-weight:   400;
  margin-bottom: var(--space-4);
}
/* Accent rule under the title */
.svc-row__title::after {
  content:       '';
  display:       block;
  width:         3rem;
  height:        3px;
  background:    var(--accent-color);
  margin-top:    var(--space-3);
  border-radius: 2px;
}

.svc-row__body {
  font-size:     var(--text-base);
  color:         var(--text-color);
  line-height:   var(--leading-normal);
  margin-bottom: var(--space-5);
  max-width:     54ch;
}

.svc-row__cta {
  display:         inline-block;
  font-size:       var(--text-sm);
  font-weight:     500;
  color:           var(--accent-color);
  text-decoration: none;
  border-bottom:   1px solid transparent;
  padding-bottom:  1px;
  transition:      border-color var(--duration) var(--ease-out),
                   color        var(--duration) var(--ease-out);
}
.svc-row__cta:hover {
  color:        var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ── Services bottom CTA band ─────────────────────────────── */
.services-cta {
  background:  var(--panel-dark);
  padding:     var(--space-12) 0;
  text-align:  center;
}
.services-cta__inner {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            var(--space-5);
}
.services-cta__heading {
  font-family: var(--font-display);
  font-size:   clamp(1.75rem, 3.5vw, var(--text-3xl));
  font-weight: 400;
  color:       #ffffff;
  margin:      0;
}
.services-cta__sub {
  font-size:   var(--text-base);
  color:       rgba(255, 255, 255, 0.70);
  max-width:   54ch;
  line-height: var(--leading-snug);
  margin:      0;
}
.services-cta__btn {
  display:         inline-block;
  padding:         0.75em 2em;
  background:      var(--accent-color);
  color:           #ffffff;
  font-size:       var(--text-base);
  font-weight:     500;
  text-decoration: none;
  border-radius:   var(--radius-md);
  transition:      background var(--duration) var(--ease-out),
                   transform  var(--duration) var(--ease-out);
}
.services-cta__btn:hover {
  background: var(--accent-hover);
  color:      #ffffff;
  transform:  translateY(-2px);
}
.services-cta__btn:active { transform: none; }

/* ── Image column ── */
.svc-row__img {
  width:         100%;
  height:        auto;
  aspect-ratio:  3 / 2;
  object-fit:    cover;
  border-radius: var(--radius-lg);
  display:       block;
  /* Subtle lift */
  box-shadow:    var(--shadow-md);
}

/* ── Responsive — stack vertically on mobile ── */
@media (max-width: 768px) {
  .svc-row,
  .svc-row--flip {
    flex-direction: column;   /* always stack: text on top, image below */
    gap:            var(--space-6);
  }
  .svc-row__body  { max-width: none; }
  .svc-row__media { width: 100%; }
}

/* ── 21. 404 Error Page ───────────────────────────────────── */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh; /* Centers content vertically in the viewport */
  text-align: center;
  padding: var(--space-10) 0;
}

.error-page__code {
  font-size: clamp(5rem, 15vw, 10rem);
  line-height: 1;
  color: var(--brand-bright); /* Cyan brand color on white/dark bg */
  margin-bottom: var(--space-2);
  opacity: 0.4;
}

.error-page__title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
  color: var(--text-color);
}

.error-page__text {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 40ch;
  margin: 0 auto var(--space-8);
}

.error-page__btn {
  display: inline-block;
  padding: 0.8em 2em;
  background: var(--accent-color); /* Orange CTA */
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: background var(--duration) var(--ease-out), 
              transform var(--duration) var(--ease-out);
}

.error-page__btn:hover {
  background: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-2px);
}

/* ── 22. Legal Page Styling ───────────────────────────────── */

.legal-body {
  padding: var(--space-10) 0 var(--space-12);
  background-color: var(--bg-color); /* Ensures proper contrast in light/dark mode */
}

.legal-content {
  max-width: 70ch; /* Optimal line length for Arial readability */
  margin: 0 auto;  /* Centers the text column */
  line-height: var(--leading-normal);
}

/* Typography refinements within legal text */
.legal-content h2, 
.legal-content h3 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  color: var(--text-color);
}

.legal-content p {
  margin-bottom: var(--space-5);
}

.legal-content ul {
  margin-bottom: var(--space-6);
  padding-left: var(--space-5);
}

.legal-content li {
  margin-bottom: var(--space-2);
}

/* Fix for the raw template tag showing in your screenshot */
.legal-content strong {
  font-weight: 700;
}

/* ── 23. About Section (Chi Siamo) ────────────────────────── */
.about {
  padding: var(--space-12) 0;
}

.about-split {
  display:               grid;
  grid-template-columns: 3fr 2fr;
  gap:                   var(--space-10);
  align-items:           center;
}

.about-split__text {
  display:        flex;
  flex-direction: column;
  align-items:    flex-start;
  gap:            var(--space-4);
}

.about-badge {
  padding:        0.3em 0.9em;
  background:     var(--accent-color);
  color:          #ffffff;
  font-size:      var(--text-xs);
  font-weight:    700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius:  var(--radius-sm);
}

.about-split__heading {
  font-family: var(--font-display);
  font-size:   clamp(2rem, 3.5vw, var(--text-4xl));
  font-weight: 700;
  line-height: var(--leading-tight);
  margin:      0;
  text-align:  left;
}

.about-split__sub {
  font-size:    var(--text-lg);
  font-style:   italic;
  color:        var(--text-muted);
  line-height:  var(--leading-snug);
  margin:       0;
  max-width:    52ch;
  border-left:  3px solid var(--accent-color);
  padding-left: var(--space-4);
  text-align:   left;
}

.about-split__body {
  font-size:   var(--text-base);
  color:       var(--text-color);
  line-height: var(--leading-normal);
  margin:      0;
  max-width:   58ch;
  text-align:  left;
}

/* 2x2 Grid for Image Cards */
.about-split__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--space-3);
  position: relative;
  aspect-ratio: 1; /* Make the container square */
  width: 100%;
}

.about-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
}

.about-card__inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background-color: var(--panel-dark);
}

.about-card__img {
  width:      100%;
  height:     100%;
  object-fit: cover;
  display:    block;
}

.about-card__label {
  position:    absolute;
  bottom:      0;
  left:        0;
  right:       0;
  padding:     var(--space-2) var(--space-3);
  background:  linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 100%);
  color:       #ffffff;
  font-size:   var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .about-split {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .about-split__body,
  .about-split__sub { max-width: none; }
  .about-split__cards {
    max-width: 400px;
    margin: 0 auto;
  }
}



/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  box-sizing:          border-box;
  width:               100%;
  position:            relative;
  background-color:    var(--panel-dark);
  min-height:          100vh;
  margin-top:          0;
  padding-top:         calc(var(--navbar-height) + var(--space-8));
  padding-bottom:      var(--space-8);
  display:             grid;
  grid-template-columns: 1.1fr 1fr;
  align-items:         stretch;
  gap:                 var(--space-8);
  padding-left:        clamp(2rem, 8vw, 10rem);
  padding-right:       var(--space-8);
}

.hero__container {
  display:         flex;
  flex-direction:  column;
  justify-content: center;
  position:        relative;
  z-index:         2;
}

.hero__content {
  text-align:    left;
  padding-right: 15%;
}

.hero__heading {
  font-family:   var(--font-display);
  font-size:     clamp(3rem, 6vw, 4.5rem);
  font-weight:   700;
  color:         #ffffff;
  margin-bottom: var(--space-5);
  line-height:   var(--leading-tight);
}

.hero__subheading {
  font-size:     var(--text-xl);
  color:         rgba(255, 255, 255, 0.85);
  margin-bottom: var(--space-8);
  line-height:   var(--leading-snug);
  max-width:     90%;
}

.hero__asterisk {
  color: var(--brand-bright);
}

.hero__actions {
  display:         flex;
  align-items:     center;
  justify-content: flex-start;
  gap:             var(--space-4);
  flex-wrap:       wrap;
}

/* Shared button base */
.hero__btn {
  display:         inline-block;
  padding:         0.7em 1.75em;
  font-size:       var(--text-base);
  font-weight:     500;
  border-radius:   var(--radius-md);
  text-decoration: none;
  transition:      background  var(--duration) var(--ease-out),
                   color       var(--duration) var(--ease-out),
                   transform   var(--duration) var(--ease-out),
                   box-shadow  var(--duration) var(--ease-out);
}
.hero__btn:hover { transform: translateY(-2px); }

/* Primary — solid accent fill */
.hero__btn--primary {
  background:  var(--accent-color);
  color:       #ffffff;
}
.hero__btn--primary:hover {
  background:  var(--accent-hover);
  color:       #ffffff;
  box-shadow:  0 6px 20px rgba(0,0,0,0.25);
}

/* Secondary — transparent with white border */
.hero__btn--secondary {
  background:  transparent;
  color:       #ffffff;
  border:      2px solid rgba(255, 255, 255, 0.75);
}
.hero__btn--secondary:hover {
  background:  rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
  color:        #ffffff;
}

.hero__image-wrapper {
  position: relative;
  width:    100%;
  /* Grid align-items: stretch takes care of height perfectly */
  z-index:  1;
}

.hero__image {
  width:      100%;
  height:     100%;
  object-fit: cover;
  border-radius: 2rem; /* Big rounded corners */
  box-shadow: 0 20px 40px rgba(0,0,0,0.3); /* Premium shadow */
}

@media (max-width: 992px) {
  .hero {
    grid-template-columns: 1fr;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
  .hero__content {
    text-align: center;
    padding-right: 0;
  }
  .hero__subheading {
    margin-left: auto;
    margin-right: auto;
  }
  .hero__actions {
    justify-content: center;
  }
  .hero__image-wrapper {
    height: 400px;
    min-height: auto;
    margin-top: var(--space-8);
  }
}

@media (max-width: 640px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__btn     { text-align: center; }
  .hero__image-wrapper { height: 300px; }
  .hero__image { border-radius: 1.5rem; }
}