/* =========================================================
   Giancarlo Battiato — Portfolio
   Palette dark/oro, mobile-first. Vanilla CSS.
   ========================================================= */

:root {
  --bg: #16120e;
  --bg-2: #1c1711;          /* superficie elevata (card) */
  --bg-3: #221b12;
  --gold: #c9a84c;
  --gold-soft: #e7cd83;
  --gold-deep: #b8860b;
  --ivory: #f3ead9;
  --beige: #b8a98c;

  --line: rgba(201, 168, 76, .16);
  --line-strong: rgba(201, 168, 76, .40);

  --shadow: 0 28px 60px -24px rgba(0, 0, 0, .75);
  --shadow-gold: 0 16px 40px -16px rgba(201, 168, 76, .35);

  --maxw: 1120px;
  --pad: clamp(20px, 5vw, 44px);
  --header-h: 62px;
  --radius: 16px;

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ivory);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* sottile grana per sensazione tattile/premium */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: rgba(201, 168, 76, .28); color: var(--ivory); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  background: var(--gold);
  color: #1a1408;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { position: relative; padding-block: clamp(64px, 12vw, 120px); z-index: 2; }
.section + .section { border-top: 1px solid var(--line); }
:where(section[id], [id]) { scroll-margin-top: calc(var(--header-h) + 14px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .7em;
  font-weight: 600; font-size: .76rem;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: ""; width: 30px; height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ivory);
  margin-top: 16px;
}
.section__head { margin-bottom: clamp(32px, 6vw, 52px); }

/* ---------- Monogramma GB ---------- */
.monogram {
  display: inline-grid; place-items: center;
  aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 22px rgba(201, 168, 76, .07);
  position: relative;
  flex: none;
}
.monogram::after {
  content: ""; position: absolute; inset: 5px;
  border-radius: 50%; border: 1px solid rgba(201, 168, 76, .18);
}
.monogram__text {
  font-family: var(--font-display);
  font-weight: 600; letter-spacing: .03em; line-height: 1;
  background: linear-gradient(140deg, var(--gold-soft), var(--gold) 48%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.monogram--lg { width: 108px; }
.monogram--lg .monogram__text { font-size: 2.7rem; }
.monogram--md { width: 78px; }
.monogram--md .monogram__text { font-size: 1.9rem; }
.monogram--sm { width: 34px; border-width: 1px; }
.monogram--sm::after { inset: 3px; }
.monogram--sm .monogram__text { font-size: .92rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .8em 1.5em;
  border-radius: 999px;
  font-weight: 600; font-size: .98rem; line-height: 1;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
              background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.btn .ic { width: 18px; height: 18px; fill: currentColor; }
.btn--gold {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold) 45%, var(--gold-deep));
  color: #1a1408;
  box-shadow: var(--shadow-gold);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -16px rgba(201, 168, 76, .55); filter: brightness(1.04); }
.btn--ghost { color: var(--ivory); border-color: var(--line-strong); background: rgba(255, 255, 255, .015); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); background: rgba(201, 168, 76, .07); }
.btn--sm { min-height: 44px; padding: .7em 1.2em; font-size: .92rem; }
.ic--arrow { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), backdrop-filter .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header[data-scrolled] {
  background: rgba(18, 14, 10, .72);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border-bottom-color: var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  letter-spacing: .01em; color: var(--ivory);
}
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a {
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  font-weight: 500; font-size: .92rem; color: var(--beige);
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.site-nav a:hover { color: var(--ivory); }
.site-nav__cta { border: 1px solid var(--line-strong); color: var(--ivory); }
.site-nav__cta:hover { border-color: var(--gold); color: var(--gold); background: rgba(201, 168, 76, .06); }

/* ---------- Hero ---------- */
.hero {
  position: relative; z-index: 2;
  min-height: 100svh;
  display: grid; align-items: center;
  text-align: center;
  padding: calc(var(--header-h) + 36px) 0 72px;
  overflow: hidden;
}
.hero__glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(58% 42% at 50% 16%, rgba(201, 168, 76, .17), transparent 70%),
    radial-gradient(90% 60% at 50% 108%, rgba(184, 134, 11, .12), transparent 68%);
}
.hero__inner { display: grid; justify-items: center; gap: 22px; }
.hero .monogram--lg { margin-bottom: 6px; }
.hero__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.6rem, 11vw, 5rem);
  line-height: 1.02; letter-spacing: -.015em;
  color: var(--ivory);
}
.hero__role {
  font-size: clamp(.95rem, 3.6vw, 1.18rem);
  letter-spacing: .04em; color: var(--beige);
  text-transform: none;
}
.hero__benefit {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: clamp(1.15rem, 4.6vw, 1.6rem);
  line-height: 1.4; color: var(--gold-soft);
  max-width: 18ch;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 8px; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: grid; place-items: center; width: 44px; height: 44px;
}
.hero__scroll-line { width: 1px; height: 38px; background: linear-gradient(var(--gold), transparent); position: relative; overflow: hidden; }
.hero__scroll-line::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 40%;
  background: var(--gold-soft); animation: scrollDot 2.2s var(--ease) infinite;
}
@keyframes scrollDot { 0% { transform: translateY(-100%); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(250%); opacity: 0; } }

/* ---------- Chi sono ---------- */
.about__grid { display: grid; gap: clamp(22px, 4vw, 40px); align-items: start; }
.about__media { width: 140px; }
.avatar {
  width: 140px; height: 140px; border-radius: 50%;
  padding: 3px; background: linear-gradient(140deg, var(--gold-soft), var(--gold) 48%, var(--gold-deep));
  box-shadow: var(--shadow-gold);
}
.avatar picture, .avatar img {
  display: block; width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover;
}
.avatar img { background: var(--bg-2); }

.about__body { display: grid; gap: 18px; }
.about__text { color: var(--beige); max-width: 56ch; font-size: 1.04rem; }
.about__text:first-of-type { color: var(--ivory); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.chip {
  font-size: .82rem; letter-spacing: .03em; color: var(--gold-soft);
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(201, 168, 76, .04);
}

/* ---------- Lavori ---------- */
.works__grid { display: grid; gap: clamp(20px, 4vw, 30px); }
.work {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bg-2), #181206);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.work:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.work__cover { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-3); }
.work__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.work:hover .work__cover img { transform: scale(1.045); }
.work__body { display: grid; gap: 10px; padding: clamp(20px, 4vw, 28px); }
.work__name { font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; color: var(--ivory); }
.work__meta { font-size: .84rem; letter-spacing: .04em; color: var(--gold); }
.work__desc { color: var(--beige); font-size: .98rem; }
.work__demo {
  display: inline-flex; align-items: center; gap: 8px;
  justify-self: start; margin-top: 2px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(201, 168, 76, .04);
  font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--beige);
}
.work__demo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }
.work__link { justify-self: start; margin-top: 8px; }
.work__link .ic--arrow { transition: transform .25s var(--ease); }
.work__link:hover .ic--arrow { transform: translate(2px, -2px); }

/* ---------- Video ---------- */
.video-section__lead { color: var(--beige); max-width: 52ch; margin-top: 6px; }
.video-group { margin-top: clamp(30px, 5vw, 46px); }
.video-group__title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; color: var(--ivory);
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 18px;
}
.video-group__hint {
  font-family: var(--font-body); font-size: .76rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold);
}
.video-grid { display: grid; gap: clamp(20px, 4vw, 30px); justify-content: start; }
.video-grid--v { grid-template-columns: repeat(auto-fill, minmax(230px, 300px)); }
.video-grid--h { grid-template-columns: repeat(auto-fill, minmax(280px, 560px)); }

.vid { display: grid; gap: 12px; }
.vid__frame {
  position: relative; overflow: hidden;
  border-radius: 18px; border: 1px solid var(--line-strong);
  background: #0c0a07; box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, .3);
}
.vid--v .vid__frame { aspect-ratio: 9 / 16; }
.vid--h .vid__frame { aspect-ratio: 16 / 9; }
.vid__el { display: block; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }

.vid__play {
  position: absolute; inset: 0; margin: auto;
  width: 66px; height: 66px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep));
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .6);
  transition: transform .25s var(--ease), opacity .35s var(--ease);
}
.vid__play svg { width: 28px; height: 28px; fill: #1a1408; margin-left: 3px; }
.vid__play:hover { transform: scale(1.06); }
.vid.is-playing .vid__play { opacity: 0; pointer-events: none; transform: scale(.8); }

.vid__sound {
  position: absolute; right: 12px; bottom: 12px;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(18, 14, 10, .6); border: 1px solid var(--line-strong);
  backdrop-filter: blur(6px);
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.vid__sound[hidden] { display: none; }
.vid__sound:hover { border-color: var(--gold); }
.vid__sound svg { width: 22px; height: 22px; fill: var(--gold-soft); stroke: var(--gold-soft); stroke-width: 1.6; }
.vid__sound .ic-unmute { display: none; }
.vid__sound[aria-pressed="true"] .ic-mute { display: none; }
.vid__sound[aria-pressed="true"] .ic-unmute { display: block; }

.vid__caption { display: grid; gap: 6px; justify-items: start; }
.vid__title { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; color: var(--ivory); }
.vid__meta { font-size: .84rem; letter-spacing: .04em; color: var(--gold); }
.vid__caption .work__demo { margin-top: 4px; }

/* ---------- Contatti ---------- */
.contact__inner { display: grid; justify-items: center; text-align: center; gap: 14px; }
.contact .monogram { margin-bottom: 6px; }
.contact__lead { color: var(--beige); max-width: 46ch; margin-bottom: 22px; }
.btn--wa { margin-bottom: 8px; }
.btn--wa .ic { width: 20px; height: 20px; fill: currentColor; }
.contact__list { display: grid; gap: 14px; width: 100%; max-width: 440px; }
.contact__link {
  display: flex; align-items: center; gap: 16px; text-align: left;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, var(--bg-2), #15100a);
  transition: border-color .25s var(--ease), transform .25s var(--ease), background-color .25s var(--ease);
}
.contact__link:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.contact__icon { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(201, 168, 76, .05); }
.contact__icon svg { width: 22px; height: 22px; fill: var(--gold); stroke: var(--gold); }
.contact__icon svg[fill="none"] { fill: none; }
.contact__text { display: grid; gap: 2px; }
.contact__label { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--beige); }
.contact__value { font-family: var(--font-display); font-size: 1.08rem; color: var(--ivory); }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 2; border-top: 1px solid var(--line); padding-block: 34px; }
.site-footer__inner { display: flex; align-items: center; justify-content: center; gap: 14px; text-align: center; flex-wrap: wrap; }
.site-footer__text { font-size: .86rem; color: var(--beige); }

/* ---------- Reveal (micro-interazioni) ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll-line::after { animation: none; }
  .work:hover { transform: none; }
  * { scroll-behavior: auto !important; }
}

/* =========================================================
   Breakpoint: tablet
   ========================================================= */
@media (min-width: 720px) {
  .works__grid { grid-template-columns: 1fr 1fr; }
  .about__grid { grid-template-columns: 140px 1fr; column-gap: clamp(28px, 4vw, 44px); }
  .contact__list { grid-template-columns: 1fr; }
}

/* =========================================================
   Breakpoint: desktop
   ========================================================= */
@media (min-width: 980px) {
  .hero__benefit { max-width: 22ch; }
}

/* Header brand name: nascondi su schermi molto piccoli per non affollare */
@media (max-width: 380px) {
  .brand__name { display: none; }
}
