/* Monarch.ac — shared stylesheet */

:root {
  --ink: #0D1417;
  --ink-2: #18232A;
  --line-dark: #2A3740;
  --paper: #EEF2F4;
  --white: #fff;
  --sky: #CFE2F1;
  --sage: #DBE9CE;
  --blue: #4E8FC2;
  --accent: #F08A2C;
  --text-2: #2B363C;
  --text-3: #55636B;
  --mist: #D5DCE0;
  --dim: #9FB0BA;
  --veil: .3;          /* darkness over the hero video, 0–1 */
  --p: 1;              /* assembly progress, set by main.js */
  --on: 0;             /* 1 once the mark is fully assembled */
  --gutter: clamp(20px, 5vw, 80px);
  --font: 'Geist', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--ink); }
.page { overflow-x: clip; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.mark polygon { fill: currentColor; }
.wordmark { font-weight: 600; font-size: 13px; letter-spacing: .34em; }
.frame { padding: 12px; }
.h-xl { font-weight: 500; font-size: clamp(38px, 6vw, 96px); line-height: .95; letter-spacing: -.045em; text-wrap: balance; }
.lede { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; color: var(--text-2); max-width: 480px; text-wrap: pretty; }

/* Buttons */
.btn { display: inline-block; padding: 17px 30px; border: 0; border-radius: 999px; font: inherit; font-size: 16px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .2s; }
.btn--sm { padding: 11px 20px; font-size: 14px; }
.btn--light { background: var(--white); color: var(--ink); }
.btn--light:hover { background: var(--accent); color: var(--ink); }
.btn--glass { background: rgba(13, 20, 23, .4); border: 1px solid rgba(255, 255, 255, .35); color: var(--white); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.btn--glass:hover { background: rgba(13, 20, 23, .6); color: var(--white); }

/* Nav */
.nav { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); max-width: calc(100vw - 24px); padding: 8px 20px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(13, 20, 23, .5); color: var(--white); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
.nav__brand { display: flex; align-items: center; gap: 10px; color: var(--white); }
.nav__brand:hover { color: var(--white); }
.nav__links { display: flex; gap: 28px; font-size: 14px; font-weight: 500; white-space: nowrap; }

/* Hero */
.hero { position: relative; min-height: calc(100vh - 24px); border-radius: 32px; overflow: hidden; background: #97A9BD; color: var(--white); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__veil { position: absolute; inset: 0; background: rgb(13 20 23 / var(--veil)); }
.hero__content { position: relative; max-width: 1500px; padding: 140px var(--gutter) 200px; }
.hero h1 { font-weight: 500; font-size: clamp(40px, 7.6vw, 128px); line-height: .92; letter-spacing: -.05em; text-wrap: balance; }
.hero__lede { max-width: 620px; margin: 36px auto 0; font-size: clamp(17px, 1.5vw, 22px); line-height: 1.45; font-weight: 500; text-wrap: pretty; }
.hero__actions { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero__facts { position: absolute; left: 12px; right: 12px; bottom: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; text-align: left; }
.hero__facts li { padding: 20px 24px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(13, 20, 23, .5); font-size: 15px; line-height: 1.4; font-weight: 500; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }

/* What we do */
.work { padding: clamp(80px, 10vw, 150px) var(--gutter) clamp(60px, 8vw, 120px); }
.work__intro { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px 64px; align-items: end; margin-bottom: clamp(36px, 4vw, 64px); }
.work__lead { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 12px; margin-bottom: 12px; }
.work__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 12px; }
.work__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.work__footnote { margin: 16px 4px 0; font-size: 13px; color: var(--text-3); }

.card { display: flex; flex-direction: column; gap: 20px; min-height: 400px; padding: 24px; border-radius: 28px; background: var(--white); }
.card h3 { font-weight: 500; font-size: 28px; line-height: 1.02; letter-spacing: -.03em; }
.card > p { font-size: 15.5px; line-height: 1.55; color: var(--text-2); text-wrap: pretty; }
.card > .card__tags { margin-top: -10px; font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--text-3); }
.card--lg { gap: 28px; min-height: 520px; padding: clamp(24px, 3vw, 40px); border-radius: 32px; }
.card--lg h3 { font-size: clamp(34px, 4vw, 60px); line-height: .98; letter-spacing: -.04em; }
.card--lg > p { max-width: 460px; font-size: 17px; color: #1F2A30; }
.card--sky { background: var(--sky); }
.card--sage { background: var(--sage); }

/* Interface previews inside cards */
.demo { flex: 1; display: flex; flex-direction: column; border-radius: 18px; background: var(--paper); padding: 18px; }
.demo__head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.demo__note { font-size: 13px; color: var(--text-3); }
.demo__axis { display: grid; grid-template-columns: repeat(4, 1fr); font-size: 13px; color: var(--text-2); }
.bars { flex: 1; display: flex; align-items: flex-end; gap: 6px; }
.bars i { flex: 1; height: var(--h); border-radius: 6px; background: var(--white); transition: background .6s, height 1s cubic-bezier(.3, .7, .2, 1); }
.bars i.is-past { background: var(--blue); }
.bars i.is-now { background: var(--accent); }
.bars--sm { flex: none; height: 64px; gap: 5px; }
.bars--sm i { border-radius: 4px; background: var(--sky); }
.bars--sm i:last-child { background: var(--blue); }

.demo--plan { gap: 18px; min-height: 220px; padding: 22px; border-radius: 22px; background: rgba(255, 255, 255, .65); }
.demo--audit { justify-content: center; min-height: 220px; padding: 10px 22px; border-radius: 22px; background: rgba(255, 255, 255, .6); }
.audit__head { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0 6px; font-size: 13px; font-weight: 600; color: #3B4A41; }
.audit__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(13, 20, 23, .12); font-size: 16px; font-weight: 500; }
.audit__tag { padding: 6px 12px; border-radius: 999px; background: rgba(13, 20, 23, .08); color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .5s, color .5s; }
.audit__tag.is-found { background: var(--ink); color: var(--white); }

.demo--split { justify-content: center; gap: 18px; }
.split__row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.split__track { height: 12px; border-radius: 999px; background: var(--white); }
.split__fill { height: 100%; border-radius: 999px; transition: width 1.2s cubic-bezier(.3, .7, .2, 1); }
.split__fill--google { background: var(--blue); }
.split__fill--meta { background: var(--accent); }

.demo--timeline { position: relative; justify-content: center; gap: 6px; padding: 18px 14px; overflow: hidden; }
.track { display: flex; gap: 4px; height: 26px; }
.track--thin { height: 14px; }
.clip { border-radius: 6px; }
.clip--a { background: #8DBBDF; }
.clip--b { background: #BCD7EC; }
.clip--c { background: #A9CC8E; }
.clip--d { background: var(--accent); border-radius: 5px; }
.timeline__playhead { position: absolute; top: 10px; bottom: 10px; left: 8%; width: 2px; background: var(--ink); transition: left 2.4s linear; }

.demo--pipe { justify-content: center; gap: 6px; padding: 0; background: none; }
.pipe__step { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-radius: 14px; background: var(--paper); font-size: 15px; font-weight: 600; transition: background .5s; }
.pipe__step i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); opacity: .2; transition: opacity .5s; }
.pipe__step.is-active { background: var(--accent); }
.pipe__step.is-active i { opacity: 1; }

.demo--dash { justify-content: space-between; gap: 14px; }
.dash__figure { font-weight: 500; font-size: 48px; line-height: 1; letter-spacing: -.04em; }
.demo--dash .demo__note { margin-top: 6px; }

/* Why Monarch — comparison */
.why { padding: clamp(56px, 8vw, 130px) clamp(20px, 5vw, 68px); border-radius: 32px; background: var(--ink); color: var(--white); text-align: center; }
.why .h-xl { max-width: 1100px; margin: 0 auto 28px; }
.why__lede { max-width: 640px; margin: 0 auto clamp(48px, 6vw, 96px); font-size: clamp(17px, 1.5vw, 22px); line-height: 1.5; color: var(--mist); text-wrap: pretty; }
.vs { max-width: 1060px; margin: 0 auto; text-align: left; }
.vs__row { display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr); gap: 0 28px; align-items: center; padding: 18px 0; }
.vs__row--head { padding: 0 0 28px; }
.vs__them-title { text-align: right; font-weight: 500; font-size: clamp(20px, 2vw, 28px); letter-spacing: -.03em; color: var(--dim); }
.vs__mid { text-align: center; font-size: 13px; font-weight: 600; color: var(--dim); }
.vs__us-title { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: clamp(26px, 2.8vw, 40px); letter-spacing: -.035em; }
.vs__them { text-align: right; font-size: 16px; line-height: 1.4; color: var(--dim); text-wrap: balance; }
.vs__us { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.3; font-weight: 500; letter-spacing: -.015em; text-wrap: balance; }
.vs__label { align-self: stretch; display: flex; justify-content: center; align-items: center; background: linear-gradient(var(--line-dark), var(--line-dark)) center / 1px 100% no-repeat; }
.vs__label span { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-dark); background: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Assembly illustration (pinned while scrolling) */
.assemble { height: 240vh; padding: 12px; }
.assemble__stage { position: sticky; top: 12px; height: calc(100vh - 24px); display: flex; flex-direction: column; gap: 12px; padding: clamp(88px, 11vh, 116px) clamp(20px, 5vw, 68px) clamp(24px, 4vw, 48px); border-radius: 32px; overflow: hidden;
  background:
    linear-gradient(rgba(13, 20, 23, .055) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(13, 20, 23, .055) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--sky); }
.assemble__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px 48px; }
.assemble__head h2 { font-weight: 500; font-size: clamp(34px, 4.6vw, 72px); line-height: .95; letter-spacing: -.045em; }
.assemble__head p { max-width: 380px; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.5; color: #1F2A30; text-wrap: pretty; }
.assemble__art { flex: 1; min-height: 0; width: 100%; overflow: visible; }
.assemble__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.assemble__label { margin-bottom: 4px; font-size: 13px; font-weight: 600; color: #3B4A54; }
.assemble__pct { font-weight: 500; font-size: clamp(40px, 5vw, 76px); line-height: .9; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.assemble__meter { width: min(46%, 420px); height: 6px; margin-bottom: 10px; border-radius: 999px; background: rgba(13, 20, 23, .12); overflow: hidden; }
.assemble__meter div { height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(var(--p)); }

.ghost polygon { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 7; opacity: calc(.45 * (1 - var(--p))); }
.wing { transform-box: view-box; transform-origin: 50% 50%; animation: monarch-flap 1.7s ease-in-out infinite alternate, monarch-hue 9s linear infinite; }
.piece { transform: translate(calc((1 - var(--p)) * var(--dx)), calc((1 - var(--p)) * var(--dy))); }
.piece__spin { transform-box: fill-box; transform-origin: center; transform: rotate(calc((1 - var(--p)) * var(--rot))); }
.piece__ink { fill: var(--ink); }
.piece__color { opacity: var(--p); }
.tag { font-size: 24px; font-weight: 600; letter-spacing: -.015em; fill: var(--ink); }
.tag--end { text-anchor: end; }
.tag--before { opacity: calc(1 - var(--p) * 2.2); }
.tag--after { opacity: calc(var(--p) * 2.5 - 1.5); }
@keyframes monarch-flap { from { transform: scaleX(1); } to { transform: scaleX(calc(1 - .22 * var(--on))); } }
@keyframes monarch-hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(calc(360deg * var(--on))); } }

/* Closing / contact */
.close { position: relative; border-radius: 32px; overflow: hidden; background: #3C4A54; color: var(--white); }
.close__veil { position: absolute; inset: 0; background: rgba(13, 20, 23, .38); }
.close__content { position: relative; min-height: min(78vh, 760px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(72px, 10vw, 140px) clamp(20px, 5vw, 68px); text-align: center; }
.close h2 { margin-bottom: 20px; font-weight: 500; font-size: clamp(40px, 6.4vw, 104px); line-height: .94; letter-spacing: -.05em; text-wrap: balance; }
.close__content > p { max-width: 440px; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; font-weight: 500; }
.contact { display: flex; align-items: center; gap: 6px; width: 100%; max-width: 460px; margin-top: 36px; padding: 6px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(13, 20, 23, .5); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.contact:focus-within { border-color: var(--white); }
.contact input { flex: 1; min-width: 0; padding: 12px 16px; border: 0; background: transparent; color: var(--white); font: inherit; font-size: 16px; outline: none; }
.contact input::placeholder { color: rgba(255, 255, 255, .8); }
.contact .btn { flex: none; padding: 13px 22px; font-size: 15px; }
.close__content > .contact__done { max-width: none; margin-top: 36px; padding: 16px 26px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(13, 20, 23, .5); font-size: 16px; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
[hidden] { display: none !important; }

/* Footer */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 36px var(--gutter) 44px; font-size: 14px; color: var(--text-3); }
.footer__brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }

/* Tablet and phone */
@media (max-width: 820px) {
  .nav__links { display: none; }
  .vs__row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 0 0 36px; }
  .vs__row--head { display: none; }
  .vs__them { text-align: left; }
  .vs__label { order: -1; justify-content: flex-start; background: none; }
}
@media (max-width: 560px) {
  .hero { justify-content: flex-start; }
  .hero__content { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 40px; }
  .hero__facts { position: static; width: calc(100% - 24px); margin: 0 12px 12px; }
  .assemble__foot { align-items: flex-end; }
  .tag { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .assemble { height: auto; }
  .assemble__stage { position: static; height: auto; min-height: 80vh; }
  .wing { animation: none; }
  * { transition-duration: 0s !important; }
}
