/* =========================================================
   PLATO — Global Styles
   ========================================================= */

/* ---------- CSS Variables (Design System) ---------- */

/* Light theme as default */
:root{
  /* Theme */
  --bg: #f6f3ea;
  --text: rgba(20,22,26,.95);
  --muted: rgba(20,22,26,.80);
  --muted-soft: rgba(20,22,26,.65);

  /* Surfaces */
  --panel: rgba(20,22,26,.06);
  --panel-strong: rgba(20,22,26,.08);
  --stroke: rgba(20,22,26,.12);

  /* Accent */
  --accent: #8a6a2b;
  --accent-strong: #6f531f;
  --accent-soft: rgba(138,106,43,.20);

  /* Shadows */
  --shadow-md: 0 12px 35px rgba(0,0,0,.12);
  --shadow-lg: 0 18px 55px rgba(0,0,0,.25);

  /* Radius */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;

  /* Layout */
  --max-width: 1280px;

  /* Fonts */
  --font-sans: ui-sans-serif, system-ui, -apple-system,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: ui-serif, "Iowan Old Style",
                "Palatino Linotype", Palatino, Georgia, serif;
}

/* Dark theme override - softer dark, not black */
:root[data-theme="dark"]{
  --bg: #1a1f26;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.72);
  --muted-soft: rgba(255,255,255,.55);

  --panel: rgba(255,255,255,.06);
  --panel-strong: rgba(255,255,255,.08);
  --stroke: rgba(255,255,255,.10);

  --accent: #d8c18a;
  --accent-strong: #b99a59;
  --accent-soft: rgba(216,193,138,.18);

  --shadow-md: 0 12px 35px rgba(0,0,0,.22);
  --shadow-lg: 0 18px 55px rgba(0,0,0,.45);
}

/* ---------- Reset & Base ---------- */

*,
*::before,
*::after{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  height: 100%;
}

/* Bigger baseline typography - increased for better readability */
html{ font-size: 19px; }

body{
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  background: var(--bg);
}

/* ---------- Background: gradients + geometric overlay ---------- */
/* We use only ::before for gradients+grid to avoid conflicts */
/* Light theme background (default) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(138,106,43,.10), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(138,106,43,.08), transparent 55%),
    radial-gradient(800px 600px at 40% 120%, rgba(138,106,43,.06), transparent 55%),
    url("/assets/images/geo-grid.svg"),
    linear-gradient(180deg, rgba(255,255,255,.70), rgba(246,243,234,1));
  background-size: auto, auto, auto, cover, auto;
  background-position: 0 0, 0 0, 0 0, center, 0 0;
  opacity: 1;
}

/* Dark theme: softer dark background */
:root[data-theme="dark"] body::before{
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(216,193,138,.18), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(185,154,89,.14), transparent 55%),
    radial-gradient(800px 600px at 40% 120%, rgba(216,193,138,.10), transparent 55%),
    url("/assets/images/geo-grid.svg"),
    linear-gradient(180deg, rgba(26,31,38,.20), rgba(26,31,38,.88));
}

/* Optional poster image layer (se vuoi usare la tua immagine “Plato”) */
body.has-bg::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -3;
  background-image: url("/assets/images/plato-bg.jpg");
  background-size: cover;
  background-position: center;
  opacity: .10;           /* prova 0.08–0.14 */
  filter: blur(2px) saturate(.9);
  transform: scale(1.03);
}

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

/* ---------- Layout ---------- */

.wrap{
  width: min(var(--max-width), calc(100% - 64px));
  margin: 0 auto;
}

@media (max-width: 720px){
  .wrap{ width: calc(100% - 32px); }
}

section{ padding: 56px 0; }

/* ---------- Typography ---------- */

h1, h2, h3{
  font-family: var(--font-serif);
  letter-spacing: -0.3px;
  margin: 0;
}

h1{
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1.05;
}

h2{
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.2;
}

h3{
  font-size: 1.05rem;
  line-height: 1.25;
}

p{
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- Buttons ---------- */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--stroke);

  background: linear-gradient(180deg, rgba(216,193,138,.18), rgba(216,193,138,.08));
  color: var(--text);
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;

  box-shadow: var(--shadow-md);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.btn:hover{
  transform: translateY(-1px);
  border-color: var(--accent-soft);
}

.btn.secondary{
  background: var(--panel);
  box-shadow: none;
}

/* ---------- Header / Navigation ---------- */

header{
  position: sticky;
  top: 0;
  z-index: 50;

  backdrop-filter: blur(14px);
  background: rgba(246,243,234,.65);
  border-bottom: 1px solid rgba(20,22,26,.08);
}

:root[data-theme="dark"] header{
  background: rgba(26,31,38,.55);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong{ font-family: var(--font-serif); }

.mark{
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);

  display: grid;
  place-items: center;

  font-family: var(--font-serif);
  font-weight: 700;

  background:
    radial-gradient(12px 12px at 30% 30%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(180deg, rgba(216,193,138,.26), rgba(216,193,138,.06));

  border: 1px solid var(--accent-soft);
  box-shadow: var(--shadow-md);
}

/* ---------- Hero ---------- */

.hero{ padding-top: 78px; }

/* ---------- Cards ---------- */

.card{
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-md);
}

.card p{ font-size: .95rem; }

/* ---------- Grids ---------- */

.grid-3{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ---------- Quote / Dialogue ---------- */

.quote{
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-soft);
  background: linear-gradient(180deg, var(--accent-soft), var(--panel));
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.quote p{
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text);
}

/* ---------- Footer ---------- */

footer{
  padding: 48px 0;
  border-top: 1px solid rgba(20,22,26,.08);
  color: var(--muted-soft);
  font-size: 13px;
}

:root[data-theme="dark"] footer{
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px){
  .grid-3{ grid-template-columns: 1fr; }
}
