/* Laboratorio delle Idee — archivio software storico
   Brand palette + Rubik, per linee guida ufficiali. */

:root {
  /* Palette ufficiale */
  --labidee-primary: #00E5A9;        /* verde primario (poco leggibile su bianco: usare con parsimonia) */
  --labidee-navy: #004060;           /* blu istituzionale */
  --labidee-dark: #002D3E;           /* sfondi scuri */
  --labidee-light-blue: #008EC5;     /* accento secondario */
  --labidee-sea: #2CAF81;            /* verde mare */
  --labidee-training: #fcd800;       /* Formazione */
  --labidee-consulting: #00b0e4;     /* Consulenza */
  --labidee-project-design: #ff2440; /* Progettualità */
  --labidee-research: #a163d1;       /* Ricerca & Sviluppo */
  --labidee-work-services: #f18c00;  /* Servizi al Lavoro */

  --ink: #0d1f28;
  --muted: #5b7280;
  --bg: #f4f7f9;
  --card: #ffffff;
  --line: #e2e9ee;

  --radius: 14px;
  --maxw: 1080px;
  --shadow: 0 6px 24px rgba(0, 64, 96, 0.10);

  --accent: var(--labidee-navy); /* sovrascritto per-titolo via inline style */
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Rubik", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 700; line-height: 1.2; color: var(--labidee-navy); margin: 0 0 .4em; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--labidee-light-blue); }

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

/* Header */
.site-header {
  background: var(--labidee-navy);
  color: #fff;
  border-bottom: 4px solid var(--labidee-primary);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: #fff; }
.brand .name { font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; }
.brand .claim { font-weight: 400; font-size: .82rem; color: #bfe9dd; }
.site-nav a { color: #fff; text-decoration: none; font-weight: 500; margin-left: 18px; opacity: .9; }
.site-nav a:hover { opacity: 1; text-decoration: underline; }

/* Hero */
.hero { background: linear-gradient(160deg, var(--labidee-dark), var(--labidee-navy)); color: #fff; padding: 48px 0 40px; }
.hero h1 { color: #fff; }
.hero p { color: #cfe3ec; max-width: 60ch; margin-bottom: 0; }

/* Card grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; padding: 36px 0 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,64,96,.16); }
.card .cover {
  height: 120px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: flex-end;
  padding: 14px 16px;
  position: relative;
}
.card .cover .year { position: absolute; top: 12px; right: 14px; font-weight: 600; font-size: .8rem; background: rgba(255,255,255,.22); padding: 2px 8px; border-radius: 999px; }
.card .cover .ttl { font-weight: 700; font-size: 1.15rem; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card .body p { color: var(--muted); font-size: .92rem; margin: 0; flex: 1; }

.btn {
  display: inline-block; text-align: center; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: .95rem;
  border: 0; border-radius: 10px; padding: 10px 16px;
  background: var(--accent); color: #fff; text-decoration: none;
  transition: filter .12s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--labidee-navy); border: 1.5px solid var(--line); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.note { background: #eaf5fb; border: 1px solid #cfe7f3; color: var(--labidee-navy); border-radius: var(--radius); padding: 14px 16px; font-size: .92rem; margin-top: 24px; }

/* Footer */
.site-footer { background: var(--labidee-dark); color: #c4d6de; margin-top: 56px; padding: 28px 0; font-size: .86rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
.site-footer strong { color: #fff; font-weight: 600; }
.site-footer a { color: var(--labidee-primary); }

/* Generic content page */
.content { padding: 36px 0 12px; }
.content ul { margin: 0 0 1em; padding-left: 1.2em; }
.content li { margin: .3em 0; }

/* ---------- Player ---------- */
html.player, body.player { height: 100%; background: #000; }
.player-shell { display: flex; flex-direction: column; height: 100vh; }
.player-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--labidee-navy); color: #fff;
  padding: 8px 12px; flex: 0 0 auto;
}
.player-bar .title { font-weight: 600; margin-right: auto; }
.player-bar a, .player-bar button {
  font-family: inherit; font-size: .88rem; font-weight: 500;
  color: #fff; background: rgba(255,255,255,.12);
  border: 0; border-radius: 8px; padding: 7px 12px; cursor: pointer; text-decoration: none;
}
.player-bar a:hover, .player-bar button:hover { background: rgba(255,255,255,.22); }

.stage { position: relative; flex: 1 1 auto; display: flex; align-items: center; justify-content: center; overflow: hidden; }

/* v86 screen container */
#screen_container { color: #fff; }
#screen_container > div { white-space: pre; font: 14px monospace; line-height: 14px; }
#screen_container canvas { image-rendering: pixelated; max-width: 100%; max-height: 100%; background: #000; }

/* Overlay (loading + unlock) */
.overlay {
  position: absolute; inset: 0; z-index: 10;
  background: linear-gradient(160deg, var(--labidee-dark), var(--labidee-navy));
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 16px;
}
.overlay.hidden { display: none; }
.overlay h2 { color: #fff; }
.overlay .sub { color: #cfe3ec; max-width: 46ch; }
.progress { width: min(420px, 80vw); height: 8px; background: rgba(255,255,255,.18); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0%; background: var(--labidee-primary); transition: width .2s ease; }
.spinner { width: 38px; height: 38px; border: 4px solid rgba(255,255,255,.25); border-top-color: var(--labidee-primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.unlock { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.unlock input {
  font-family: inherit; font-size: 1rem; padding: 10px 14px;
  border-radius: 10px; border: 0; width: min(320px, 80vw); text-align: center;
}
.unlock .err { color: #ffd1d6; font-size: .9rem; min-height: 1.2em; }
.overlay .btn { background: var(--labidee-primary); color: var(--labidee-dark); }

@media (max-width: 520px) {
  .player-bar a, .player-bar button { padding: 7px 9px; }
  .player-bar .title { font-size: .9rem; }
}
