/* Baz Studios — company site.
 * Deep royal-navy, gold used sparingly. Product-led split hero with a
 * tilting/floating device, an aurora + film-grain canvas, glassy sticky
 * header, staggered scroll-reveal, and a real product showcase.
 * Everything non-essential is gated behind prefers-reduced-motion.
 * Single static page, no build step, no web fonts (system stack only). */

:root {
  /* Royal navy canvas — deep */
  --bg: #060e2a;
  --bg-glow: #112a5c;
  --panel: rgba(16, 36, 86, 0.50);
  --panel-hover: rgba(22, 46, 104, 0.70);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #f3f6fc;
  --muted: #aeb9d6;
  --faint: #7282aa;
  /* Bright royal blue — primary interactive accent */
  --royal: #5e7cf0;
  --royal-bright: #84a0ff;
  --royal-soft: rgba(132, 160, 255, 0.18);
  /* Gold — the subtle warm accent */
  --gold: #ffd24a;
  --gold-bright: #ffdd6e;
  --gold-soft: rgba(255, 210, 74, 0.14);
  --gold-line: rgba(255, 210, 74, 0.32);
  --maxw: 1120px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
  /* Offset anchor scrolls (e.g. #work, #contact) so the target lands
   * below the sticky header instead of tucking underneath it. */
  scroll-padding-top: 88px;
}

body {
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: radial-gradient(
    1000px 560px at 70% -200px,
    var(--bg-glow) 0%,
    var(--bg) 70%
  );
  background-repeat: no-repeat;
}

/* Film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%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");
}

/* Aurora */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  animation: aurora-in 1.4s var(--ease) both;
}
.aurora .blob { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
.aurora .b1 {
  width: 560px; height: 560px; top: -200px; right: -120px;
  background: radial-gradient(circle, rgba(43, 80, 200, 0.55), transparent 68%);
  animation: drift1 24s ease-in-out infinite;
}
.aurora .b2 {
  width: 520px; height: 520px; top: 30%; left: -200px;
  background: radial-gradient(circle, rgba(26, 58, 160, 0.50), transparent 68%);
  animation: drift2 28s ease-in-out infinite;
}
.aurora .b3 {
  width: 380px; height: 380px; bottom: -160px; right: 24%;
  background: radial-gradient(circle, rgba(255, 210, 74, 0.40), transparent 68%);
  opacity: 0.14;
  animation: drift3 32s ease-in-out infinite;
}
@keyframes aurora-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1);} 50% { transform: translate(-70px,60px) scale(1.12);} }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1);} 50% { transform: translate(70px,40px) scale(1.08);} }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1);} 50% { transform: translate(40px,-50px) scale(1.15);} }

/* Glassy sticky header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 18px 32px;
  border-bottom: 1px solid transparent;
  background: rgba(6, 14, 42, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(6, 14, 42, 0.74);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
}
header .nav {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Brand + monogram sheen */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  border: 0;
}
.mark-wrap {
  position: relative;
  display: inline-flex;
  border-radius: 7px;
  overflow: hidden;
  transition: transform 0.3s var(--ease);
}
.mark-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
  transform: translateX(-130%);
  pointer-events: none;
}
.brand:hover .mark-wrap { transform: translateY(-1px); }
.brand:hover .mark-wrap::after { animation: sheen 0.75s var(--ease); }
@keyframes sheen { to { transform: translateX(130%); } }
.brand .mark { width: 28px; height: 28px; display: block; }
.brand .wordmark { font-size: 16px; font-weight: 650; letter-spacing: -0.2px; color: var(--text); }

header nav { display: flex; gap: 24px; }
header nav a {
  position: relative;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s ease;
}
header nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
header nav a:hover { color: var(--gold); }
header nav a:hover::after { transform: scaleX(1); }

/* Layout shell */
main { flex: 1; width: 100%; }

/* Scroll-reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
[data-reveal].in { opacity: 1; transform: none; }

/* ============================ HERO ============================ */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 32px 88px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  min-height: calc(100vh - 64px);
}

.hero-copy { max-width: 560px; }

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 66px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #bccbf2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  color: var(--muted);
  font-size: clamp(17px, 2.4vw, 20px);
  line-height: 1.55;
  max-width: 480px;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 12px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s;
}
.btn .arrow { display: inline-block; transition: transform 0.28s var(--ease); }
.btn-primary {
  color: #0a1530;
  background: linear-gradient(180deg, #ffe07a 0%, var(--gold) 100%);
  box-shadow: 0 10px 28px rgba(255, 210, 74, 0.22);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(255, 210, 74, 0.32);
}
.btn-primary:hover .arrow { transform: translateX(4px); }

/* Hero phone */
.hero-visual {
  perspective: 1400px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.phone {
  position: relative;
  transform: rotateY(-12deg) rotateX(5deg);
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease);
  will-change: transform;
}
.phone-glow {
  position: absolute;
  inset: -60px -40px -40px;
  z-index: -1;
  background: radial-gradient(circle at 50% 42%, rgba(94, 124, 240, 0.50), transparent 62%);
  filter: blur(46px);
}

/* Device frame */
.device {
  position: relative;
  width: 290px;
  aspect-ratio: 369 / 800;
  background: #04060d;
  border-radius: 44px;
  padding: 9px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.07),
    0 40px 80px rgba(0, 0, 0, 0.6),
    0 12px 28px rgba(0, 0, 0, 0.5);
  transform-style: preserve-3d;
  animation: float 6.5s ease-in-out infinite;
}
.device img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 36px;
}
.island {
  position: absolute;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 22px;
  background: #000;
  border-radius: 999px;
  z-index: 3;
}
.screen-sheen {
  position: absolute;
  inset: 9px;
  border-radius: 36px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 38%);
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ============================ WORK ============================ */
.work {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 32px 92px;
}
/* The whole RunFiller block sits on a frosted card so it reads as its
 * own self-contained section rather than floating on the page. */
.work-card {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 52px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(22, 46, 104, 0.55), rgba(12, 26, 66, 0.42));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}
.work-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(620px circle at 16% -12%, rgba(94, 124, 240, 0.14), transparent 55%);
}
.work-card > * { position: relative; z-index: 1; }
.work-head { max-width: 620px; margin-bottom: 40px; }
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 18px;
}
.kicker .idx {
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  font-weight: 700;
}
.work h2 {
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 18px;
}
/* RunFiller wordmark as the section title */
.work-title { line-height: 0; margin-bottom: 20px; }
.work-title img { height: 50px; width: auto; display: block; }
.work-lede {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 22px;
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--royal-bright);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s ease;
}
.link-arrow .arrow { display: inline-block; transition: transform 0.28s var(--ease); }
.link-arrow:hover { color: var(--gold); }
.link-arrow:hover .arrow { transform: translateX(5px); }

/* Showcase phones */
.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  /* spans the card; each phone centers within its column */
}
.shot { margin: 0; text-align: center; }
.mini-device {
  position: relative;
  width: 100%;
  max-width: 230px;
  aspect-ratio: 369 / 800;
  margin: 0 auto;
  background: #04060d;
  border-radius: 30px;
  padding: 6px;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.06),
    0 22px 44px rgba(0, 0, 0, 0.5);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.mini-device img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}
.shot:hover .mini-device {
  transform: translateY(-8px);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 210, 74, 0.18),
    0 30px 56px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(255, 210, 74, 0.12);
}
.shot figcaption {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* Desktop: the RunFiller card becomes two columns — copy on the left, a
 * fanned trio of screenshots on the right. (Tablet keeps the stacked grid;
 * mobile keeps the captioned swipe carousel.) */
@media (min-width: 861px) {
  .work-card {
    display: grid;
    grid-template-columns: 0.84fr 1.16fr;
    gap: 68px;
    align-items: center;
  }
  .work-head { max-width: none; margin-bottom: 0; }
  .shots {
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(20px);   /* nudge the fan a touch right */
  }
  .shot {
    width: 188px;
    flex: 0 0 auto;
    margin: 0;
    transition: transform 0.35s var(--ease);
  }
  .shot figcaption { display: none; }
  /* Overlapping fan: side phones tilt out and sit behind; middle in front. */
  .shot:nth-child(1) { transform: rotate(-7deg) translateY(12px); z-index: 1; }
  .shot:nth-child(2) { margin: 0 -32px; transform: translateY(-8px); z-index: 3; }
  .shot:nth-child(3) { transform: rotate(7deg) translateY(12px); z-index: 1; }
  /* Hover lifts a phone, straightens it, and brings it to the front. */
  .shot:hover { transform: translateY(-10px) rotate(0deg) scale(1.03); z-index: 5; }
  .shot:hover .mini-device { transform: none; }
}

/* ============================ CONTACT ============================ */
.contact {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 32px 96px;
  text-align: center;
}
.contact-head {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #bccbf2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.contact-mail {
  display: inline-block;
  position: relative;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 650;
  color: var(--royal-bright);
  text-decoration: none;
  transition: color 0.18s ease;
}
.contact-mail::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease);
}
.contact-mail:hover { color: var(--gold); }
.contact-mail:hover::after { transform: scaleX(1); }
.contact-sub { color: var(--faint); margin-top: 16px; font-size: 15px; }

/* ============================ FOOTER ============================ */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 32px;
  margin-top: auto;
}
.foot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.foot-brand .brand { margin-bottom: 12px; }
.foot-brand p { color: var(--faint); font-size: 13px; line-height: 1.5; }
.foot-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-size: 13px;
}
.foot-meta a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.foot-meta a:hover { color: var(--gold); }
.foot-meta span { color: var(--faint); }

/* ============================ LEGAL / PROSE ============================ */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 32px 96px;
}
.legal .meta {
  color: var(--faint);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.legal h1 {
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #bccbf2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.legal .lede {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 8px;
}
.legal h2 {
  font-size: 18px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.2px;
  margin: 36px 0 10px;
}
.legal p { color: var(--muted); margin: 10px 0; }
.legal ul { color: var(--muted); margin: 10px 0 10px 22px; }
.legal li { margin: 5px 0; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a {
  color: var(--royal-bright);
  text-decoration: none;
  border-bottom: 1px solid rgba(132, 160, 255, 0.35);
  transition: color 0.15s, border-color 0.15s;
}
.legal a:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* Keyboard focus */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ============================ RESPONSIVE ============================ */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    padding: 40px 24px 64px;
    text-align: center;
  }
  .hero-copy { max-width: none; margin: 0 auto; }
  .lede { margin-left: auto; margin-right: auto; }
  .cta-row { justify-content: center; }
  .hero-visual { margin-top: 48px; }
  .phone { transform: rotateY(0deg) rotateX(0deg); }
  .work, .contact { padding-left: 24px; padding-right: 24px; }
  .work-card { padding: 40px 28px 44px; }
  .work-head { margin-left: auto; margin-right: auto; }
  .foot-inner { flex-direction: column; align-items: center; text-align: center; }
  .foot-meta { align-items: center; }
}

@media (max-width: 600px) {
  header { padding: 16px 20px; }
  .hero h1 { letter-spacing: -1px; }
  .device { width: 250px; }
  .aurora .blob { filter: blur(70px); }
  .work-title img { height: 42px; }
  .work-card { padding: 32px 20px 36px; border-radius: 22px; }

  /* Screenshots become a horizontal swipe carousel (like runfiller.com)
   * instead of stacking — one-finger scroll, each phone snaps to center.
   * Partial visibility of the next phone is the swipe affordance. The
   * negative margin bleeds the carousel out to the card's edges. */
  .shots {
    display: flex;
    flex-direction: row;
    grid-template-columns: none;
    gap: 20px;
    max-width: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 8px -20px 0;
    padding: 16px 0 28px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .shots::-webkit-scrollbar { display: none; }
  /* Edge spacers so the first/last phone can reach center. The card insets
   * the carousel by ~24px each side, so account for that in the centering. */
  .shots::before, .shots::after {
    content: '';
    flex: 0 0 max(16px, calc(50vw - 134px));
  }
  .shot {
    flex: 0 0 auto;
    width: 220px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }
  .mini-device { max-width: 220px; }
  /* Centered phone gets the desktop-hover lift/glow. JS toggles the class. */
  .shot.is-centered .mini-device {
    transform: translateY(-8px);
    box-shadow:
      inset 0 0 0 1.5px rgba(255, 210, 74, 0.18),
      0 30px 56px rgba(0, 0, 0, 0.6),
      0 0 30px rgba(255, 210, 74, 0.12);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .aurora .blob, .device { animation: none; }
  .phone { transform: rotateY(-10deg) rotateX(4deg); }
}
