/* ============================================================
   Davide Preti — Portfolio — Design system
   ============================================================ */

@font-face {
  font-family: 'Platform';
  src: url('/assets/fonts/Platform-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Platform';
  src: url('/assets/fonts/Platform-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #121110;
  --ink: #F2EFE7;
  --ink-muted: #8C887C;
  --rule: #38352E;
  --shock: #00FA9A;
  --shock-dark: #00C278;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Platform', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s ease;
}
a:hover, a:focus-visible { border-color: var(--ink); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

img, video { max-width: 100%; display: block; }

/* ---------- Site header / nav ---------- */
.site-header {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: clamp(20px, 4vw, 40px) clamp(20px, 5vw, 64px) 0;
}
.site-header .name {
  font-family: 'brandon-grotesque', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(20px, 3.4vw, 30px);
  letter-spacing: 0.05em;
  color: var(--shock);
  border-bottom: none;
}
.site-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(16px, 3vw, 32px); }
.site-nav a {
  font-family: 'brandon-grotesque', sans-serif;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.site-nav a:hover, .site-nav a:focus-visible, .site-nav a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--rule);
}
.site-nav a.is-locked, .home-nav .site-nav a.is-locked {
  opacity: 0.4;
  cursor: default;
}
.site-nav a.is-locked:hover, .site-nav a.is-locked:focus-visible {
  color: var(--ink-muted);
  border-color: transparent;
}
.home-nav .site-nav a.is-locked:hover, .home-nav .site-nav a.is-locked:focus-visible {
  color: var(--ink);
}

main { flex: 1; position: relative; z-index: 2; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 3;
  border-top: 1px solid var(--rule);
  margin-top: clamp(48px, 8vw, 96px);
  padding: 20px clamp(20px, 5vw, 64px) clamp(24px, 5vw, 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.site-footer .status {
  font-family: 'Platform', sans-serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.social { display: flex; gap: 20px; }
.social a { position: relative; width: 18px; height: 18px; display: block; border-bottom: none; }
.social img, .social svg { position: absolute; inset: 0; width: 18px; height: 18px; transition: opacity 0.2s ease; }
.social img.on, .social svg.on { opacity: 0; }
.social a:hover img.on, .social a:focus-visible img.on,
.social a:hover svg.on, .social a:focus-visible svg.on { opacity: 1; }
.social a:hover img.off, .social a:focus-visible img.off,
.social a:hover svg.off, .social a:focus-visible svg.off { opacity: 0; }
.social a.li-text {
  width: auto; height: auto;
  font-family: 'Platform', sans-serif;
  font-weight: 500; font-size: 15px; line-height: 18px;
  color: var(--ink-muted);
}
.social a.li-text:hover, .social a.li-text:focus-visible { color: var(--ink); }
.site-footer a { font-family: 'Platform', sans-serif; font-weight: 300; font-size: 12px; letter-spacing: 0.06em; color: var(--ink-muted); }

/* ============================================================
   Home / hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: clamp(24px, 5vw, 64px);
}
.hero-video, .hero-overlay { position: fixed; inset: 0; width: 100%; height: 100%; }
.hero-video { object-fit: cover; z-index: 0; background: var(--bg); }
.hero-overlay {
  z-index: 1;
  background: linear-gradient(180deg, rgba(18,17,16,0.6) 0%, rgba(18,17,16,0.32) 42%, rgba(18,17,16,0.8) 100%);
}
.hero-main {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 720px;
  width: 100%;
}
.hero-title-video {
  width: min(90vw, 640px);
  height: auto;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.home-nav { position: relative; z-index: 2; }
.home-nav .site-nav a { color: var(--ink); }
.home-nav .site-nav a:hover, .home-nav .site-nav a:focus-visible { color: var(--shock); border-color: var(--shock); }
.home-footer { position: relative; z-index: 2; }
.home-footer .site-footer { margin-top: 0; padding-top: 20px; padding-left: 0; padding-right: 0; padding-bottom: 0; }

@media (prefers-reduced-motion: no-preference) {
  .hero-main, .home-nav, .home-footer { animation: rise 0.8s ease both; }
  .home-nav { animation-delay: 0.1s; }
  .home-footer { animation-delay: 0.2s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ============================================================
   Inner pages (About / Stories / Publications / Project)
   ============================================================ */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 64px) clamp(20px, 5vw, 64px);
}
.page-title {
  font-family: 'brandon-grotesque', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(22px, 3.6vw, 32px);
  margin-bottom: clamp(24px, 4vw, 40px);
}

/* ---------- About ---------- */
.about-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 48px);
}
.about-portrait img { border: 1px solid var(--rule); max-width: 320px; }
.about-bio { font-weight: 300; line-height: 1.7; color: var(--ink); max-width: 62ch; }
.about-bio p { margin-bottom: 1.1em; }
@media (min-width: 640px) {
  .about-content:has(.about-portrait) { grid-template-columns: 240px 1fr; align-items: start; }
}

/* ---------- Stories grid ---------- */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}
@media (min-width: 640px) { .stories-grid { grid-template-columns: repeat(3, 1fr); } }
.story-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-bottom: none;
  background: #1a1917;
}
.story-tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease, opacity 0.2s ease;
}
.story-tile:hover img, .story-tile:focus-visible img { transform: scale(1.04); }
.story-tile .story-label {
  position: absolute; inset: auto 0 0 0;
  padding: 10px 12px;
  background: linear-gradient(0deg, rgba(18,17,16,0.85) 0%, rgba(18,17,16,0) 100%);
  font-family: 'brandon-grotesque', sans-serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.story-tile:hover .story-label, .story-tile:focus-visible .story-label { opacity: 1; }
.empty-state { color: var(--ink-muted); font-size: 14px; }

/* ---------- Project template (horizontal scroll) ---------- */
.project-header {
  padding: clamp(28px, 5vw, 48px) clamp(20px, 5vw, 64px) 0;
}
.project-header .page-title { margin-bottom: 8px; }
.project-header .project-date { color: var(--ink-muted); font-size: 13px; letter-spacing: 0.04em; }
.project-header .project-intro { margin-top: 16px; max-width: 62ch; line-height: 1.7; color: var(--ink); }
.project-header .project-publink { margin-top: 16px; display: inline-block; font-size: 13px; color: var(--shock); border-color: var(--shock-dark); }

.project-scroll-wrap { position: relative; }
.project-scroll {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: clamp(24px, 4vw, 40px) clamp(20px, 5vw, 64px) clamp(40px, 6vw, 64px);
  -webkit-overflow-scrolling: touch;
}
.project-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: min(80vw, 560px);
}
.project-item.type-testo {
  display: flex;
  align-items: center;
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.7;
  color: var(--ink);
  border-left: 2px solid var(--shock);
  padding-left: 20px;
}
.project-item.type-foto img { border: 1px solid var(--rule); width: 100%; height: auto; }
.project-item.type-video { width: min(90vw, 700px); }
.project-item .video-embed { position: relative; width: 100%; aspect-ratio: 16/9; border: 1px solid var(--rule); background: #000; }
.project-item .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.project-scroll-hint { text-align: center; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); padding-bottom: 24px; }
@media (min-width: 900px) { .project-scroll-hint { display: none; } }

/* ---------- Publications feed ---------- */
.publications-feed { display: flex; flex-direction: column; gap: 2px; max-width: 480px; margin: 0 auto; }
.publication-item { display: block; border-bottom: 1px solid var(--rule); padding: 18px 4px; }
.publication-item:hover, .publication-item:focus-visible { border-color: var(--ink); }
.publication-cover { aspect-ratio: 4/5; overflow: hidden; margin-bottom: 12px; background: #1a1917; }
.publication-cover img { width: 100%; height: 100%; object-fit: cover; }
.publication-title { font-family: 'brandon-grotesque', sans-serif; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); }
.publication-meta { margin-top: 4px; font-size: 12px; color: var(--ink-muted); }
