@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Space+Mono:wght@400;700&display=swap');

/* ─────────────────────────────── TOKENS */
:root {
  --bg:       #050505;
  --bg-alt:   #0a0a0a;
  --surface:  rgba(255,255,255,.04);
  --surf-hi:  rgba(255,255,255,.08);
  --text:     #f0ece0;
  --muted:    rgba(240,236,224,.55);
  --soft:     rgba(240,236,224,.32);
  --line:     rgba(240,236,224,.10);
  --gold:     #c8a96e;
  --gold-dim: rgba(200,169,110,.22);
  --radius:   3px;
  --container:1200px;
  --px:       clamp(20px,4vw,56px);
  --py:       clamp(72px,9vw,130px);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Cormorant Garamond', Georgia, serif;
  --font-mono:    'Space Mono', monospace;
}

/* ─────────────────────────────── RESET */
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; }

/* ─────────────────────────────── CURSOR */
*, a, button { cursor: none !important; }

#cursor {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%,-50%);
  transition: width .2s ease, height .2s ease;
  mix-blend-mode: difference;
}
#cursor-ring {
  position: fixed;
  width: 38px; height: 38px;
  border: 1px solid rgba(200,169,110,.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%,-50%);
  transition: width .25s ease, height .25s ease, opacity .2s ease;
}

/* ─────────────────────────────── BODY */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Film grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  animation: grain 1.4s steps(7) infinite;
}
@keyframes grain {
  0%,100% { background-position: 0 0; }
  14% { background-position: -55px 35px; }
  28% { background-position: 25px -65px; }
  42% { background-position: -75px -25px; }
  57% { background-position: 45px 55px; }
  71% { background-position: -35px 70px; }
  85% { background-position: 60px -40px; }
}

/* Scan lines */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.03) 2px,
    rgba(0,0,0,.03) 4px
  );
}

/* ─────────────────────────────── LAYOUT */
.page-shell { position:relative; z-index:1; width:100%; }

.panel {
  position: relative;
  padding: var(--py) var(--px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.panel[id] { scroll-margin-top: 100px; }
.panel > * { max-width: var(--container); margin-inline: auto; }

/* ─────────────────────────────── HEADER */
.masthead {
  position: sticky;
  top: 0;
  z-index: 500;
  padding: 16px var(--px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  background: rgba(5,5,5,.9);
  backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--line);
}

.masthead .panel-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--soft);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.masthead .panel-meta::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:.3; transform:scale(.65); }
}

.mast-logo {
  display: flex;
  justify-content: center;
  text-decoration: none;
}
.mast-logo img {
  width: 130px; height: auto;
  filter: invert(1);
  object-fit: contain;
}

.quick-nav {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  flex-wrap: wrap;
}
.quick-nav a {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
}
.quick-nav a:hover, .quick-nav a.is-active {
  color: var(--text);
  border-color: var(--gold-dim);
  background: rgba(200,169,110,.06);
}

/* ─────────────────────────────── PANEL META */
.panel-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 44px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--soft);
}
.panel-meta p { color: var(--gold); }
.panel-meta::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ─────────────────────────────── TYPOGRAPHY */
h1 {
  font-family: var(--font-display);
  font-size: clamp(68px, 10vw, 148px);
  line-height: .92;
  letter-spacing: .01em;
  font-weight: 400;
  text-transform: uppercase;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 88px);
  line-height: .95;
  letter-spacing: .02em;
  font-weight: 400;
  text-transform: uppercase;
  margin-top: 8px;
}
h3 {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.5vw, 34px);
  letter-spacing: .06em;
  font-weight: 400;
  text-transform: uppercase;
}

.lead {
  margin-top: 28px;
  color: var(--muted);
  max-width: 58ch;
  font-size: clamp(20px, 1.9vw, 24px);
  line-height: 1.65;
  font-style: italic;
  font-weight: 300;
}
.label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.label::before {
  content: '';
  display: block;
  width: 28px; height: 1px;
  background: var(--gold);
}

/* ─────────────────────────────── HERO */
.bg-hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(ellipse at 62% 38%, rgba(200,169,110,.055) 0%, transparent 55%),
    var(--bg);
}
.bg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(0,0,0,.95) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 0% 0%, rgba(0,0,0,.6) 0%, transparent 55%);
  pointer-events: none;
  z-index: 1;
}

.hero-mark {
  position: absolute;
  right: clamp(20px, 7vw, 110px);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: .065;
  animation: hero-drift 14s ease-in-out infinite;
  z-index: 0;
}
@keyframes hero-drift {
  0%,100% { transform: translateY(-50%); }
  50% { transform: translateY(-52.5%); }
}
.hero-mark img {
  width: min(40vw, 540px);
  height: auto;
  filter: invert(1);
  mix-blend-mode: screen;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(260px,.6fr);
  gap: clamp(32px, 6vw, 90px);
  align-items: end;
  position: relative;
  z-index: 2;
}
.hero-copy, .hero-feature { position: relative; z-index: 2; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 48px;
}

.hero-feature {
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  background: rgba(5,5,5,.75);
  backdrop-filter: blur(20px);
  padding: 30px;
}
.feature-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
}
.hero-list { list-style: none; display: grid; gap: 0; }
.hero-list li {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .04em;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transition: color .2s, padding-left .2s;
}
.hero-list li:last-child { border-bottom: none; }
.hero-list li:hover { color: var(--text); padding-left: 4px; }
.hero-list span { color: var(--gold); font-weight: 700; min-width: 20px; }

/* Ticker */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  background: rgba(5,5,5,.6);
}
.ticker-track {
  display: inline-flex;
  animation: ticker 32s linear infinite;
  white-space: nowrap;
}
.ticker-track span {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--soft);
  padding: 0 52px;
}
.ticker-track span.gold { color: var(--gold); }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ─────────────────────────────── SERVICES */
.service-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.service-grid article {
  background: var(--bg);
  padding: 48px 40px;
  transition: background .35s;
  position: relative;
  overflow: hidden;
}
.service-grid article::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}
.service-grid article:hover { background: rgba(200,169,110,.03); }
.service-grid article:hover::after { transform: scaleX(1); }
.service-grid .svc-num {
  font-family: var(--font-display);
  font-size: 88px;
  line-height: 1;
  color: rgba(240,236,224,.05);
  margin-bottom: 16px;
  transition: color .35s;
}
.service-grid article:hover .svc-num { color: rgba(200,169,110,.1); }
.service-grid article p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.6;
  font-style: italic;
}

/* ─────────────────────────────── ABOUT */
.about-panel { background: rgba(200,169,110,.018); }
.about-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 60px;
  align-items: center;
  padding: 48px;
  border: 1px solid var(--line);
}
.about-grid img {
  width: 150px; height: auto;
  filter: invert(1);
  mix-blend-mode: screen;
  opacity: .3;
  transition: opacity .5s;
}
.about-grid:hover img { opacity: .5; }
.about-grid p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.65;
  font-style: italic;
}

/* ─────────────────────────────── WORK */
.work-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px,1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.work-card {
  background: var(--bg);
  padding: 28px;
  transition: background .3s;
  position: relative;
}
.work-card:hover { background: rgba(200,169,110,.025); }
.work-card h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .05em;
  font-weight: 400;
  text-transform: none;
  color: var(--muted);
  margin-top: 18px;
  line-height: 1.55;
}

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.video-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ─────────────────────────────── FORMS */
.brief-form, .contact-form {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 16px;
  padding: 40px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.3);
}
.contact-notes { grid-column: 1 / -1; }

label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--soft);
  display: grid;
  gap: 10px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-bottom: 1px solid rgba(240,236,224,.2);
  border-radius: 0;
  padding: 14px 0;
  font-family: var(--font-body);
  font-size: 17px;
  background: transparent;
  color: var(--text);
  transition: border-color .25s;
  border-top: none; border-left: none; border-right: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-bottom-color: var(--gold);
}
input::placeholder, textarea::placeholder { color: var(--soft); font-style: italic; }
textarea { resize: vertical; min-height: 130px; padding: 10px 0; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(200,169,110,.7)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 24px;
  -webkit-appearance: none;
}

/* ─────────────────────────────── BUTTONS */
.submit-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 36px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .12em;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s, color .2s;
}
.submit-btn {
  background: var(--gold);
  border: 1px solid var(--gold);
  color: #050505;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(200,169,110,.25); }
.submit-btn:disabled { opacity:.5; transform:none; cursor:not-allowed !important; }

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(240,236,224,.2);
  color: var(--text);
}
.ghost-btn:hover { border-color: var(--gold); transform: translateY(-2px); }

/* ─────────────────────────────── OUTPUT */
.brief-output {
  margin-top: 24px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  min-height: 84px;
  color: var(--muted);
  font-style: italic;
  font-size: 21px;
  line-height: 1.65;
  background: rgba(0,0,0,.35);
}
.builder-intro {
  margin-top: 14px;
  color: var(--muted);
  font-style: italic;
  font-size: 22px;
  line-height: 1.55;
}
.status-error { border-color: rgba(255,80,80,.35); color: #ff9a9a; }
.status-success { border-color: rgba(200,169,110,.4); color: #d4b87a; }

/* ─────────────────────────────── LINKS */
.work-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  transition: gap .2s;
}
.work-link::after { content: '→'; }
.work-link:hover { gap: 14px; }

/* ─────────────────────────────── FOOTER */
.footer-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-brand strong {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .12em;
  color: var(--text);
}
.footer-brand span {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .2em;
  color: var(--soft);
  text-transform: uppercase;
}
.footer-panel a {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: .08em;
  transition: color .2s;
}
.footer-panel a:hover { color: var(--gold); }

/* ─────────────────────────────── REVEAL */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .75s cubic-bezier(.16,1,.3,1), transform .75s cubic-bezier(.16,1,.3,1);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible { opacity:1; transform:translateY(0); }

/* ─────────────────────────────── RESPONSIVE */
@media (max-width:1024px) {
  .service-grid { grid-template-columns: 1fr; }
}
@media (max-width:900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; padding: 28px; }
  .hero-mark { right: -100px; opacity:.04; }
  .masthead { grid-template-columns: 1fr auto; }
  .masthead .panel-meta { display:none; }
  .footer-panel { flex-direction:column; text-align:center; }
  .brief-form, .contact-form { padding: 24px; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *, body::after { animation:none !important; transition:none !important; }
  [data-reveal] { opacity:1; transform:none; }
  *, a, button { cursor:auto !important; }
  #cursor, #cursor-ring { display:none; }
}
