/* ============================================================
   GUMMERSON DIGITAL — immersive site
   Design tokens pulled from the Gummerson Digital Figma system.
   ============================================================ */

@font-face {
  font-family: "LTC Bodoni 175";
  src: url("../fonts/ltc-bodoni-175-smallcaps-italic.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* brand colors */
  --red:      #ff3c26;   /* primary / action     */
  --teal:     #00a896;   /* accent / digital     */
  --forest:   #006b5e;   /* secondary accent     */
  --charcoal: #2d2d2d;   /* background / base    */
  --black:    #1a1a1a;   /* body / dark surfaces */
  --cream:    #f5f0e8;   /* light background     */
  --white:    #ffffff;

  --ink-dark: #1a1a1a;   /* text on light */
  --ink-light: #f5f0e8;  /* text on dark  */

  --display: "LTC Bodoni 175", "Bodoni Moda", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;

  --ac: var(--red);      /* per-element accent, overridden by [data-accent] */
  --maxw: 1180px;
}

/* accent mapping */
[data-accent="red"]      { --ac: var(--red); }
[data-accent="teal"]     { --ac: var(--teal); }
[data-accent="forest"]   { --ac: var(--forest); }
[data-accent="charcoal"] { --ac: var(--charcoal); }
[data-accent="cream"]    { --ac: var(--cream); }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--ink-light);
  font-family: var(--body);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--red); color: var(--white); }

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

/* ---------- fixed WebGL layers ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* distressed grain — "inspired by the streets" */
#grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%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)' opacity='0.32'/%3E%3C/svg%3E");
}

#veil {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 60;
  pointer-events: none;
  transition: opacity 1.3s ease;
}
#veil.gone { opacity: 0; }

/* ============ NAV ============ */

#nav {
  position: fixed;
  top: 66px;
  left: clamp(14px, 3vw, 30px);
  right: clamp(14px, 3vw, 30px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 56px;
  padding: 8px 28px 8px 156px;
  background: rgba(24, 24, 26, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 6px solid var(--red);
  border-radius: 8px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.45);
  overflow: visible;
}

/* the 120px badge overflows the top and bottom of the floating bar */
#nav .brand {
  position: absolute;
  left: 38px; top: 50%;
  transform: translateY(-50%);
  width: 120px; height: 120px;
  display: block;
}
#nav .brand-mark {
  width: 120px; height: 120px; display: block;
  filter: drop-shadow(0 10px 22px rgba(255, 60, 38, 0.35));
}

.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); }
.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: rgba(245, 240, 232, 0.62);
  transition: color 0.25s ease;
}
.nav-links a:hover { color: var(--cream); }
.nav-links .nav-cta {
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 4px;
  transition: background 0.25s ease, color 0.25s ease;
}
.nav-links .nav-cta:hover { background: var(--teal); color: var(--white); }

/* ============ SECTION RAIL ============ */

#rail {
  position: fixed;
  right: 22px; top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#rail button {
  display: flex; align-items: center; flex-direction: row-reverse;
  gap: 10px; background: none; border: 0; cursor: pointer;
  color: #8a8a8a;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  font-family: var(--body); padding: 0;
}
#rail button i {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  border: 1px solid rgba(140, 140, 140, 0.7);
  background: rgba(140, 140, 140, 0.15);
  transition: all 0.35s ease;
}
/* labels are hover-only so they never overlap section content */
#rail button span {
  opacity: 0; transform: translateX(6px); transition: all 0.3s ease;
  padding: 3px 7px; border-radius: 3px;
  background: rgba(20, 20, 20, 0.8); color: var(--cream);
  backdrop-filter: blur(6px);
}
#rail button:hover span { opacity: 1; transform: none; }
#rail button.active i {
  background: var(--red); border-color: var(--red);
  box-shadow: 0 0 10px var(--red), 0 0 22px rgba(255, 60, 38, 0.5);
}
/* Contact section is red — switch its active dot to charcoal so it stays visible */
#rail button[data-target="contact"].active i {
  background: var(--charcoal); border-color: var(--charcoal);
  box-shadow: 0 0 10px rgba(45, 45, 45, 0.6), 0 0 22px rgba(45, 45, 45, 0.4);
}

/* ============ PROGRESS ============ */

#progress {
  position: fixed; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(245, 240, 232, 0.08); z-index: 45;
}
#progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--red), var(--teal));
  box-shadow: 0 0 12px rgba(0, 168, 150, 0.6);
}

/* ============ ROOMS (sections) ============ */

main { position: relative; z-index: 2; }

.room {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(90px, 12vh, 150px) clamp(22px, 6vw, 90px);
}

/* dark rooms let the red/teal world glow through frosted glass */
.room.dark {
  background: rgba(18, 18, 20, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  color: var(--ink-light);
}
.room.light {
  background: rgba(245, 240, 232, 0.94);
  color: var(--ink-dark);
}
.room.red {
  background: var(--red);
  color: var(--white);
}
#hero.dark { background: rgba(18, 18, 20, 0.28); }

/* shared heads */
.room-head { max-width: var(--maxw); margin: 0 auto 54px; width: 100%; }
.kicker {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.22em; color: var(--ac);
  margin-bottom: 16px;
}
.display {
  font-family: var(--display);
  font-weight: 400; font-style: normal;
  line-height: 0.98;
  letter-spacing: 0.01em;
}
.room.light .display { color: var(--black); }
.room.dark .display  { color: var(--cream); }
h2.display { font-size: clamp(42px, 7vw, 92px); }
.room-sub {
  margin-top: 22px; max-width: 54ch;
  font-size: clamp(15px, 1.3vw, 18px); line-height: 1.6;
  font-weight: 300;
}
.room.light .room-sub { color: rgba(26, 26, 26, 0.66); }
.room.dark .room-sub  { color: rgba(245, 240, 232, 0.66); }

/* ============ BUTTONS ============ */

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.btn {
  display: inline-block;
  font-family: var(--body); font-weight: 700; font-size: 15px;
  padding: 15px 30px; border-radius: 4px;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
/* Get Started — matches the navbar CTA (red → Electric Teal) */
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--teal); color: var(--white); }

/* See the Work + LinkedIn — ghost → solid white on hover */
.btn-ghostwhite {
  background: transparent; color: var(--white);
  box-shadow: inset 0 0 0 2px rgba(245, 240, 232, 0.7);
}
.btn-ghostwhite:hover {
  background: var(--white); color: var(--charcoal);
  box-shadow: inset 0 0 0 2px var(--white);
}

/* Email Mitch — cream → Deep Charcoal on hover */
.btn-oncontact { background: var(--cream); color: var(--red); }
.btn-oncontact:hover { background: var(--charcoal); color: var(--white); }

/* ============ STUDIO / MOVING PARTS ============ */

.studio-inner {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(36px, 5vw, 72px); align-items: center;
}
.studio-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.28em;
  text-transform: uppercase; color: rgba(245, 240, 232, 0.55); margin-bottom: 10px;
}
.studio-logo {
  display: block; width: clamp(240px, 38vw, 440px); height: auto;
}
.studio-tagline {
  font-size: clamp(19px, 2.1vw, 26px); font-weight: 400;
  color: var(--teal); margin-top: 22px;
}
.studio-lead {
  max-width: 52ch; margin-top: 18px; font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.6; font-weight: 300; color: rgba(245, 240, 232, 0.72);
}

.studio-panel {
  border: 1px solid rgba(245, 240, 232, 0.14); border-radius: 10px;
  background: rgba(18, 18, 20, 0.42); padding: clamp(26px, 3vw, 40px);
}
.studio-ethos { margin: 0 0 28px; padding: 0; list-style: none; display: grid; gap: 14px; }
.studio-ethos li {
  position: relative; padding-left: 22px;
  font-size: clamp(17px, 1.6vw, 21px); font-weight: 300; font-style: italic;
  line-height: 1.4; color: var(--cream);
}
.studio-ethos li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 12px; height: 2px; background: var(--red);
}
.studio-panel-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(245, 240, 232, 0.5); margin: 0 0 14px;
}
.studio-services {
  margin: 0 0 26px; padding: 0; list-style: none;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px;
}
.studio-services li {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 15px; font-weight: 400; color: rgba(245, 240, 232, 0.9);
}
.studio-services li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal); flex: none; transform: translateY(-1px);
}
.studio-clients {
  border-top: 1px solid rgba(245, 240, 232, 0.12); padding-top: 16px;
  font-size: 13px; line-height: 1.5; color: rgba(245, 240, 232, 0.62);
}
.studio-clients strong {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: rgba(245, 240, 232, 0.5); margin-bottom: 6px;
}

@media (max-width: 900px) {
  .studio-inner { grid-template-columns: 1fr; gap: 34px; }
}
@media (max-width: 560px) {
  .studio-services { grid-template-columns: 1fr; }
}

/* ============ HERO ============ */

#hero { justify-content: center; overflow: hidden; }
.hero-inner { max-width: var(--maxw); margin: 0 auto; width: 100%; position: relative; z-index: 3; }
.hero-inner .eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.28em;
  color: var(--ac); margin-bottom: 20px;
}
.wordmark {
  font-family: var(--body); font-weight: 900;
  font-size: clamp(54px, 11vw, 150px);
  line-height: 0.92; letter-spacing: -0.01em;
  color: var(--cream);
  text-shadow: 0 8px 60px rgba(0, 0, 0, 0.6);
}
.wordmark em { color: var(--red); font-style: normal; }
.accent-bars { display: flex; gap: 10px; margin: 24px 0 20px; }
.accent-bars i { display: block; height: 5px; border-radius: 2px; }
.accent-bars .bar-red  { width: 180px; background: var(--red); max-width: 42vw; }
.accent-bars .bar-teal { width: 60px;  background: var(--teal); }
.hero-tag {
  font-size: clamp(20px, 2.4vw, 26px); font-weight: 400;
  color: var(--teal); margin-bottom: 18px;
}
.hero-lead {
  max-width: 46ch; font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 300; line-height: 1.6; color: rgba(245, 240, 232, 0.82);
}
.scroll-hint {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 0.34em; color: rgba(245, 240, 232, 0.55);
  z-index: 3;
}
.scroll-hint .arrow { color: var(--teal); display: inline-block; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ============ SERVICE CARDS ============ */

.cards {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.card {
  border-radius: 8px; padding: 34px; border-left: 5px solid var(--ac);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative; overflow: hidden;
}
.card-light { background: var(--white); color: var(--ink-dark); }
.card-dark  { background: var(--charcoal); color: var(--cream); }
.card-red   { background: var(--red); color: var(--white); }
.card:hover { transform: translateY(-5px); box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28); }
.card-tag {
  font-family: var(--display); font-size: 34px; color: var(--ac);
  display: block; margin-bottom: 10px; line-height: 1;
}
.card-red .card-tag { color: rgba(255, 255, 255, 0.85); }
.card h3 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.card p { font-size: 15px; line-height: 1.6; font-weight: 400; }
.card-light p { color: rgba(26, 26, 26, 0.66); }
.card-dark p  { color: rgba(245, 240, 232, 0.7); }
.card-red p   { color: rgba(255, 255, 255, 0.86); }

/* ============ WORK GRID ============ */

.work-grid {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.logo-tile {
  display: flex; align-items: center; justify-content: center;
  min-height: 155px; padding: 34px;
  background: var(--cream); border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.logo-tile img {
  max-width: 80%; max-height: 70px; object-fit: contain;
  opacity: 0.72; transform: scale(var(--logo-scale, 1));
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.logo-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.32);
}
.logo-tile:hover img { opacity: 1; transform: scale(calc(var(--logo-scale, 1) * 1.05)); }

/* ============ ABOUT ============ */

.about-inner {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; align-items: center;
}
.about-copy .display { color: var(--black); font-size: clamp(40px, 6vw, 78px); margin-bottom: 10px; }
.about-body {
  font-size: clamp(16px, 1.4vw, 18px); line-height: 1.7;
  color: rgba(26, 26, 26, 0.74); margin-top: 18px; max-width: 52ch; font-weight: 400;
}
.chips { display: flex; gap: 8px; margin-top: 30px; }
.chips i { width: 26px; height: 26px; border-radius: 4px; display: block; }
.chip-red { background: var(--red); } .chip-teal { background: var(--teal); }
.chip-cream { background: var(--cream); box-shadow: inset 0 0 0 1px rgba(26,26,26,.15); }
.chip-forest { background: var(--forest); }
.about-photo {
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  background: var(--charcoal);
  border-left: 6px solid var(--red);
  position: relative; overflow: hidden;
}
.about-photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 20%;
  display: block;
}

/* ============ CONTACT ============ */

#contact { justify-content: center; }
.contact-inner { max-width: var(--maxw); margin: auto; width: 100%; }
.contact-inner .kicker { color: rgba(255, 255, 255, 0.7); }
.contact-display { color: var(--white); font-size: clamp(46px, 8vw, 104px); }
.contact-lead {
  margin-top: 22px; max-width: 44ch; font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.6; font-weight: 300; color: rgba(255, 255, 255, 0.88);
}

#footer {
  max-width: var(--maxw); margin: auto auto 0; width: 100%;
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 10px;
  padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.foot-word { font-weight: 900; font-size: 18px; color: var(--white); letter-spacing: 0.02em; }
.foot-studio { font-size: 13px; color: rgba(255, 255, 255, 0.62); }
.foot-studio-link {
  color: var(--white); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
  transition: opacity 0.2s ease;
}
.foot-studio-link:hover { opacity: 0.72; }
.foot-meta { font-size: 13px; color: rgba(255, 255, 255, 0.6); }

/* ============ RESPONSIVE ============ */

/* --- Tablet: keep cards 2-up, drop work grid to 3, tighten About, hide inline nav links --- */
@media (max-width: 900px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
  .about-inner { grid-template-columns: 1.2fr 1fr; gap: 40px; }
  .nav-links a:not(.nav-cta) { display: none; }
  /* Offset jump landings so the section headings clear the fixed nav badge on
     tablet/phone, where the layout tightens. Desktop doesn't overlap, so it
     gets no offset (the landing stays centered). */
  #services, #work { scroll-margin-top: 96px; }
}

/* --- Small tablet / large phone: single-column cards, 2-up work grid, stack About --- */
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .about-inner { grid-template-columns: 1fr; gap: 40px; }
  .about-photo { max-width: 400px; margin-inline: auto; }
}

/* --- Phone --- */
@media (max-width: 520px) {
  #rail { display: none; }
  #nav { top: max(28px, env(safe-area-inset-top)); min-height: 46px; padding: 6px 18px 6px 98px; }
  #nav .brand, #nav .brand-mark { width: 84px; height: 84px; }
  #nav .brand { left: 12px; }
  /* Center the hero content vertically; symmetric padding keeps it balanced,
     and the top value acts as a floor so the headline clears the nav badge
     on short screens. */
  #hero { justify-content: center; padding-top: 104px; padding-bottom: 104px; }
  .scroll-hint { display: none; }
  .wordmark { font-size: clamp(34px, 12vw, 80px); }
  .room { padding-left: 20px; padding-right: 20px; }
  h2.display { font-size: clamp(38px, 11vw, 64px); }
  .btn { padding: 14px 24px; font-size: 14px; }
  .logo-tile { min-height: 118px; padding: 22px; }
}

/* --- Short landscape viewports: same hero fix so it never clips --- */
@media (max-height: 620px) and (min-width: 521px) {
  #hero { justify-content: flex-start; padding-top: 142px; padding-bottom: 40px; }
}

/* ============ REDUCED MOTION ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-hint .arrow { animation: none; }
  #veil { transition: opacity 0.4s ease; }
}

/* ============ NO-WEBGL FALLBACK ============ */

body.no-webgl #scene,
body.no-webgl #grain,
body.no-webgl #veil { display: none; }

body.no-webgl {
  background:
    radial-gradient(1100px 700px at 78% -10%, rgba(255, 60, 38, 0.16), transparent 60%),
    radial-gradient(900px 620px at 6% 108%, rgba(0, 168, 150, 0.14), transparent 60%),
    var(--black);
}
body.no-webgl .room.dark { background: rgba(18, 18, 20, 0.66); backdrop-filter: none; }
body.no-webgl #hero.dark { background: transparent; }
