/* ============================================================
   XBOX WIRE — Editorial Redesign · Shared System
   Swiss/editorial · big grotesque type · strict-then-broken grid
   ============================================================ */

/* ---- tokens ------------------------------------------------ */
:root {
  --paper:      #ebebeb;   /* light page background */
  --paper-pure: #F5F3EE;   /* raised / cards */
  --ink:        #14150F;   /* near-black */
  --ink-2:      #46483E;   /* body */
  --ink-3:      #86887C;   /* muted / meta */
  --rule:       #C9C9C9;   /* hairline */
  --rule-soft:  #D9D9D9;

  --accent:       #008746;  /* Xbox green */
  --accent-deep:  #008746;  /* green text on paper */
  --accent-light: #32AA60;  /* green on dark backgrounds */
  --accent-glow:  rgba(0,135,70,0.22);

  --maxw: 1600px;
  --gutter: clamp(20px, 4.5vw, 72px);
  --gap: clamp(16px, 1.6vw, 28px);

  /* fluid display scale */
  --t-mega:  clamp(64px, 13vw, 230px);
  --t-huge:  clamp(48px, 8vw, 132px);
  --t-h1:    clamp(38px, 5.4vw, 92px);
  --t-h2:    clamp(28px, 3.4vw, 56px);
  --t-h3:    clamp(21px, 2vw, 32px);
  --t-body:  clamp(16px, 1.05vw, 19px);
  --t-label: clamp(11px, 0.78vw, 13px);

  --sans: "Segoe Sans Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "Aptos Mono", "SFMono-Regular", ui-monospace, monospace;

  --ease: cubic-bezier(.22,.61,.16,1);
  --ease-out: cubic-bezier(.16,.84,.28,1);
}

/* ---- reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
::selection { background: var(--accent); color: #fff; }

/* ---- type utilities --------------------------------------- */
.mono {
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.mono-sm { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.accent  { color: var(--accent-deep); }
.display {
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.italic-serif { font-style: italic; }

/* ---- layout helpers --------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.grid12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule-ink { border: 0; border-top: 1.5px solid var(--ink); margin: 0; }

/* ============================================================
   NAV — editorial masthead bar
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 16px var(--gutter);
  mix-blend-mode: normal;
  transition: background .4s var(--ease), border-color .4s var(--ease), padding .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.solid {
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--rule);
  padding-block: 12px;
}
.nav__brand { display: flex; align-items: baseline; gap: 14px; flex-shrink: 0; }
.nav__logo {
  font-weight: 700; letter-spacing: -0.05em; font-size: 23px; line-height: 1;
  display: flex; align-items: center; gap: 7px;
}
.nav__logo .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; }
.nav__issue { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ink-3); text-transform: uppercase; }
.nav__links { display: flex; gap: clamp(14px, 1.6vw, 30px); align-items: center; }
.nav__links a {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  position: relative; padding-block: 4px;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1.5px;
  background: var(--accent); transition: right .35s var(--ease);
}
.nav__links a:hover::after { right: 0; }
.nav__time { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ink-3); flex-shrink: 0; }

/* logo image (imported Xbox wordmark) */
.nav__logo-img { height: 22px; width: auto; display: block; }
/* right cluster: search pill + avatar */
.nav__tail { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav__search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; background: rgba(20,21,15,0.06); transition: background .3s var(--ease); }
.nav__search:focus-within { background: rgba(20,21,15,0.10); }
.nav__search svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; opacity: .55; flex-shrink: 0; }
.nav__search input { border: none; background: transparent; outline: none; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: inherit; width: 104px; padding: 0; }
.nav__search input::placeholder { color: currentColor; opacity: .5; }
/* hamburger — hidden on desktop */
.nav__menu-btn {
  display: none; width: 44px; height: 44px; flex-shrink: 0;
  align-items: center; justify-content: center; border-radius: 50%;
  position: relative; z-index: 2;
}
.nav__menu-btn .bars { position: relative; width: 22px; height: 12px; }
.nav__menu-btn .bars i { position: absolute; left: 0; height: 1.6px; width: 100%; background: var(--ink); transition: transform .4s var(--ease), opacity .3s; }
.nav__menu-btn .bars i:nth-child(1) { top: 0; }
.nav__menu-btn .bars i:nth-child(2) { bottom: 0; }
.nav__menu-btn.open .bars i:nth-child(1) { top: 5px; transform: rotate(45deg); }
.nav__menu-btn.open .bars i:nth-child(2) { bottom: 5px; transform: rotate(-45deg); }

@media (max-width: 1024px) {
  .nav__links, .nav__time, .nav__search { display: none; }
  .nav__menu-btn { display: inline-flex; }
}

/* fullscreen editorial menu */
.nav-overlay {
  position: fixed; inset: 0; z-index: 89; background: var(--paper);
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(80px,14vh,140px) var(--gutter) var(--gutter);
  clip-path: inset(0 0 100% 0); transition: clip-path .6s var(--ease);
  pointer-events: none;
}
.nav-overlay.open { clip-path: inset(0 0 0 0); pointer-events: auto; }
.nav-overlay a {
  display: flex; align-items: baseline; gap: 18px;
  font-weight: 700; letter-spacing: -.04em; line-height: 1;
  font-size: clamp(40px,11vw,76px); padding: clamp(10px,2vw,18px) 0;
  border-top: 1px solid var(--rule);
  opacity: 0; transform: translateY(24px); transition: opacity .5s var(--ease), transform .5s var(--ease), color .3s;
}
.nav-overlay.open a { opacity: 1; transform: none; }
.nav-overlay a:nth-child(1) { transition-delay: .12s; }
.nav-overlay a:nth-child(2) { transition-delay: .18s; }
.nav-overlay a:nth-child(3) { transition-delay: .24s; }
.nav-overlay a:nth-child(4) { transition-delay: .30s; }
.nav-overlay a:nth-child(5) { transition-delay: .36s; }
.nav-overlay a:hover { color: var(--accent-deep); }
.nav-overlay a .mn { font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: .1em; color: var(--ink-3); }
.nav-overlay__foot { margin-top: clamp(30px,5vw,60px); display: flex; flex-wrap: wrap; gap: 10px 28px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }

/* scroll progress (top hairline) */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 95;
  transform: scaleX(0); transform-origin: 0 0;
  background: var(--accent);
}

/* ============================================================
   MAGNETIC BUTTON
   ============================================================ */
.btn {
  --pad: 16px;
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: var(--pad) calc(var(--pad) * 1.7);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; background: var(--ink);
  border-radius: 999px; overflow: hidden; isolation: isolate;
  will-change: transform;
  transition: color .4s var(--ease);
}
.btn .btn__label { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 10px; }
.btn::before {
  content: ""; position: absolute; z-index: 1; inset: 0;
  background: var(--accent); border-radius: inherit;
  transform: scale(0); transform-origin: center;
  transition: transform .5s var(--ease-out);
}
.btn:hover::before { transform: scale(1.6); }
.btn svg { width: 14px; height: 14px; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--ghost:hover { color: #fff; }
.btn--accent { background: var(--accent); }
.btn--accent::before { background: var(--ink); }

/* small magnetic arrow link */
.arrow-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
}
.arrow-link .arr { transition: transform .4s var(--ease); }
.arrow-link:hover .arr { transform: translateX(8px); }

/* ============================================================
   KINETIC TYPE — word/line reveal
   ============================================================ */
.kin .kin__word { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.04em 0.14em 0.2em 0; margin: 0 -0.14em -0.2em 0; }
.kin .kin__inner {
  display: inline-block;
  transform: translateY(120%) rotate(4deg);
  transition: transform .9s var(--ease);
}
.kin.in .kin__inner { transform: none !important; }
/* stagger via inline --i on inner */
.kin .kin__inner { transition-delay: calc(var(--i, 0) * 55ms); }

/* generic reveal */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1 !important; transform: none !important; }
.reveal[data-d] { transition-delay: var(--d); }

/* image clip-reveal */
.clip { clip-path: inset(0 0 100% 0); transition: clip-path 1.1s var(--ease); }
.clip.in { clip-path: inset(0 0 0 0) !important; }

/* image inner zoom (paired with .clip wrapper) */
.zoomwrap { overflow: hidden; }
.zoomwrap img { transition: transform 1.2s var(--ease); transform: scale(1.12); }
.zoomwrap.in img { transform: scale(1) !important; }

@media (prefers-reduced-motion: reduce) {
  .kin .kin__inner, .reveal, .clip, .zoomwrap img { transition: none !important; transform: none !important; opacity: 1 !important; clip-path: none !important; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.foot { background: #151515; color: var(--paper); padding: clamp(60px, 9vw, 130px) 0 48px; }
.foot .wrap { display: grid; gap: clamp(40px, 6vw, 90px); }
.foot__big {
  font-weight: 700; letter-spacing: -0.045em; line-height: 0.82;
  font-size: var(--t-mega); color: var(--paper);
}
.foot__big .g { color: var(--accent-light); }
.foot__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 40px; }
.foot__col h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-light); margin-bottom: 16px; }
.foot__col a { display: block; padding: 6px 0; color: rgba(236,233,226,0.66); font-size: 15px; transition: color .25s, transform .25s var(--ease); }
.foot__col a:hover { color: var(--paper); transform: translateX(6px); }
.foot__base { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; padding-top: 28px; border-top: 1px solid rgba(236,233,226,0.16); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: rgba(236,233,226,0.5); text-transform: uppercase; }
.foot__hello { margin-left: auto; text-align: right; }

/* ============================================================
   DIRECTION SWITCHER (fixed)
   ============================================================ */
.switcher {
  position: fixed; z-index: 120; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.3);
}
.switcher__label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.5); padding: 0 10px 0 12px; }
.switcher a {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7); padding: 9px 16px; border-radius: 999px; line-height: 1;
  transition: background .3s, color .3s;
}
.switcher a:hover { color: #fff; }
.switcher a.on { background: var(--accent); color: #fff; }
@media (max-width: 600px) { .switcher__label { display: none; } }

/* shared TV bezel inside masthead (mapped to living-room art) */
.tv-frame { position: relative; }
.tv-screen-rect { position: absolute; overflow: hidden; background: #000; }
.tv-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s var(--ease); }
.tv-slide.on { opacity: 1; }

/* ============================================================
   A11Y + DETAIL
   ============================================================ */
:focus-visible { outline: 2.5px solid var(--accent-deep); outline-offset: 3px; border-radius: 2px; }
.btn:focus-visible, .switcher a:focus-visible, .tv-dot:focus-visible { outline-offset: 4px; }

/* custom scrollbar (webkit) */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule); border: 3px solid var(--paper); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
html { scrollbar-color: var(--rule) var(--paper); }

body.dir-c .foot { padding-top: clamp(34px, 4.5vw, 64px); }

/* capture mode (#capture) — static, fully-revealed for full-page screenshots */
body.capture .switcher, body.capture .progress { display: none !important; }
body.capture .nav { position: absolute !important; }
