/* ============================================================
   SHARED — lucadalessandro.org
   Variables, dark mode, nav, footer, buttons, toggle
============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── TOKENS ── */
:root {
  --cyan:     #00BEF0;
  --cyan-mid: #0098C4;
  --cyan-pale:#DCF8FF;
  --yellow:   #FAE802;
  --yel-dark: #B0A200;
  --yel-pale: #FFFDE0;
  --magenta:  #D44060;
  --mag-mid:  #B83050;
  --mag-pale: #FFECF0;
  --ink:      #111111;
  --ink-soft: #3C3C3C;
  --ink-muted:#888888;
  --white:    #FFFFFF;
  --off:      #F8F8F8;
  --line:     rgba(17,17,17,0.08);
  --serif: 'Gloock', Georgia, serif;
  --sans:  'Raleway', sans-serif;
  --r: 10px;
}

/* ── DARK MODE ── */
html.dark {
  --cyan-pale: #002A3D;
  --yel-pale:  #1E1A00;
  --mag-pale:  #2A001A;
  --ink:       #F0F0F0;
  --ink-soft:  #C0C0C0;
  --ink-muted: #777777;
  --white:     #0E0E0E;
  --off:       #181818;
  --line:      rgba(255,255,255,0.08);
}
html.dark nav           { background: #111111; border-color: rgba(255,255,255,0.07); }
html.dark footer        { background: #000000; }
html.dark .c-card       { background: #181818; border-color: rgba(0,190,240,0.12); }
html.dark .pill         { background: #222; border-color: rgba(255,255,255,0.08); color: var(--ink-soft); }
html.dark .pill strong  { color: var(--ink); }
html.dark .numbers      { background: #0E0E0E; }
html.dark .num-block    { border-color: rgba(255,255,255,0.07); }
html.dark .courses      { border-color: rgba(0,190,240,0.08); }
html.dark .t-q, html.dark .t-name { color: var(--ink); }
html.dark .img-tag-m    { background: var(--magenta); color: #fff; }
html.dark .hero         { background: #0E0E0E; }
html.dark .hero-r       { background: #181818; }
html.dark .page-hero    { background: #111111; }
html.dark .about-img    { box-shadow: 0 8px 40px rgba(0,0,0,0.4); }
html.dark .nav-cta      { background: #111111; color: #FFFFFF; border: 1px solid rgba(255,255,255,0.15); box-shadow: none; }
html.dark .nav-cta:hover { background: #222222; filter: none; }
html.dark .nav-l        { color: rgba(255,255,255,0.55); }
html.dark .btn-plain    { border-color: rgba(255,255,255,0.18); color: var(--ink-soft); }
html.dark .btn-plain:hover { border-color: var(--cyan); }
html.dark .flinks a     { color: rgba(255,255,255,0.35); }
html.dark .fcopy        { color: rgba(255,255,255,0.2); }
html.dark .btn-y        { color: #111111 !important; }
html.dark .cc-head.cc-y .cc-title,
html.dark .cc-head.cc-y .cc-num  { color: #111111; }
html.dark .cta-card.cc-y .cta-card-title { color: #111111; }
html.dark .cta-card.cc-y .cta-card-label { color: rgba(0,0,0,0.6); }
html.dark .cta-card.cc-y .cta-card-desc  { color: rgba(0,0,0,0.65); }
html.dark .card-grid-item { background: #181818; border-color: rgba(255,255,255,0.07); }
html.dark .section-alt  { background: #141414; }

/* ── BASE ── */
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--white); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; transition: background 0.3s, color 0.3s; }

/* ── TOGGLE ── */
#theme-toggle {
  position: fixed; top: 50%; right: 20px; transform: translateY(-50%);
  z-index: 200; width: 42px; height: 80px;
  background: var(--off); border: 1px solid var(--line); border-radius: 100px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center;
  justify-content: space-around; padding: 8px 0;
  transition: background 0.2s, border-color 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
#theme-toggle:hover { border-color: var(--cyan); }
.toggle-sun, .toggle-moon {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-size: 14px;
}
.toggle-sun  { background: var(--yellow); }
.toggle-moon { background: transparent; border: 1.5px solid var(--ink-muted); }
html.dark .toggle-sun  { background: transparent; border: 1.5px solid rgba(255,255,255,0.2); }
html.dark .toggle-moon { background: #3A3A5A; border-color: transparent; }
.toggle-track { width: 2px; height: 16px; background: var(--line); border-radius: 2px; }

/* ── NAV ── */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--white); border-bottom: 1px solid var(--line); }
.nav-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; height: 68px; }
.logo { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.logo-icon { height: 38px; width: auto; flex-shrink: 0; display: block; }
.logo-text { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a { font-size: .82rem; font-weight: 400; color: var(--ink-muted); text-decoration: none; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--cyan); }
.nav-r { display: flex; align-items: center; gap: 1rem; }
.nav-l { font-size: .82rem; font-weight: 500; color: var(--ink-soft); text-decoration: none; }
.nav-cta { font-size: .82rem; font-weight: 600; color: var(--ink); background: var(--yellow); padding: .55rem 1.2rem; border-radius: var(--r); text-decoration: none; box-shadow: 0 2px 8px rgba(255,230,0,.4); transition: filter .2s; }
.nav-cta:hover { filter: brightness(1.06); }

/* ── PENROSE LOGO SVG ── */
.logo-icon path { stroke-width: 5; stroke-linecap: round; fill: none; }

/* ── FOOTER ── */
footer { background: var(--ink); padding: 2.5rem 2rem; }
.fi { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; }
.fl { display: flex; align-items: center; gap: .7rem; }
.fl-name { font-family: var(--serif); font-size: 1rem; color: white; }
.flinks { display: flex; gap: 2rem; list-style: none; }
.flinks a { font-size: .78rem; color: rgba(255,255,255,.3); text-decoration: none; transition: color .2s; }
.flinks a:hover { color: rgba(255,255,255,.7); }
.fcopy { font-size: .75rem; color: rgba(255,255,255,.2); }

/* ── BUTTONS ── */
.btn-cyan-main { font-size: .88rem; font-weight: 600; color: white; background: var(--cyan); padding: .85rem 1.8rem; border-radius: var(--r); text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; box-shadow: 0 4px 16px rgba(0,0,0,.15); transition: background .2s; }
.btn-cyan-main:hover { background: var(--cyan-mid); }
.btn-mag-solid { font-size: .88rem; font-weight: 600; color: white; background: var(--magenta); padding: .8rem 1.8rem; border-radius: var(--r); text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; box-shadow: 0 4px 16px rgba(212,64,96,.25); transition: background .2s; }
.btn-mag-solid:hover { background: var(--mag-mid); }
.btn-plain { font-size: .85rem; font-weight: 500; color: var(--ink-soft); padding: .85rem 1.4rem; border-radius: var(--r); border: 1.5px solid var(--line); text-decoration: none; transition: border-color .2s; }
.btn-plain:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-c { font-size: .78rem; font-weight: 600; color: white; background: var(--cyan); padding: .42rem .95rem; border-radius: 6px; text-decoration: none; }
.btn-m { font-size: .78rem; font-weight: 600; color: white; background: var(--magenta); padding: .42rem .95rem; border-radius: 6px; text-decoration: none; }
.btn-y { font-size: .78rem; font-weight: 700; color: var(--ink); background: var(--yellow); padding: .42rem .95rem; border-radius: 6px; text-decoration: none; }

/* ── PAGE HERO (header di pagina interna) ── */
.page-hero {
  padding: 8rem 2rem 5rem;
  background: var(--off);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.page-hero-eyebrow {
  font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cyan); display: block; margin-bottom: 1rem;
}
.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400; line-height: 1.1; letter-spacing: -.02em;
  color: var(--ink); margin-bottom: 1rem;
}
.page-hero h1 em { font-style: italic; }
.page-hero p {
  font-size: 1rem; font-weight: 300; line-height: 1.8;
  color: var(--ink-soft); max-width: 560px; margin: 0 auto;
}
.tricolor-divider {
  display: flex; width: 3rem; height: 4px; margin: 1.5rem auto 0; border-radius: 2px; overflow: hidden;
}
.tricolor-divider div { flex: 1; }

/* ── SEZIONE LABEL ── */
.ae { display: flex; align-items: center; gap: .5rem; font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); margin-bottom: 1.5rem; }
.ae::before { content: ''; display: block; width: 1.5rem; height: 2px; background: var(--cyan); }

/* ── SECTION COMUNE ── */
.section-wrap { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ── TRICOLOR BAR ── */
.tricolor-bar { display: flex; align-items: center; gap: 0; width: fit-content; border-radius: 4px; overflow: hidden; }
.tb-c { width: 12px; height: 4px; background: var(--cyan); }
.tb-m { width: 12px; height: 4px; background: var(--magenta); }
.tb-y { width: 12px; height: 4px; background: var(--yellow); }

/* ── HAMBURGER ── */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: .5rem; z-index: 200; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .3s, opacity .3s; border-radius: 2px; }
html.dark .hamburger span { background: var(--ink); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { display: none; position: fixed; top: 68px; left: 0; right: 0; bottom: 0; background: var(--white); z-index: 99; padding: 2rem; flex-direction: column; gap: 0; overflow-y: auto; }
html.dark .mobile-menu { background: var(--white); }
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: 1.1rem; font-weight: 400; color: var(--ink); text-decoration: none; padding: 1rem 0; border-bottom: 1px solid var(--line); display: block; }
.mobile-menu a:hover { color: var(--cyan); }
.mobile-menu .mobile-cta { margin-top: 1.5rem; font-size: .95rem; font-weight: 600; color: var(--ink); background: var(--yellow); padding: .8rem 1.5rem; border-radius: var(--r); text-align: center; box-shadow: 0 2px 8px rgba(255,230,0,.4); border-bottom: none; }

/* ── RESPONSIVE NAV ── */
@media (max-width: 900px) {
  .nav-links, .nav-l { display: none; }
  .hamburger { display: block; }
  #theme-toggle { right: 12px; }
}
