/* ============================================================
   THE HALF SQUARE — assets/css/custom.css
   Unified global styling overrides on top of Bootstrap 5.

   Sections:
     1. Brand tokens (preserved palette & type)
     2. Base & Bootstrap overrides
     3. Viewfinder HUD (frame, navbar, timecode, bottom bar)
     4. Shared components (eyebrow, headings, buttons, chips)
     5. Media & placeholders
     6. Page sections (hero, ticker, departments, portfolio, contact)
     7. Motion (reveals, reduced-motion safety)
============================================================ */

/* ---------- 1. Brand tokens ---------- */
:root {
  --hs-bg:        #0A0A0C;                 /* screening-room black  */
  --hs-bg-soft:   #101013;
  --hs-ink:       #EDE7DB;                 /* projector-light ivory */
  --hs-muted:     #8F8A80;
  --hs-line:      rgba(237, 231, 219, .14);
  --hs-line-soft: rgba(237, 231, 219, .08);
  --hs-rec:       #E8362D;                 /* tally red             */
  --hs-ivory:     #EDE7DB;
  --hs-ivory-ink: #121114;
  --hs-ivory-muted:#6B665C;
  --hs-ivory-line: rgba(18, 17, 20, .16);

  --hs-display: 'Anton', sans-serif;
  --hs-body:    'Archivo', sans-serif;
  --hs-mono:    'IBM Plex Mono', monospace;
}

/* ---------- 2. Base & Bootstrap overrides ---------- */
body {
  background: var(--hs-bg);
  color: var(--hs-ink);
  font-family: var(--hs-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--hs-rec); color: var(--hs-ink); }
a { color: inherit; }
em.red { color: var(--hs-rec); font-style: normal; }
:focus-visible { outline: 2px solid var(--hs-rec); outline-offset: 3px; }

/* film-grain overlay — part of the preserved framing */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1060; pointer-events: none; opacity: .05;
  background-image: 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.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono { font-family: var(--hs-mono); }

/* ---------- 3. Viewfinder HUD ---------- */
/* corner brackets */
.hs-frame { position: fixed; inset: 12px; z-index: 1055; pointer-events: none; }
.hs-frame i { position: absolute; width: 22px; height: 22px; border: 0 solid var(--hs-line); }
.hs-frame i:nth-child(1) { top: 0; left: 0;  border-top-width: 1px; border-left-width: 1px; }
.hs-frame i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.hs-frame i:nth-child(3) { bottom: 0; left: 0;  border-bottom-width: 1px; border-left-width: 1px; }
.hs-frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

/* navbar: permanent dark translucent background + blur so links stay
   high-contrast even when the bar overlays the ivory sections       */
.hs-nav {
  background: rgba(10, 10, 12, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hs-line-soft);
}
.hs-nav .hs-wordmark {
  font-family: var(--hs-mono); font-size: 13px; font-weight: 500;
  letter-spacing: .12em; color: var(--hs-ink);
}
.hs-nav .nav-link {
  font-family: var(--hs-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--hs-muted);
  padding: .65rem 1rem; transition: color .2s;
}
.hs-nav .nav-link:hover,
.hs-nav .nav-link:focus { color: var(--hs-ink); }
.hs-nav .nav-link.active { color: var(--hs-ink); box-shadow: inset 0 -2px 0 var(--hs-rec); }
.hs-nav .navbar-toggler { border-color: var(--hs-line); }
.hs-nav .navbar-toggler:focus { box-shadow: 0 0 0 2px var(--hs-rec); }
/* expanded mobile menu keeps the solid dark panel behind the links */
@media (max-width: 991.98px) {
  .hs-nav .navbar-collapse { background: rgba(10, 10, 12, .97); margin: 0 -12px; padding: 8px 12px 16px; }
}

/* blinking tally + running timecode */
.hs-rec-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--hs-rec); box-shadow: 0 0 10px rgba(232, 54, 45, .8);
  animation: hs-blink 1.5s steps(1) infinite;
}
@keyframes hs-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .15; } }
.hs-timecode { font-family: var(--hs-mono); font-size: 12px; letter-spacing: .1em; color: var(--hs-muted); }
.hs-timecode b { color: var(--hs-ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.hs-rec-label { color: var(--hs-rec); }

/* bottom HUD bar */
.hs-hud-bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1050; height: 44px;
  padding: 0 clamp(20px, 4vw, 64px);
  font-family: var(--hs-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--hs-muted); pointer-events: none;
  background: linear-gradient(to top, rgba(10, 10, 12, .92), rgba(10, 10, 12, 0));
}

/* ---------- 4. Shared components ---------- */
.hs-section { padding: clamp(90px, 12vh, 150px) 0; }

.hs-eyebrow {
  font-family: var(--hs-mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--hs-rec);
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.hs-eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--hs-rec); }

.hs-h1, .hs-h2 {
  font-family: var(--hs-display); font-weight: 400;
  text-transform: uppercase; letter-spacing: .01em; line-height: .95;
}
.hs-h1 { font-size: clamp(60px, 12vw, 190px); line-height: .88; }
.hs-h2 { font-size: clamp(40px, 6vw, 88px); }
.hs-h3 {
  font-family: var(--hs-display); font-weight: 400;
  text-transform: uppercase; line-height: 1.05;
  font-size: clamp(22px, 2.4vw, 32px);
}
.hs-lede { color: var(--hs-muted); font-size: clamp(16px, 1.3vw, 19px); line-height: 1.65; max-width: 640px; }
.hs-lede em.red { color: var(--hs-ink); font-weight: 600; }

.btn-hs, .btn-hs-outline {
  font-family: var(--hs-mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; padding: 14px 26px; border-radius: 999px;
}
.btn-hs { background: var(--hs-rec); border: 1px solid var(--hs-rec); color: #fff; }
.btn-hs:hover, .btn-hs:focus { background: #fff; border-color: #fff; color: var(--hs-ivory-ink); }
.btn-hs-outline { background: transparent; border: 1px solid var(--hs-line); color: var(--hs-ink); }
.btn-hs-outline:hover, .btn-hs-outline:focus { border-color: var(--hs-ink); color: var(--hs-ink); }

.hs-chip {
  font-family: var(--hs-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; border: 1px solid var(--hs-line);
  border-radius: 999px; padding: 7px 14px; color: var(--hs-ink); display: inline-block;
}
.hs-tag { font-family: var(--hs-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--hs-muted); }
.hs-tag-red { color: var(--hs-rec); }

.hs-card { background: var(--hs-bg-soft); border: 1px solid var(--hs-line-soft); height: 100%; }
.hs-card:hover { background: #15151a; }

/* ---------- 5. Media & placeholders ---------- */
.hs-media { border: 1px solid var(--hs-line-soft); }
.hs-placeholder {
  width: 100%; aspect-ratio: 3 / 2;
  border: 1px dashed var(--hs-line); background: var(--hs-bg-soft);
  font-family: var(--hs-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--hs-muted); text-align: center; padding: 12px;
}
.hs-placeholder.ratio-16x9 { aspect-ratio: 16 / 9; }
.hs-placeholder.ratio-4x3  { aspect-ratio: 4 / 3;  }
.hs-embed iframe { border: 1px solid var(--hs-line-soft); }

/* ---------- 6. Page sections ---------- */
/* hero */
.hs-hero { min-height: 92svh; display: flex; align-items: center; padding-top: 120px; position: relative; }
.hs-hero-bg { position: absolute; inset: 0; overflow: hidden; z-index: -1; }
.hs-hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.hs-hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--hs-bg) 5%, transparent 60%); }
.hs-hero .dot { color: var(--hs-rec); }
.hs-hero-eyebrow {
  font-family: var(--hs-mono); font-size: clamp(10px, 1.1vw, 12px);
  letter-spacing: .24em; text-transform: uppercase; color: var(--hs-muted);
}
.hs-hero-sub { color: var(--hs-muted); font-size: clamp(15px, 1.3vw, 18px); max-width: 520px; }
.hs-hero-sub em.red { color: var(--hs-ink); font-weight: 600; }

/* ticker */
.hs-ticker { border-block: 1px solid var(--hs-line); overflow: hidden; white-space: nowrap; padding: 18px 0; background: var(--hs-bg-soft); }
.hs-ticker-track { display: inline-flex; animation: hs-scroll 40s linear infinite; }
@keyframes hs-scroll { to { transform: translateX(-50%); } }
.hs-ticker span {
  font-family: var(--hs-mono); font-size: 13px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--hs-muted); padding: 0 28px;
}
.hs-ticker span::after { content: "✦"; color: var(--hs-rec); margin-left: 56px; }

/* stats */
.hs-stat b { display: block; font-family: var(--hs-mono); font-weight: 500; font-size: clamp(28px, 3vw, 44px); font-variant-numeric: tabular-nums; }
.hs-stat span { font-family: var(--hs-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--hs-muted); }
.hs-manifesto { font-weight: 600; font-size: clamp(24px, 3.2vw, 46px); line-height: 1.2; letter-spacing: -.01em; }
.hs-manifesto .dim { color: var(--hs-muted); font-weight: 500; }

/* departments (services page) */
.hs-dept { border-top: 1px solid var(--hs-line); padding: clamp(36px, 5vh, 56px) 0; }
.hs-dept:last-child { border-bottom: 1px solid var(--hs-line); }
.hs-dept .hs-no { font-family: var(--hs-mono); font-size: 12px; letter-spacing: .16em; color: var(--hs-muted); }
.hs-list-item { font-size: 15px; font-weight: 500; padding: 13px 16px; background: var(--hs-bg-soft); border-left: 2px solid transparent; }
.hs-list-item:hover { border-color: var(--hs-rec); background: #15151a; }

/* rack columns (sound department) */
.hs-rack-col { background: var(--hs-bg-soft); border: 1px solid var(--hs-line-soft); padding: clamp(24px, 2.6vw, 36px); height: 100%; }
.hs-rack-col h3 {
  font-family: var(--hs-mono); font-size: 11px; font-weight: 500; letter-spacing: .18em;
  text-transform: uppercase; color: var(--hs-rec); margin-bottom: 20px;
  padding-bottom: 14px; border-bottom: 1px solid var(--hs-line);
}
.hs-rack-col li { font-size: 14.5px; font-weight: 500; padding: 10px 0; border-bottom: 1px solid var(--hs-line-soft); }
.hs-rack-col li:last-child { border-bottom: 0; }
.hs-rack-col li::before { content: "— "; color: var(--hs-muted); font-family: var(--hs-mono); font-size: 11px; }
.hs-cred { border: 1px solid var(--hs-line); background: var(--hs-bg-soft); padding: clamp(22px, 2.6vw, 32px); }
.hs-cred p em.red { color: var(--hs-ink); font-weight: 600; }

/* picture rows */
.hs-pic-row { border-bottom: 1px solid var(--hs-line); padding: clamp(22px, 3vh, 34px) 0; }
.hs-pic-row:first-child { border-top: 1px solid var(--hs-line); }
.hs-pic-row p { color: var(--hs-muted); font-size: 15px; margin: 0; max-width: 640px; }
.hs-pic-row p em.red { color: var(--hs-ink); font-weight: 600; }

/* portfolio */
.hs-work-card { background: var(--hs-bg-soft); border: 1px solid var(--hs-line-soft); height: 100%; transition: border-color .2s; }
.hs-work-card:hover { border-color: var(--hs-line); }
.hs-work-body { padding: 20px 22px 24px; }
.hs-social {
  font-family: var(--hs-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--hs-line); border-radius: 999px; padding: 12px 22px;
  color: var(--hs-ink); text-decoration: none; display: inline-block; transition: border-color .2s, color .2s;
}
.hs-social:hover { border-color: var(--hs-rec); color: var(--hs-rec); }
.hs-social.disabled { opacity: .45; pointer-events: none; }

/* contact */
.hs-form label { font-family: var(--hs-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--hs-muted); margin-bottom: 7px; }
.hs-form .form-control, .hs-form .form-select {
  background: var(--hs-bg-soft); border: 1px solid var(--hs-line);
  color: var(--hs-ink); border-radius: 6px; padding: 12px 14px;
}
.hs-form .form-control:focus, .hs-form .form-select:focus {
  background: var(--hs-bg-soft); color: var(--hs-ink);
  border-color: var(--hs-rec); box-shadow: 0 0 0 3px rgba(232, 54, 45, .18);
}
.hs-form .form-control::placeholder { color: rgba(143, 138, 128, .6); }
.hs-form .form-select { appearance: auto; }
.hs-form .form-select option { background: var(--hs-bg-soft); color: var(--hs-ink); }
.hs-info-card { background: var(--hs-bg-soft); border: 1px solid var(--hs-line-soft); padding: 24px; height: 100%; }
.hs-info-card a { font-weight: 600; text-decoration: none; }
.hs-info-card a:hover { color: var(--hs-rec); }
.hs-alert-ok  { border: 1px solid rgba(63, 185, 107, .5); background: rgba(63, 185, 107, .1); color: #7ED6A0; }
.hs-alert-err { border: 1px solid rgba(232, 54, 45, .5);  background: rgba(232, 54, 45, .1);  color: #F08A84; }
.hs-map iframe { border: 1px solid var(--hs-line-soft); width: 100%; height: 380px; }

/* footer (preserved design) */
.hs-footer {
  padding: 32px 0 64px; border-top: 1px solid var(--hs-line);
  font-family: var(--hs-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--hs-muted);
}
.hs-footer .hs-rec-dot { width: 7px; height: 7px; }

/* ---------- 7. Motion ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hs-rec-dot { animation: none; }
  .hs-ticker-track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
