/* ==========================================================================
   Padus Solar Challenge — design "Luce sul Po" (alternative theme)
   Warm paper canvas · solar amber · serif display · sticky top nav
   Same markup/classes as assets/style.css — swap the <link> to switch back.
   ========================================================================== */


:root {
  --amber: #b45309;        /* accessible on paper (text/accents) */
  --amber-hot: #8a3d05;
  --amber-glow: #ffbe3d;   /* fills / glows only */
  --amber-dim: rgba(180, 83, 9, .1);
  --river: #0d6579;
  --ink: #14110d;          /* headings */
  --body: #3a434f;
  --muted: #5e6773;
  --deep: #fcfaf5;         /* page bg (paper) */
  --panel: #ffffff;        /* raised bg */
  --panel-2: #f4efe4;
  --line: rgba(20, 17, 13, .14);
  --line-strong: rgba(20, 17, 13, .3);
  /* nav = complementary deep teal to the amber accent (hue ~200 vs ~30) */
  --nav-bg: #0e2c3a;
  --nav-bg-2: #0a212c;
  --nav-ink: #eaf1f4;
  --nav-line: rgba(255, 255, 255, .18);
  --radius: 4px;
  --radius-sm: 3px;
  --shadow: 0 24px 60px -28px rgba(27, 23, 18, .35);
  --shadow-sm: 0 12px 30px -20px rgba(27, 23, 18, .3);
  --nav-h: 76px;
  --maxw: 1240px;
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  color: var(--body);
  background: var(--deep);
  -webkit-font-smoothing: antialiased;
}
/* faint horizon glow behind everything (kept light so text stays legible) */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 420px at 78% -6%, rgba(255, 190, 61, .16), transparent 72%),
    radial-gradient(700px 420px at 4% 102%, rgba(13, 101, 121, .05), transparent 72%);
  pointer-events: none; z-index: 0;
}
img { max-width: 100%; height: auto; display: block; border: 0; }
a { color: var(--amber); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--amber-hot); }
::selection { background: var(--amber-glow); color: var(--ink); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "opsz" 40;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0 0 .55em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1.15em; }

.wrap { position: relative; z-index: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 4.5vw, 60px); }

.eyebrow {
  display: inline-block;
  font-family: var(--mono); font-weight: 500;
  font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 18px;
}
.eyebrow::before { content: "// "; color: var(--amber-hot); opacity: .6; }
.lead { font-size: 1.16rem; color: var(--body); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--mono); font-weight: 500;
  font-size: .84rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 15px 28px; border-radius: 2px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--amber); color: #fff; }
.btn-primary:hover { background: var(--ink); color: #fff; box-shadow: 0 0 0 4px var(--amber-dim); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }

/* ------------------------------------------------------------------ nav
   .sidebar markup is reused as a sticky horizontal top bar on desktop      */
.sidebar {
  position: sticky; top: 0; z-index: 120;
  display: flex; align-items: center; gap: clamp(16px, 3vw, 44px);
  height: var(--nav-h);
  padding: 0 clamp(20px, 4.5vw, 60px);
  background: linear-gradient(180deg, var(--nav-bg), var(--nav-bg-2));
  border-bottom: 3px solid var(--amber-glow);
  box-shadow: 0 14px 34px -26px rgba(14, 44, 58, .9);
}
.side-brand { flex: 0 0 auto; display: block; }
.side-brand img { height: 42px; width: auto; filter: brightness(0) invert(1); }
.side-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.side-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font); font-weight: 500; font-size: .94rem;
  color: var(--nav-ink); padding: 9px 12px; border-radius: 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.side-nav a svg { width: 17px; height: 17px; flex: 0 0 17px; color: rgba(255, 255, 255, .55); transition: color .15s ease; }
.side-nav a:hover { color: var(--amber-glow); background: rgba(255, 255, 255, .08); }
.side-nav a:hover svg { color: var(--amber-glow); }
.side-nav a.active { color: var(--amber-glow); border-bottom-color: var(--amber-glow); }
.side-nav a.active svg { color: var(--amber-glow); }
.side-foot { display: flex; align-items: center; gap: 14px; margin-left: 8px; padding-left: 18px; border-left: 1px solid var(--nav-line); }
.side-foot p { display: none; }             /* copy lives in the footer on desktop */
.side-social { display: flex; gap: 8px; }
.side-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 2px;
  border: 1px solid var(--nav-line); color: var(--nav-ink);
}
.side-social a:hover { border-color: var(--amber-glow); color: var(--amber-glow); background: rgba(255, 255, 255, .08); }

/* mobile bar (shown under 1000px) */
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 110;
  align-items: center; justify-content: space-between;
  height: 64px; padding: 0 18px;
  background: linear-gradient(180deg, var(--nav-bg), var(--nav-bg-2));
  border-bottom: 3px solid var(--amber-glow);
}
.topbar img { height: 34px; filter: brightness(0) invert(1); }
.nav-toggle {
  width: 44px; height: 44px; border: 1px solid var(--nav-line); border-radius: 2px;
  background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 20px; height: 1.5px; background: var(--nav-ink);
  position: relative; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }
.scrim { display: none; position: fixed; inset: 0; background: rgba(27, 23, 18, .45); z-index: 115; }
body.nav-open .scrim { display: block; }

.content { display: flex; flex-direction: column; min-height: 60vh; }
.content > main { flex: 1; }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative; overflow: hidden;
  min-height: clamp(560px, 88vh, 900px);
  display: flex; align-items: center;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.hero-slides { position: absolute; inset: 0; }
.hero-slides .slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.08);
  filter: saturate(.95) contrast(1.02);
  transition: opacity 1.6s ease, transform 12s linear;
}
.hero-slides .slide.on { opacity: 1; transform: scale(1); }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--deep) 6%, rgba(252, 250, 245, .97) 50%, rgba(252, 250, 245, .72) 82%, rgba(252, 250, 245, .45) 100%),
    repeating-linear-gradient(180deg, rgba(20, 17, 13, .025) 0 1px, transparent 1px 4px);
}
.hero .wrap { z-index: 2; padding-top: 60px; padding-bottom: 60px; }
.hero h1 { max-width: 20ch; }
.hero h1 em { font-style: normal; color: var(--amber); }
.hero p { max-width: 56ch; font-size: 1.2rem; color: var(--body); }
.hero .btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.route-chip {
  display: inline-block; margin-bottom: 22px;
  font-family: var(--mono); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line-strong); border-left: 2px solid var(--amber);
  padding: 9px 16px; line-height: 1.6;
}
.route-chip b { color: var(--amber-hot); font-weight: 500; white-space: nowrap; }

/* ------------------------------------------------------------------ sections */
section { padding: clamp(60px, 8vw, 108px) 0; position: relative; }
.alt { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 48px; }
.subhead {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--body); margin-bottom: 18px;
}

/* interior page hero */
.page-hero {
  position: relative;
  padding: clamp(64px, 9vw, 130px) 0 clamp(48px, 6vw, 84px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(680px 300px at 88% 0%, rgba(255, 190, 61, .22), transparent 70%),
    linear-gradient(180deg, var(--panel), var(--deep));
}
.page-hero h1 { margin-bottom: .25em; }
.page-hero p { max-width: 62ch; font-size: 1.15rem; margin: 0; }

/* stats — numbered ledger rows instead of cards */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); }
.stat { padding: 30px 26px 30px 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat:not(:first-child) { padding-left: 26px; }
.stat .num {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.05; color: var(--amber);
}
.stat .label { font-family: var(--mono); font-size: .8rem; line-height: 1.6; color: var(--body); margin-top: 12px; }

/* feature cards — flat panels, amber rule on hover */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card {
  background: var(--panel); display: flex; flex-direction: column;
  transition: background .2s ease;
}
.card:hover { background: var(--panel-2); }
.alt .card { background: var(--panel-2); }
.alt .card:hover { background: var(--panel); }
.card .card-media { aspect-ratio: 16/11; overflow: hidden; background: var(--panel-2); }
.card .card-media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(.45) contrast(1.02); transition: filter .35s ease, transform .5s ease;
}
.card:hover .card-media img { filter: none; transform: scale(1.04); }
.card .card-body { padding: 28px; flex: 1; display: flex; flex-direction: column; }
.card .tag { font-family: var(--mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--river); margin-bottom: 10px; }
.card h3 { margin-bottom: .45em; }
.card p { font-size: .98rem; color: var(--body); }
.card .card-link { margin-top: auto; font-family: var(--mono); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); }
.card:hover .card-link { color: var(--amber-hot); }

/* two-column article */
.split { display: grid; grid-template-columns: 1.3fr .9fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.split .media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.split .media.sticky { position: sticky; top: calc(var(--nav-h) + 24px); }
.article { max-width: 76ch; }
.article h3 {
  font-family: var(--mono); font-weight: 500; font-size: .82rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--amber);
  margin: 2.4em 0 .9em; padding-bottom: .7em; border-bottom: 1px solid var(--line);
}
.article h3:first-child { margin-top: 0; }
.article p { color: var(--body); }
.article > p:first-of-type { font-size: 1.1rem; color: var(--ink); }
.byline { margin-top: 2.4em; padding-top: 1.3em; border-top: 1px solid var(--line); font-family: var(--mono); font-size: .88rem; }
.byline strong { color: var(--ink); font-weight: 500; }

/* logo grid */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.logo-tile {
  background: var(--panel); min-height: 140px;
  display: flex; align-items: center; justify-content: center; padding: 26px;
  transition: background .2s ease;
}
.alt .logo-tile { background: var(--panel-2); }
.logo-tile:hover { background: var(--panel); }
.logo-tile img { max-height: 84px; width: auto; object-fit: contain; filter: grayscale(1) contrast(.95); opacity: .62; transition: filter .2s ease, opacity .2s ease; }
.logo-tile:hover img { filter: none; opacity: 1; }

/* gallery — masonry columns */
.gallery { columns: 4 260px; column-gap: 12px; }
.gallery figure {
  margin: 0 0 12px; position: relative; overflow: hidden;
  break-inside: avoid; cursor: zoom-in; background: var(--panel-2);
  border: 1px solid var(--line);
}
.gallery figure img { width: 100%; height: auto; filter: saturate(.9); transition: filter .3s ease, transform .5s ease; }
.gallery figure:hover img { filter: none; transform: scale(1.03); }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 34px 14px 12px;
  font-family: var(--mono); font-size: .78rem; color: #fff;
  background: linear-gradient(transparent, rgba(18, 14, 10, .88));
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
.gallery figure:hover figcaption { opacity: 1; transform: none; }

/* videos */
.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.video { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* contact */
.contact-card { max-width: 620px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 8px 32px; }
.contact-card .row { display: flex; align-items: center; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.contact-card .row:last-child { border-bottom: 0; }
.contact-card .ic {
  flex: 0 0 44px; height: 44px; border-radius: 2px;
  background: var(--amber-dim); color: var(--amber);
  display: flex; align-items: center; justify-content: center;
}
.contact-card .row .k { font-family: var(--mono); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--body); }
.contact-card .row .v { font-family: var(--display); font-size: 1.15rem; color: var(--ink); }

/* notice */
.notice { max-width: 660px; border: 1px solid var(--line-strong); border-left: 3px solid var(--amber); background: var(--panel); padding: 34px 36px; border-radius: var(--radius-sm); }
.notice h3 { color: var(--amber-hot); }
.notice p:last-child { margin-bottom: 0; }

/* references */
.refs { padding-left: 1.4em; max-width: 84ch; line-height: 1.8; color: var(--body); font-size: .98rem; }
.refs li { margin-bottom: .6em; }
.refs li::marker { color: var(--amber); font-family: var(--mono); }

/* cta band */
.cta {
  position: relative; overflow: hidden; text-align: left;
  padding: clamp(40px, 6vw, 68px);
  border: 1px solid var(--line);
  background:
    radial-gradient(620px 280px at 92% 6%, rgba(255, 190, 61, .35), transparent 70%),
    linear-gradient(120deg, var(--panel-2), var(--panel));
}
.cta h2 { max-width: 26ch; }
.cta p { max-width: 56ch; margin-bottom: 28px; }

/* footer */
/* footer bookends the teal nav so the complementary pairing reads as intentional */
.site-footer { background: linear-gradient(180deg, var(--nav-bg-2), #071820); border-top: 3px solid var(--amber-glow); padding: 56px 0 34px; color: rgba(255, 255, 255, .78); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; font-family: var(--mono); font-size: .84rem; letter-spacing: .06em; text-transform: uppercase; }
.site-footer a { color: var(--nav-ink); }
.site-footer a:hover { color: var(--amber-glow); }
.site-footer .copy { width: 100%; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--nav-line); font-size: .86rem; color: rgba(255, 255, 255, .7); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(24, 20, 14, .94); display: none; align-items: center; justify-content: center; padding: 48px; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 92vw; max-height: 80vh; border: 1px solid rgba(255, 255, 255, .22); background: #fff; }
.lightbox .lb-cap { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; padding: 0 24px; font-family: var(--mono); font-size: .84rem; color: rgba(255, 255, 255, .85); }
.lightbox button {
  position: absolute; width: 50px; height: 50px; border-radius: 2px;
  background: transparent; border: 1px solid rgba(255, 255, 255, .3); color: #fff;
  font-size: 1.4rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.lightbox button:hover { background: var(--amber-glow); border-color: var(--amber-glow); color: var(--ink); }
.lb-close { top: 24px; right: 24px; }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1150px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2n) { border-right: 0; }
}
@media (max-width: 1000px) {
  /* nav becomes off-canvas drawer, driven by body.nav-open (assets/main.js) */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: auto; width: 290px;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 26px 20px 24px;
    background: var(--nav-bg); border-right: 1px solid var(--nav-line); border-bottom: 0;
    overflow-y: auto;
    transform: translateX(-100%); transition: transform .3s ease;
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .side-brand { margin: 4px 0 28px; }
  .side-brand img { height: 46px; }
  .side-nav { flex-direction: column; align-items: stretch; gap: 2px; margin-left: 0; }
  .side-nav a { padding: 12px 10px; border-bottom: 1px solid var(--nav-line); border-radius: 0; }
  .side-nav a.active { background: rgba(255, 190, 61, .16); border-bottom-color: var(--nav-line); }
  .side-foot { margin: auto 0 0; padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--nav-line); flex-direction: column; align-items: flex-start; gap: 16px; }
  .side-foot p { display: block; font-family: var(--mono); font-size: .8rem; color: rgba(255, 255, 255, .72); margin: 0; }
  .topbar { display: flex; }
  .split { grid-template-columns: 1fr; }
  .split .media.sticky { position: static; }
  .gallery { columns: 3 240px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { min-height: 80vh; }
  .gallery { columns: 2 160px; }
  .contact-card { padding: 8px 22px; }
  .notice { padding: 26px 24px; }
  .lightbox { padding: 20px; }
  .lb-prev { left: 10px; } .lb-next { right: 10px; }
}
@media (max-width: 520px) {
  .cards, .stats { grid-template-columns: 1fr; }
  .stat { border-right: 0 !important; padding-left: 0 !important; }
  .logo-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
