/* Federico Leotta — v3 "Control Room". Spec: docs/design/v3/README.md */

:root {
  --bg: #141210;
  --surface: #1C1916;
  --marquee-bg: #0F0D0B;
  --line: #2B2723;
  --line-strong: #3A3430;
  --ink: #EDE6D8;
  --ink-2: #D9D0C1;
  --ink-3: #C9BFB0;
  --muted: #9B9184;
  --faint: #5E564C;
  --accent: #E8582B;

  --e-bg: #08070A;
  --e-ink: #F2EEF7;
  --e-muted: #B8ACC9;
  --e-label: #8F7FA8;
  --e-line: #2A2436;
  --e-card: #100D15;

  --sans: 'Archivo', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --gutter: clamp(16px, 3vw, 40px);
  --section-y: clamp(56px, 9vh, 120px);
  --section-y-lg: clamp(72px, 12vh, 160px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset ---------- */
html { -webkit-font-smoothing: antialiased; background: var(--bg); scroll-padding-top: 52px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--sans);
  transition: padding-bottom .5s var(--ease);
}
body.has-player { padding-bottom: 80px; }
body.menu-open { overflow: hidden; }
* { box-sizing: border-box; }
img { display: block; }
button { font: inherit; cursor: pointer; }
a { color: var(--ink); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

@keyframes drift { to { transform: translateX(-50%); } }
@keyframes led { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes gigfade {
  0%, 100% { opacity: 0; transform: scale(1.04); }
  8%, 28% { opacity: 1; }
  36% { opacity: 0; transform: scale(1.12); }
}

/* ---------- Shared ---------- */
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.label-light { color: var(--ink-3); }
.section-head { display: grid; gap: 10px; }
.h2 {
  margin: 0; font-size: clamp(32px, 4.5vw, 64px); letter-spacing: -0.02em; font-weight: 700;
  line-height: 1; text-transform: uppercase; font-stretch: 75%;
}
.h2-tight { letter-spacing: -0.03em; }
.cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 24px; align-items: start;
}

.cta-pair {
  display: flex; flex-wrap: wrap; gap: 1px; background: var(--line-strong); border: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
}
.cta, .cta:hover {
  display: flex; align-items: center; gap: 14px; padding: 0 20px; min-height: 52px;
  background: var(--bg); color: var(--ink); transition: background-color .25s;
}
.cta:hover { background: var(--surface); }
.cta span { display: inline-block; transition: transform .35s var(--ease); }
.cta:hover span { transform: translateX(4px); }
.cta-solid, .cta-solid:hover { background: var(--ink); color: var(--bg); }
.cta-solid:hover { background: #FBF5E8; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 52px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter);
  background: linear-gradient(#141210, #14121000);
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
}
/* Solid layer that fades in once the page is scrolled (or the mobile menu is open). */
.nav::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: rgba(20, 18, 16, .82); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  transition: opacity .35s var(--ease);
}
.nav.is-scrolled::before, body.menu-open .nav::before { opacity: 1; }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.nav-links { display: none; gap: 26px; color: var(--ink-3); }
.nav-links a, .nav-links a:hover { color: inherit; }
.nav-links a { position: relative; padding: 6px 0; transition: color .25s; }
/* Underline on hover and on the current section. It grows from the left and collapses to the
   right (the origin flips when it leaves), so moving across the links reads as one pass. */
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav-links .nav-contact, .nav-links .nav-contact:hover { color: var(--ink); }
.nav-toggle {
  display: flex; background: #141210aa; border: 1px solid var(--line-strong); color: var(--ink);
  padding: 8px 12px; font: inherit; letter-spacing: inherit; min-height: 36px;
  transition: background-color .25s, border-color .25s;
}
.nav-toggle:hover { border-color: var(--muted); }
/* Mobile menu: fades/slides in, items stagger; hidden via visibility (keeps the transition). */
.mobile-menu {
  position: fixed; inset: 52px 0 0; z-index: 49; background: var(--bg);
  display: grid; align-content: start; padding: 24px var(--gutter);
  font-family: var(--mono); font-size: 22px;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .3s var(--ease), transform .35s var(--ease), visibility 0s linear .35s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.mobile-menu a {
  padding: 18px 0; border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(10px); transition: opacity .35s var(--ease), transform .4s var(--ease);
}
.mobile-menu.is-open a { opacity: 1; transform: none; }
.mobile-menu.is-open a:nth-child(2) { transition-delay: .04s; }
.mobile-menu.is-open a:nth-child(3) { transition-delay: .08s; }
.mobile-menu.is-open a:nth-child(4) { transition-delay: .12s; }
.mobile-menu.is-open a:nth-child(5) { transition-delay: .16s; }
.mobile-menu .mobile-menu-contact { border-bottom: 0; color: var(--accent); }

@media (min-width: 820px) {
  .nav-links { display: flex; }
  .nav-toggle, .mobile-menu { display: none !important; }
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-content: end; overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 30%; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(to top, #141210 0%, #141210a0 35%, #14121000 70%); }
.hero-body {
  position: relative; padding: 0 var(--gutter) clamp(20px, 3vh, 36px);
  display: grid; gap: clamp(14px, 2vh, 24px);
}
.hero-title {
  margin: 0; font-size: clamp(46px, 10.5vw, 176px); line-height: .88; letter-spacing: -0.03em;
  font-weight: 700; text-transform: uppercase; font-stretch: 75%;
}
.hero-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 24px; align-items: end; }
.js .hero-title, .js .hero-sub, .js .hero .cta-pair { animation: rise .8s var(--ease) both; }
.js .hero-sub { animation-delay: .12s; }
.js .hero .cta-pair { animation-delay: .22s; }

/* Photos fade in once loaded (JS adds .is-loaded; without JS they are simply visible). */
.js .hero-img, .js .note-media img, .js .about-img, .js .entropy-art img, .js .tile-img { opacity: 0; }
.js .hero-img, .js .note-media img, .js .about-img, .js .entropy-art img { transition: opacity .7s var(--ease); }
/* `img.` keeps this rule at least as specific as the `... img` selectors above, so it wins once loaded. */
.js img.is-loaded { opacity: 1; }
.hero-sub {
  margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--ink-3);
  text-transform: uppercase; line-height: 1.7;
}

/* ---------- Cover strip ---------- */
.marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--marquee-bg); }
.marquee-track { display: flex; width: max-content; animation: drift 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.m-tile {
  width: clamp(120px, 14vw, 200px); aspect-ratio: 1; flex: none; border: 0; border-right: 1px solid var(--line);
  padding: 0; background: var(--surface); overflow: hidden; position: relative;
}
.m-tile img { width: 100%; height: 100%; object-fit: cover; transition: opacity .4s; }
.marquee.has-current .m-tile img { opacity: .5; }
.marquee.has-current .m-tile.is-current img { opacity: 1; }

/* ---------- Note ---------- */
.note {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 1px; background: var(--line); border-bottom: 1px solid var(--line);
}
.note-media { background: var(--surface); aspect-ratio: 4 / 3; position: relative; overflow: hidden; }
.note-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.note-body {
  background: var(--bg); padding: clamp(32px, 5vw, 72px) var(--gutter);
  display: grid; align-content: center; gap: 20px;
}
.note-text {
  margin: 0; max-width: 56ch; font-size: clamp(19px, 1.7vw, 24px); line-height: 1.45; color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Selected work ---------- */
.work { padding: var(--section-y) 0 0; border-bottom: 1px solid var(--line); }
.work-head {
  padding: 0 var(--gutter) 24px; display: flex; flex-wrap: wrap; align-items: end;
  justify-content: space-between; gap: 16px 24px;
}
.work-tags {
  margin: 0; max-width: 34ch; font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  line-height: 1.7; color: var(--muted); text-transform: uppercase;
}
.work-grid {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(33.33%, 240px), 1fr));
  gap: 1px; background: var(--line); border-top: 1px solid var(--line);
}
.work-grid li { background: var(--bg); }
.tile {
  width: 100%; background: none; border: 0; padding: 0; color: inherit; display: block;
  position: relative; aspect-ratio: 1; overflow: hidden; text-align: left;
}
.tile-img { width: 100%; height: 100%; object-fit: cover; transform: scale(1); transition: transform .6s var(--ease), opacity .6s var(--ease); }
.tile-shade {
  position: absolute; inset: 0; opacity: 0; transition: opacity .35s;
  background: linear-gradient(to top, #141210fa 0%, #141210cc 45%, #14121055 100%);
}
.tile-text {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 100%; padding: 12px;
  display: grid; gap: 3px; min-width: 0; overflow: hidden;
  opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .45s var(--ease);
}
.tile-artist {
  font-size: clamp(14px, 1.2vw, 17px); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.tile-title {
  font-size: clamp(12px, 1vw, 14px); color: var(--ink-3); line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.tile-role {
  justify-self: start; max-width: 100%; margin-top: 5px; padding: 3px 7px; background: var(--ink); color: var(--bg);
  font-size: clamp(10px, .85vw, 12px); font-weight: 600; letter-spacing: .01em; line-height: 1.3; overflow-wrap: anywhere;
}
.tile-led {
  position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); opacity: 0;
}
.tile:hover .tile-img, .tile:focus-visible .tile-img { transform: scale(1.04); }
.tile:hover .tile-shade, .tile:focus-visible .tile-shade,
.tile.is-current .tile-shade { opacity: 1; }
.tile:hover .tile-text, .tile:focus-visible .tile-text,
.tile.is-current .tile-text { opacity: 1; transform: translateY(0); }
.tile.is-current .tile-led { opacity: 1; }
.tile.is-current.is-playing .tile-led { animation: led 1.2s ease-in-out infinite; }

/* No hover on touch screens: details always visible */
@media (hover: none) {
  .tile .tile-img { transform: scale(1.04); }
  .tile .tile-shade { opacity: 1; }
  .tile .tile-text { opacity: 1; transform: translateY(0); }
}

/* ---------- Services ---------- */
.services { padding: var(--section-y) var(--gutter); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.service-list { list-style: none; margin: 0; padding: 0; grid-column: span 2; display: grid; border-top: 1px solid var(--line); }
.service-list li {
  display: grid; grid-template-columns: 48px minmax(0, 220px) 1fr; gap: 16px; padding: 20px 0;
  border-bottom: 1px solid var(--line); align-items: baseline;
}
.service-n { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.service-name { font-size: clamp(18px, 1.6vw, 22px); font-weight: 600; }
.service-line { grid-column: 3; color: var(--ink-3); font-size: clamp(15px, 1.2vw, 17px); line-height: 1.5; text-wrap: pretty; }

/* ---------- About ---------- */
.about {
  position: relative; min-height: 80svh; display: grid; align-content: end; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.about-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.about-shade { position: absolute; inset: 0; background: linear-gradient(to top, #141210 12%, #141210c0 55%, #14121040 100%); }
.about-body { position: relative; padding: clamp(120px, 20vh, 240px) var(--gutter) var(--section-y); }
.about-text {
  grid-column: span 2; display: grid; gap: 20px; max-width: 60ch;
  font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; color: var(--ink); text-wrap: pretty;
}
.about-text p { margin: 0; }

/* ---------- Entropy ---------- */
.entropy {
  position: relative; overflow: hidden; background: var(--e-bg); color: var(--e-ink);
  padding: var(--section-y-lg) var(--gutter);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(32px, 5vw, 80px); align-items: center; border-bottom: 1px solid var(--line);
}
.entropy-backdrop { position: absolute; inset: 0; pointer-events: none; }
.entropy-gigs { position: absolute; inset: -6%; }
.entropy-gigs img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(9px) saturate(.85) brightness(.8); opacity: 0;
  animation: gigfade 45s ease-in-out infinite;
}
.entropy-gigs img:nth-child(2) { animation-delay: -9s; }
.entropy-gigs img:nth-child(3) { animation-delay: -18s; }
.entropy-gigs img:nth-child(4) { animation-delay: -27s; }
.entropy-gigs img:nth-child(5) { animation-delay: -36s; }
.entropy-veil {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(8,7,10,.86) 0%, rgba(8,7,10,.5) 50%, rgba(8,7,10,.3) 100%);
}
.entropy-body { position: relative; display: grid; gap: 20px; min-width: 0; }
.entropy-label { font-family: var(--mono); font-size: 12px; letter-spacing: .2em; color: var(--e-label); }
.entropy-title {
  margin: 0; font-family: var(--mono); font-size: clamp(16px, 2.3vw, 48px); line-height: 1;
  letter-spacing: .12em; font-weight: 500; color: var(--e-ink); white-space: nowrap;
}
.entropy-text { margin: 0; font-size: clamp(16px, 1.4vw, 20px); color: var(--e-muted); max-width: 40ch; line-height: 1.5; }
.cta-pair-entropy { background: var(--e-line); border-color: var(--e-line); width: max-content; max-width: 100%; }
.cta-pair-entropy .cta, .cta-pair-entropy .cta:hover { padding: 0 18px; background: var(--e-bg); color: var(--e-ink); }
.cta-pair-entropy .cta:hover { background: var(--e-card); }
.cta-pair-entropy .cta-solid, .cta-pair-entropy .cta-solid:hover { background: var(--e-ink); color: var(--e-bg); }
.cta-pair-entropy .cta-solid:hover { background: #FFFFFF; }
.entropy-art {
  position: relative; aspect-ratio: 1; max-width: 520px; width: 100%; margin: 0 auto; display: grid;
  background: var(--e-card); border: 1px solid var(--e-line); box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.entropy-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entropy-art-tag {
  position: absolute; left: 12px; bottom: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--e-ink); background: rgba(8,7,10,.7); padding: 4px 8px;
}

/* ---------- Contact ---------- */
.contact {
  padding: var(--section-y-lg) var(--gutter); display: grid; gap: clamp(20px, 3vh, 32px);
  border-bottom: 1px solid var(--line);
}
.contact-text { margin: 0; font-size: clamp(19px, 1.7vw, 24px); color: var(--ink-2); max-width: 44ch; line-height: 1.45; }
.contact-email {
  font-size: clamp(22px, 5vw, 84px); letter-spacing: -0.03em; font-weight: 700; line-height: 1;
  word-break: break-all; text-transform: uppercase; font-stretch: 75%;
}
.contact-ig, .contact-ig:hover {
  font-family: var(--mono); font-size: clamp(15px, 1.6vw, 22px); letter-spacing: .04em; color: var(--accent);
}

/* ---------- Footer ---------- */
.footer {
  padding: 20px var(--gutter) 36px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--faint); text-transform: uppercase;
}

/* ---------- Player ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface);
  border-top: 1px solid var(--line-strong); box-shadow: 0 -20px 50px #00000080;
  transform: translateY(100%); transition: transform .5s var(--ease);
}
.player.is-visible { transform: none; }
.player-inner {
  max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: auto auto 1fr auto;
  gap: 14px; align-items: center; padding: 10px clamp(12px, 2vw, 24px);
}
.player-btn {
  width: 48px; height: 48px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink);
  display: grid; place-items: center; font-size: 14px; position: relative;
  transition: background-color .2s, border-color .2s;
}
.player-btn:hover { border-color: var(--muted); }
.player-led {
  position: absolute; top: 6px; left: 6px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: .25;
}
.player.is-playing .player-led { opacity: 1; }
.player-cover { width: 48px; height: 48px; background: var(--bg); overflow: hidden; display: block; }
.player-cover img { width: 100%; height: 100%; object-fit: cover; }
.player-mid { display: grid; gap: 6px; min-width: 0; }
.player-meta { display: flex; justify-content: space-between; gap: 12px; min-width: 0; font-family: var(--mono); font-size: 12px; }
.player-info { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title { color: var(--muted); }
.player-role { color: var(--accent); }
.player-time { color: var(--muted); white-space: nowrap; }
.player-seek { height: 30px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.player-seek span { flex: 1; background: var(--ink); opacity: .22; transition: opacity .2s; }
.player-seek span.is-played { opacity: 1; }
.player-links { display: flex; align-items: center; gap: 8px; }
.player-link, .player-link:hover {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; border: 1px solid var(--line-strong); padding: 0 12px; min-height: 44px;
  display: inline-flex; align-items: center; transition: color .2s, border-color .2s;
}
.player-link:hover { color: var(--ink); border-color: var(--muted); }
/* "Preview" tag: shown only when the player is on a 30s clip (full track via the links). */
.player-preview-tag {
  display: none; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); white-space: nowrap;
}
.player.is-preview .player-preview-tag { display: inline; }
@media (max-width: 819px) {
  .player-preview-tag { display: none !important; }
  .player-link { padding: 0 9px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
