/* ===========================================================
   BITGRAIN — design tokens
   =========================================================== */
:root {
  --bg: #0a0d1a;
  --bg-raised: #12152a;
  --line: #262b45;
  --text: #f3f2ee;
  --text-dim: #8a8fa6;
  --accent: #e8a33d;

  /* Gotham is a paid, licensed typeface — it can't be pulled from a free
     font CDN. This is set up so that if you own Gotham's font files, you
     drop them in /assets/fonts and swap the @font-face src below; every
     element already points at --font-display / --font-body, so nothing
     else needs to change. Until then this uses Poppins, the closest
     freely-licensed match to Gotham's geometric proportions. */
  --font-display: "Poppins", sans-serif;
  --font-body: "Poppins", sans-serif;
  --font-mono: "Poppins", sans-serif;

  --nav-h: 76px;
  --edge: clamp(20px, 5vw, 64px);
}

/* If you get licensed Gotham font files, uncomment and point these at
   your files (Gotham typically ships as Book/Medium/Bold weights):

@font-face {
  font-family: "Gotham";
  src: url("assets/fonts/Gotham-Book.woff2") format("woff2");
  font-weight: 400;
}
@font-face {
  font-family: "Gotham";
  src: url("assets/fonts/Gotham-Medium.woff2") format("woff2");
  font-weight: 500;
}
@font-face {
  font-family: "Gotham";
  src: url("assets/fonts/Gotham-Bold.woff2") format("woff2");
  font-weight: 700;
}

  ...then change the three --font-* variables above to "Gotham", sans-serif */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* film-grain overlay — subtle animated noise across the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1s steps(4) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1%, 1%); }
  50% { transform: translate(1%, -1%); }
  75% { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

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

/* ===========================================================
   Timecode ruler — the recurring signature divider
   =========================================================== */
.ruler {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--edge);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.ruler .tc { color: var(--accent); font-variant-numeric: tabular-nums; }

.ruler .ticks {
  flex: 1;
  height: 1px;
  background-image: repeating-linear-gradient(
    to right,
    var(--line) 0,
    var(--line) 1px,
    transparent 1px,
    transparent 12px
  );
}

/* ===========================================================
   Nav
   =========================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--edge);
  background: rgba(10, 13, 26, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  align-items: center;
}

.wordmark img {
  height: 22px;
  width: auto;
  display: block;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.nav-links {
  display: flex;
  gap: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links a {
  color: var(--text-dim);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  border-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a {
    padding: 16px var(--edge);
    border-bottom: 1px solid var(--line);
    width: 100%;
  }
  .nav-toggle { display: block; }
}

/* ===========================================================
   Footer
   =========================================================== */
.site-footer {
  padding: 48px var(--edge) 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.site-footer a { transition: color 0.2s ease; }
.site-footer a:hover { color: var(--accent); }

.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }

/* ===========================================================
   Buttons / form fields
   =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border: 1px solid var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

input, textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 16px;
  margin-bottom: 24px;
  transition: border-color 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea { min-height: 160px; resize: vertical; }

/* ===========================================================
   Reusable page furniture
   =========================================================== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

.page-header {
  padding: 72px var(--edge) 48px;
  max-width: 900px;
}

.page-header h1 { font-size: clamp(36px, 5vw, 56px); }

.page-header .lede {
  margin-top: 20px;
  font-size: 19px;
  color: var(--text-dim);
  max-width: 640px;
}

/* ===========================================================
   Home — hero
   =========================================================== */
.hero {
  padding: 88px var(--edge) 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero .eyebrow { display: flex; align-items: center; gap: 10px; justify-content: center; }

.hero .hero-logo {
  height: clamp(48px, 8vw, 96px);
  width: auto;
  margin: 8px 0;
}

.hero .lede {
  margin-top: 24px;
  font-size: 20px;
  color: var(--text-dim);
  max-width: 620px;
}

/* ===========================================================
   Reel blocks
   =========================================================== */
.reel-row {
  padding: 40px var(--edge) 56px;
  display: flex;
  align-items: stretch;
  gap: 24px;
}

.reel-col.short { flex: 0 0 auto; width: min(320px, 34vw); }
.reel-col.long { flex: 1 1 auto; min-width: 0; }

.reel-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .reel-row { flex-direction: column; }
  .reel-col.short { width: 100%; max-width: 320px; margin: 0 auto; }
  .reel-col.long { width: 100%; }
}

.reel-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.reel-label .name { color: var(--text); font-size: 14px; }
.reel-label .tc { color: var(--accent); font-variant-numeric: tabular-nums; }

.reel-frame {
  position: relative;
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  overflow: hidden;
}

.reel-frame.long { aspect-ratio: 16 / 9; }

/* The short reel now holds a real Instagram embed, whose height is set by
   Instagram's own script rather than our CSS — so this box sizes to its
   content instead of a forced aspect-ratio, and .reel-col's
   justify-content: flex-end (above) is what actually lines the two
   frames' bottoms up, however tall the Instagram card ends up being. */
.reel-frame.short { overflow: visible; border: none; background: transparent; }

.reel-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.reel-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-frame .placeholder-msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 18px,
      rgba(255,255,255,0.02) 18px,
      rgba(255,255,255,0.02) 19px
    );
}

.play-glyph {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-glyph::after {
  content: "";
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid var(--text-dim);
  margin-left: 3px;
}

/* ===========================================================
   Grids — case studies
   =========================================================== */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 40px 28px;
  margin: 0 var(--edge) 80px;
  width: calc(100% - var(--edge) * 2);
}

.case-card {
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.case-thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-raised);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.case-thumb[data-yt] {
  cursor: pointer;
}

.case-thumb[data-yt] .play-glyph {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 13, 26, 0.55);
  transition: background 0.2s ease, transform 0.2s ease;
}

.case-thumb[data-yt]:hover .play-glyph,
.case-thumb[data-yt]:focus-visible .play-glyph {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.08);
}

.case-thumb[data-yt]:hover .play-glyph::after,
.case-thumb[data-yt]:focus-visible .play-glyph::after {
  border-left-color: var(--bg);
}

.case-thumb[data-yt]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.case-thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.case-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-grid.vertical .case-thumb { aspect-ratio: 9 / 14; }

/* Instagram embeds set their own height via Instagram's script, so this
   variant sizes to its content instead of the fixed aspect-ratio above. */
.case-thumb.ig {
  aspect-ratio: unset;
  overflow: visible;
  background: transparent;
  display: block;
}

.yt-external {
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.yt-external:hover { color: var(--accent); }

.case-thumb .tc-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.case-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.case-card h3 { font-size: 20px; }

.case-card p.desc {
  color: var(--text-dim);
  font-size: 15px;
}

.case-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 4px 8px;
}

/* ===========================================================
   About page
   =========================================================== */
.about-body {
  padding: 0 var(--edge) 64px;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: 18px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 var(--edge) 64px;
}

.stat {
  padding: 28px 16px;
  border-right: 1px solid var(--line);
}

.stat:last-child { border-right: none; }

.stat .num {
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--accent);
}

.stat .label {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ===========================================================
   Contact page
   =========================================================== */
.contact-wrap {
  padding: 0 var(--edge) 80px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
}

@media (max-width: 860px) {
  .contact-wrap { grid-template-columns: 1fr; }
}

.contact-info {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-info .block-label {
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 6px;
  display: block;
}

.contact-info a:hover { color: var(--text); }
