/* ============ BERN FILM ============ */

/* ---------- Fonts (self-hosted, latin + latin-ext) ---------- */
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/playfair-display-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/playfair-display-700italic.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #141210;
  --bg-deep: #0E0C0A;
  --surface: #1D1915;
  --surface-2: #262019;
  --line: rgba(242, 237, 228, 0.08);
  --line-strong: rgba(242, 237, 228, 0.16);
  --text: #F2EDE4;
  --text-dim: #A99F8F;
  --text-faint: #6E665A;
  --gold: #E0C048;
  --gold-dim: rgba(224, 192, 72, 0.55);
  --orange: #F07830;
  --orange-hot: #FF8A42;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-brand: cubic-bezier(0.16, 1, 0.3, 1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  color-scheme: dark;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.4vw + 0.9rem, 1.125rem);
  line-height: 1.65;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--gold); text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; }
::selection { background: var(--gold); color: #141210; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 4px; }

.container { width: min(1160px, 100% - 40px); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip {
  position: fixed; top: -60px; left: 16px; z-index: 100;
  background: var(--orange); color: #141210; font-weight: 500;
  padding: 12px 18px; border-radius: 8px; transition: top 0.2s;
}
.skip:focus-visible { top: 12px; }

/* ---------- Scrubber (scroll progress) ---------- */
.scrubber {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: rgba(224, 192, 72, 0.14);
}
.scrubber__fill {
  position: absolute; inset: 0; background: var(--gold);
  transform: scaleX(0); transform-origin: left; will-change: transform;
}
.scrubber__head {
  position: absolute; top: 50%; left: 0; width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px var(--bg);
  will-change: transform;
}
.scrubber__ticks span {
  position: absolute; top: 0; width: 1px; height: 3px;
  background: rgba(224, 192, 72, 0.5);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: transform 0.32s var(--ease-out), background-color 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav--solid { background: rgba(20, 18, 16, 0.92); border-bottom-color: var(--line); }
.nav__inner {
  width: min(1160px, 100% - 40px); margin-inline: auto;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.brand__bern { font-family: var(--serif); font-weight: 700; font-size: 16px; letter-spacing: 0.06em; color: var(--text); }
.brand__line { position: relative; height: 2px; background: var(--gold); border-radius: 1px; }
.brand__dot {
  position: absolute; left: 30%; top: 50%; width: 6px; height: 6px;
  border-radius: 50%; background: var(--orange); transform: translate(-50%, -50%);
  transition: left 0.35s var(--ease-out);
}
.brand:hover .brand__dot { left: 78%; }
.brand__film { font-family: var(--mono); font-size: 8px; letter-spacing: 0.52em; color: var(--gold); text-transform: uppercase; }

.nav__links { display: none; }
.nav__right { display: flex; align-items: center; gap: 14px; }

.tc {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em;
  color: var(--text-faint); font-variant-numeric: tabular-nums;
  transition: color 0.4s ease;
}
.tc__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); opacity: 0.4; }
html.scrolling .tc { color: var(--gold); }
html.scrolling .tc__dot { opacity: 1; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0.15; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.btn--primary { background: var(--orange); color: #141210; }
.btn--primary:hover { background: var(--orange-hot); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--gold); padding: 0 10px; }
.btn--ghost:hover { color: var(--orange-hot); }
.btn--pill {
  min-height: 44px; padding: 0 18px; font-size: 12px;
  background: transparent; border: 1px solid rgba(240, 120, 48, 0.8); color: var(--text);
}
.btn--pill:hover { background: var(--orange); color: #141210; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: 110px 0 90px;
  background: radial-gradient(120% 90% at 50% 0%, #1A1613 0%, var(--bg) 55%, var(--bg-deep) 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: var(--grain); background-size: 140px; opacity: 0.05; pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }
.hero__rule {
  display: block; position: relative; width: min(300px, 58%); height: 2px;
  background: var(--gold); margin-bottom: 26px; transform-origin: left;
}
.hero__rule-dot {
  position: absolute; right: -4px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: var(--orange);
}
.hero__kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 20px;
}
.hero__title {
  font-size: clamp(2.35rem, 7.5vw + 0.5rem, 5.4rem);
  letter-spacing: -0.015em; line-height: 1.06; margin-bottom: 26px;
}
.line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.line__inner { display: inline-block; }
.mark { font-style: italic; color: var(--text); position: relative; padding: 0 0.1em; }
.mark::before, .mark::after {
  font-family: var(--mono); font-style: normal; font-size: 0.62em;
  color: var(--orange); position: relative; top: -0.08em;
}
.mark::before { content: "["; margin-right: 0.06em; }
.mark::after { content: "]"; margin-left: 0.06em; }
.hero__sub { color: var(--text-dim); max-width: 44ch; margin-bottom: 38px; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }

.scrollcue {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scrollcue__label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--text-faint);
}
.scrollcue__track { position: relative; width: 2px; height: 44px; background: var(--gold-dim); overflow: hidden; border-radius: 1px; }
.scrollcue__dot {
  position: absolute; left: 50%; top: 0; width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: var(--orange);
  animation: cue-slide 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes cue-slide {
  0% { transform: translateY(-6px); opacity: 0; }
  18% { opacity: 1; }
  82% { opacity: 1; }
  100% { transform: translateY(46px); opacity: 0; }
}

/* Hero entrance (only when JS present) */
html.js .hero__rule { animation: draw-x 0.7s var(--ease-brand) both; }
html.js .hero__rule-dot { animation: fade-in 0.35s ease 0.6s both; }
html.js .hero__kicker { animation: fade-up 0.5s var(--ease-out) 0.25s both; }
html.js .line:nth-child(1) .line__inner { animation: mask-up 0.75s var(--ease-brand) 0.4s both; }
html.js .line:nth-child(2) .line__inner { animation: mask-up 0.75s var(--ease-brand) 0.55s both; }
html.js .mark::before { animation: pop-in 0.35s var(--ease-out) 1.15s both; }
html.js .mark::after { animation: pop-in 0.35s var(--ease-out) 1.25s both; }
html.js .hero__sub { animation: fade-up 0.6s var(--ease-out) 0.95s both; }
html.js .hero__cta { animation: fade-up 0.6s var(--ease-out) 1.1s both; }
html.js .scrollcue { animation: fade-in 0.8s ease 1.6s both; }

@keyframes draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes mask-up { from { transform: translateY(112%); } to { transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }

/* ---------- Stats strip ---------- */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 34px 0; }
.stats__list { display: grid; gap: 22px; }
.stats__list li { display: flex; align-items: baseline; gap: 14px; }
.stats__num { font-family: var(--serif); font-weight: 700; font-size: clamp(1.7rem, 5.5vw, 2.4rem); color: var(--text); }
.stats__label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-dim);
}

/* ---------- Sections ---------- */
.section { padding: 92px 0; }
.scene {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 22px;
}
.scene::before { content: ""; width: 26px; height: 1px; background: var(--gold); }
.section__head { position: relative; border-left: 2px solid var(--gold); padding-left: 20px; margin-bottom: 44px; }
.section__head::before, .section__head::after {
  content: ""; position: absolute; left: -2px; width: 10px; height: 2px; background: var(--gold);
}
.section__head::before { top: 0; }
.section__head::after { bottom: 0; }
.section__head h1, .section__head h2 { font-size: clamp(1.75rem, 5.5vw, 3rem); letter-spacing: -0.01em; }
.section--top { padding-top: clamp(130px, 16vh, 170px); }
.section__intro { color: var(--text-dim); max-width: 52ch; margin: 14px 0 0; }

/* ---------- Portfolio / clips ---------- */
.clips { display: grid; gap: 20px; }
.clip { margin: 0; }
.clip__btn {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--surface); cursor: pointer;
}
.clip__btn img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.45s var(--ease-out);
}
.clip__btn:hover img { transform: scale(1.03); }
.clip__scrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: linear-gradient(to top, rgba(14, 12, 10, 0.78), transparent);
}
.clip__play {
  position: absolute; top: 50%; left: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; background: var(--orange); color: #141210;
  display: grid; place-items: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.clip__play svg { margin-left: 3px; }
.clip__btn:hover .clip__play { transform: scale(1.08); background: var(--orange-hot); }
.clip__meta {
  position: absolute; left: 14px; bottom: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(242, 237, 228, 0.88);
}
.clip__razor {
  position: absolute; top: 0; bottom: 0; left: 0; width: 1px;
  background: rgba(242, 237, 228, 0.9); opacity: 0; pointer-events: none;
}
.clip__razor-tc {
  position: absolute; top: 10px; left: 7px;
  font-family: var(--mono); font-size: 11px; color: var(--text);
  background: rgba(14, 12, 10, 0.72); padding: 2px 7px; border-radius: 4px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.clip__btn.is-scrubbed .clip__razor { opacity: 1; }
.clip__frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.clip__cap { margin: 14px 0 0; }
.clip__cap strong { display: block; font-weight: 500; color: var(--text); }
.clip__cap span { display: block; font-size: 0.9rem; color: var(--text-dim); margin-top: 2px; }
.clips__more { color: var(--text-dim); font-size: 0.92rem; margin: 30px 0 6px; }
.link-ghost { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }
.link-ghost:hover { color: var(--orange-hot); }
.clips__links {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 4px 32px; margin-top: 6px;
}

/* ---------- Services / tracks ---------- */
.tracks { display: grid; gap: 14px; }
.track {
  display: flex; gap: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 24px 22px;
  transition: background-color 0.25s ease, transform 0.25s var(--ease-out), border-color 0.25s ease;
}
.track:hover { background: var(--surface-2); border-color: var(--line-strong); transform: translateX(4px); }
.track__id {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--gold-dim); min-width: 26px; padding-top: 7px;
  transition: color 0.25s ease;
}
.track:hover .track__id { color: var(--orange); }
.track--audio .track__id { color: var(--orange); }
.track__body h3 { font-size: clamp(1.2rem, 2vw + 0.5rem, 1.5rem); margin-bottom: 10px; }
.track__body p { color: var(--text-dim); font-size: 0.97rem; }
.track__meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin-top: 12px;
}
.midcta { margin-top: 40px; color: var(--text-dim); }
.midcta a { font-weight: 500; }
.midcta a:hover { color: var(--orange-hot); }

/* ---------- About ---------- */
.about { display: grid; gap: 40px; }
.about__text p { color: var(--text-dim); max-width: 62ch; }
.wave { width: 100%; max-width: 330px; height: auto; }
.about__facts {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); margin-top: 16px;
}

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 28px; max-width: 62ch; }
.faq__item h3 { font-size: 1.15rem; margin-bottom: 8px; }
.faq__item p { color: var(--text-dim); font-size: 0.97rem; }

/* ---------- Contact ---------- */
.section--contact { padding-bottom: 110px; }
.email-box { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin: 34px 0 42px; }
.email-box__addr {
  font-family: var(--mono); font-size: clamp(1.1rem, 4.5vw, 1.55rem);
  color: var(--text); user-select: all; letter-spacing: 0.01em; overflow-wrap: anywhere;
}
a.email-box__addr:hover { color: var(--gold); }
.btn--copy { min-width: 210px; }
.btn--copy.is-copied { background: var(--gold); color: #141210; }
.socials li { border-top: 1px solid var(--line); }
.socials li:last-child { border-bottom: 1px solid var(--line); }
.socials a {
  display: flex; align-items: center; gap: 16px; min-height: 62px; padding: 8px 4px;
  color: var(--text); transition: background-color 0.2s ease;
}
.socials a:hover { background: rgba(242, 237, 228, 0.03); }
.socials svg { color: var(--gold); flex: none; transition: color 0.2s ease; }
.socials a:hover svg { color: var(--orange); }
.socials__name { font-weight: 500; }
.socials__handle { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-left: auto; }
.socials__arrow { color: var(--text-faint); transition: transform 0.2s var(--ease-out), color 0.2s ease; }
.socials a:hover .socials__arrow { transform: translateX(4px); color: var(--gold); }

/* ---------- Footer ---------- */
.foot { position: relative; background: var(--bg-deep); border-top: 1px solid var(--line); padding: 56px 0 44px; }
.foot::after {
  content: ""; position: absolute; inset: 0; background-image: var(--grain);
  background-size: 140px; opacity: 0.04; pointer-events: none;
}
.foot .container { position: relative; z-index: 1; }
.foot__slate {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 24px;
}
.foot__brand { color: var(--text-dim); margin-bottom: 6px; }
.foot__brand strong { color: var(--text); }
.brand-film { color: var(--gold); }
.foot__note {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 20px;
}
.foot__legal { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 26px; }
.foot__top {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
}
.foot__top:hover { color: var(--orange-hot); }

/* ---------- Reveal on scroll (JS adds .in-view) ---------- */
html.js [data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
html.js [data-reveal].in-view { opacity: 1; transform: none; }

/* ---------- Desktop ---------- */
@media (min-width: 640px) {
  .email-box { flex-direction: row; align-items: center; gap: 24px; }
}
@media (min-width: 900px) {
  .nav__links { display: flex; gap: 28px; }
  .nav__links a {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-dim); position: relative; padding: 6px 0; transition: color 0.2s ease;
  }
  .nav__links a span { color: var(--gold-dim); margin-right: 2px; }
  .nav__links a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
    background: var(--gold); transform: scaleX(0); transform-origin: left;
    transition: transform 0.25s var(--ease-out);
  }
  .nav__links a:hover { color: var(--gold); }
  .nav__links a:hover::after { transform: scaleX(1); }
  .stats__list { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .stats__list li { flex-direction: column; align-items: flex-start; gap: 6px; border-left: 1px solid var(--line); padding-left: 22px; }
}
@media (min-width: 1024px) {
  .nav--solid { backdrop-filter: blur(12px); background: rgba(20, 18, 16, 0.82); }
  .nav__inner { height: 72px; }
  .section { padding: 128px 0; }
  .tracks { gap: 16px; }
  .track:nth-child(2) { margin-left: 56px; }
  .track:nth-child(3) { margin-left: 112px; }
  .track:nth-child(4) { margin-left: 168px; }
  .about { grid-template-columns: 7fr 5fr; gap: 64px; align-items: start; }
  .about__visual { position: sticky; top: 120px; }
  .clips--grid { display: block; columns: 3; column-gap: 20px; }
  .clips--grid .clip { break-inside: avoid; margin-bottom: 20px; }
}

@media (max-height: 620px) {
  .scrollcue { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js [data-reveal] { opacity: 1; transform: none; }
  .scrollcue__dot { animation: none; transform: translateY(18px); opacity: 1; }
  html.scrolling .tc__dot { animation: none; }
}
