/* ================================================================
   HGU — Hard Ground University
   Design system isolato, palette terracotta/earth
   ================================================================ */

/* --- Self-hosted fonts (no Google Fonts dependency) --- */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 300; font-display: swap; src: url(fonts/cormorant-garamond-300.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/cormorant-garamond-400.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/cormorant-garamond-600.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 300; font-display: swap; src: url(fonts/cormorant-garamond-300i.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/cormorant-garamond-400i.woff2) format('woff2'); }
@font-face { font-family: 'Libre Baskerville'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/libre-baskerville-400.woff2) format('woff2'); }
@font-face { font-family: 'Libre Baskerville'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/libre-baskerville-400i.woff2) format('woff2'); }
@font-face { font-family: 'Libre Baskerville'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/libre-baskerville-700.woff2) format('woff2'); }

/* --- HGU Palette override (coexists with lds.css) --- */
:root, [data-theme="dark"] {
  --hgu-ink: #f0ece3;
  --hgu-ink-light: #c0b6aa;
  --hgu-paper: #0f0d0b;
  --hgu-paper-warm: #1a1714;
  --hgu-accent: #c4663a;
  --hgu-accent-soft: #d4855a;
  --hgu-rule: #2d2926;
  --hgu-ghost: rgba(255,252,245,0.04);
  --hgu-s1: #d4855a;
  --hgu-s2: #b85c38;
  --hgu-s3: #8b8070;
  --hgu-s4: #c8c0b4;
}

[data-theme="light"] {
  --hgu-ink: #1a1714;
  --hgu-ink-light: #3d3830;
  --hgu-paper: #f5f1ea;
  --hgu-paper-warm: #ede8df;
  --hgu-accent: #8b3a1e;
  --hgu-accent-soft: #b85c38;
  --hgu-rule: #c8bfb0;
  --hgu-ghost: rgba(26,23,20,0.06);
  --hgu-s1: #b85c38;
  --hgu-s2: #8b3a1e;
  --hgu-s3: #3d3830;
  --hgu-s4: #1a1714;
}

/* --- SVG strati --- */
.hgu-s1 { fill: var(--hgu-s1); }
.hgu-s2 { fill: var(--hgu-s2); }
.hgu-s3 { fill: var(--hgu-s3); }
.hgu-s4 { fill: var(--hgu-s4); }

/* --- Noise texture overlay --- */
.hgu-hero::before,
.hgu-section::before,
.hgu-tesi::before,
.hgu-registro::before,
.hgu-chiusura::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
}

/* --- HERO --- */
.hgu-hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6rem 4rem 5rem;
  border-bottom: 1px solid var(--hgu-rule);
  position: relative;
  overflow: hidden;
  background: var(--hgu-paper);
}

.hgu-hero > * { position: relative; z-index: 1; }

.hgu-hero-bg-text {
  position: absolute;
  top: 50%;
  left: -0.04em;
  transform: translateY(-50%);
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(9rem, 20vw, 22rem);
  font-weight: 300;
  color: transparent;
  -webkit-text-stroke: 1px rgba(139,58,30,0.08);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  line-height: 1;
  letter-spacing: -0.02em;
  z-index: 0;
}

.hgu-hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hgu-accent);
  margin-bottom: 2rem;
  opacity: 0;
  animation: hguFadeUp 0.8s ease 0.2s forwards;
}

.hgu-hero-logo {
  margin-bottom: 2.2rem;
  opacity: 0;
  animation: hguFadeUp 0.8s ease 0.28s forwards;
}

.hgu-hero-logo svg { display: block; }

.hgu-hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3.2rem, 7vw, 7.5rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--hgu-ink);
  max-width: 14ch;
  opacity: 0;
  animation: hguFadeUp 0.9s ease 0.35s forwards;
}

.hgu-hero-title em {
  font-style: italic;
  color: var(--hgu-accent);
}

.hgu-hero-subtitle {
  margin-top: 2.5rem;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1rem;
  line-height: 1.8;
  max-width: 55ch;
  color: var(--hgu-ink-light);
  font-weight: 400;
  opacity: 0;
  animation: hguFadeUp 0.9s ease 0.5s forwards;
}

.hgu-hero-divider {
  margin-top: 3.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  opacity: 0;
  animation: hguFadeUp 0.8s ease 0.65s forwards;
}

.hgu-hero-divider span {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--hgu-rule);
}

.hgu-hero-divider::before,
.hgu-hero-divider::after {
  content: '';
  height: 1px;
  background: var(--hgu-rule);
  flex: 1;
  max-width: 4rem;
}

/* --- SECTIONS --- */
.hgu-section {
  padding: 5rem 4rem;
  border-bottom: 1px solid var(--hgu-rule);
  position: relative;
  background: var(--hgu-paper);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hgu-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.hgu-section > * { position: relative; z-index: 1; }

.hgu-section-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  gap: 4rem;
  align-items: start;
}

.hgu-section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hgu-accent);
  padding-top: 0.3rem;
  position: sticky;
  top: 5rem;
}

.hgu-section-label::before {
  content: '—';
  margin-right: 0.6em;
  color: var(--hgu-rule);
}

.hgu-section-body h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--hgu-ink);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.hgu-section-body h2 em {
  font-style: italic;
  color: var(--hgu-accent);
}

.hgu-section-body p {
  font-family: 'Libre Baskerville', Georgia, serif;
  color: var(--hgu-ink-light);
  margin-bottom: 1.2rem;
  font-size: 0.98rem;
  line-height: 1.7;
}

.hgu-section-body p:last-child { margin-bottom: 0; }

/* --- TESI --- */
.hgu-tesi {
  background: var(--hgu-paper-warm);
  padding: 6rem 4rem;
  position: relative;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.hgu-tesi.visible {
  opacity: 1;
  transform: translateY(0);
}

.hgu-tesi > * { position: relative; z-index: 1; }

.hgu-tesi-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hgu-tesi blockquote {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.45;
  color: var(--hgu-ink);
  letter-spacing: -0.01em;
}

.hgu-tesi blockquote strong {
  font-style: normal;
  font-weight: 600;
  color: var(--hgu-accent-soft);
}

.hgu-tesi-attr {
  margin-top: 2.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hgu-rule);
}

/* --- OSPITA GRID --- */
.hgu-ospita-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 2.5rem;
}

.hgu-ospita-item {
  padding: 1.8rem;
  border: 1px solid var(--hgu-rule);
  margin: -1px 0 0 -1px;
  transition: background 0.2s;
}

.hgu-ospita-item:hover { background: var(--hgu-paper-warm); }

.hgu-ospita-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--hgu-accent);
  margin-bottom: 0.8rem;
  display: block;
}

.hgu-ospita-item h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--hgu-ink);
  margin-bottom: 0.5rem;
}

.hgu-ospita-item p {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.82rem;
  color: var(--hgu-ink-light);
  line-height: 1.6;
}

/* --- PARTECIPA --- */
.hgu-partecipa-list {
  margin-top: 1.8rem;
  display: flex;
  flex-direction: column;
}

.hgu-partecipa-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--hgu-rule);
}

.hgu-partecipa-item:first-child { border-top: 1px solid var(--hgu-rule); }

.hgu-partecipa-icon {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--hgu-accent);
  min-width: 5rem;
  padding-top: 0.15rem;
  letter-spacing: 0.1em;
}

.hgu-partecipa-item p {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.9rem;
  color: var(--hgu-ink-light);
}

.hgu-partecipa-note {
  margin-top: 1.5rem;
  font-size: 0.88rem;
}

/* --- REGISTRO --- */
.hgu-registro {
  background: var(--hgu-paper-warm);
  padding: 5rem 4rem;
  border-bottom: 1px solid var(--hgu-rule);
  position: relative;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hgu-registro.visible {
  opacity: 1;
  transform: translateY(0);
}

.hgu-registro > * { position: relative; z-index: 1; }

/* --- CHIUSURA --- */
.hgu-chiusura {
  padding: 7rem 4rem 6rem;
  text-align: center;
  background: var(--hgu-paper);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.hgu-chiusura.visible {
  opacity: 1;
  transform: translateY(0);
}

.hgu-chiusura-inner {
  max-width: 680px;
  margin: 0 auto;
}

.hgu-chiusura h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  font-weight: 300;
  line-height: 1.4;
  color: var(--hgu-ink);
  margin-bottom: 2rem;
}

.hgu-chiusura h2 em {
  font-style: italic;
  color: var(--hgu-accent);
}

.hgu-chiusura p {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.92rem;
  color: var(--hgu-ink-light);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.hgu-chiusura-seal {
  margin-top: 3.5rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hgu-seal-line {
  width: 1px;
  height: 3rem;
  background: var(--hgu-rule);
}

.hgu-seal-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--hgu-rule);
}

/* --- ANIMATIONS --- */
@keyframes hguFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .hgu-hero { padding: 5rem 1.8rem 3.5rem; }
  .hgu-section { padding: 3.5rem 1.8rem; }
  .hgu-section-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .hgu-section-label { position: static; padding-top: 0; }
  .hgu-tesi { padding: 4rem 1.8rem; }
  .hgu-ospita-grid { grid-template-columns: 1fr; }
  .hgu-registro { padding: 3.5rem 1.8rem; }
  .hgu-chiusura { padding: 4rem 1.8rem; }
}

/* --- SCROLL REVEAL (JS-driven) --- */
