/* ============================================================
   MEROVALE — Premium Console Gaming
   core.css · design foundation  (Edition II — "Atlas" editorial)
   ============================================================ */

:root {
  /* palette — warm editorial */
  --paper: #efe9dd;
  --paper-2: #e6ddca;
  --paper-3: #f7f3ea;
  --card: #f3eee3;
  --ink: #17140f;
  --ink-2: #37312a;
  --ink-dim: #6a6255;
  --ink-faint: #9c9484;
  --line: rgba(23, 20, 15, 0.14);
  --line-strong: rgba(23, 20, 15, 0.30);
  --coral: #df4324;
  --coral-deep: #bb3319;
  --forest: #1f4b3f;
  --forest-2: #14332a;
  --clay: #c07a4c;
  --cream: #f6f1e6;

  /* legacy aliases (kept so any inline var() refs still resolve) */
  --cyan: #df4324;
  --amber: #1f4b3f;
  --ice: #f6f1e6;
  --midnight: #17140f;

  /* type */
  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "DM Sans", system-ui, -apple-system, sans-serif;

  /* metrics */
  --edge: clamp(20px, 5vw, 96px);
  --maxw: 1300px;
  --r-lg: 10px;
  --r: 7px;
  --r-sm: 4px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow: 0 30px 70px -38px rgba(23, 20, 15, 0.42);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.68;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--coral); color: var(--cream); }

/* ---------- ambient paper background ---------- */
.bg-layer { position: fixed; inset: 0; z-index: -3; pointer-events: none; }
.bg-layer::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(40% 32% at 88% 6%, rgba(223, 67, 36, 0.10), transparent 66%),
    radial-gradient(46% 36% at 6% 92%, rgba(31, 75, 63, 0.10), transparent 68%);
}
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 0.6;
  background-image:
    linear-gradient(rgba(23, 20, 15, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 20, 15, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 24%, #000 8%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 24%, #000 8%, transparent 72%);
}

/* ---------- typography ---------- */
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.05; letter-spacing: -0.015em; }
.display { font-size: clamp(2.9rem, 8vw, 7.2rem); font-weight: 600; line-height: 0.98; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.8rem); font-weight: 600; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3.3rem); }
h3 { font-size: clamp(1.35rem, 2.3vw, 2rem); }
p { color: var(--ink-dim); }
.lead { font-size: clamp(1.06rem, 1.4vw, 1.32rem); color: var(--ink-2); max-width: 56ch; font-weight: 400; line-height: 1.6; }
.serif-it { font-family: var(--f-display); font-style: italic; font-weight: 500; }
.tint-coral { color: var(--coral); }
.tint-forest { color: var(--forest); }
.grad-word { color: var(--coral); font-style: italic; }
.grad-word.amber { color: var(--forest); font-style: italic; }
.outline-word { color: transparent; -webkit-text-stroke: 1.3px var(--ink); }

/* ---------- shared bits ---------- */
.shell { width: min(var(--maxw), 100% - var(--edge) * 2); margin-inline: auto; }
.block { padding: clamp(64px, 10vw, 150px) 0; position: relative; }
.index-tag { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.index-tag .no { font-family: var(--f-display); font-weight: 600; color: var(--coral); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.index-tag .lbl { font-family: var(--f-body); font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.rule { height: 1px; width: 64px; background: var(--ink); opacity: 0.5; }

/* ---------- buttons ---------- */
.act {
  display: inline-flex; align-items: center; gap: 11px; padding: 15px 26px; border-radius: 100px;
  font-weight: 600; font-size: 0.94rem; letter-spacing: 0.005em; position: relative;
  transition: transform .45s var(--ease), background .35s, color .35s, border-color .35s, box-shadow .45s var(--ease);
}
.act svg { width: 17px; height: 17px; transition: transform .4s var(--ease); }
.act-fill { background: var(--ink); color: var(--cream); }
.act-fill:hover { transform: translateY(-2px); background: var(--forest); }
.act-fill:hover svg { transform: translateX(4px); }
.act-cyan { background: var(--coral); color: var(--cream); box-shadow: 0 12px 30px -14px rgba(223, 67, 36, 0.7); }
.act-cyan:hover { transform: translateY(-2px); background: var(--coral-deep); box-shadow: 0 18px 40px -14px rgba(223, 67, 36, 0.75); }
.act-cyan:hover svg { transform: translateX(4px); }
.act-line { border: 1px solid var(--line-strong); color: var(--ink); }
.act-line:hover { transform: translateY(-2px); border-color: var(--ink); background: rgba(23, 20, 15, 0.04); }
.act-line:hover svg { transform: translateX(4px); }

/* ---------- reveal ---------- */
[data-rise] { opacity: 0; transform: translateY(30px); transition: opacity .95s var(--ease), transform .95s var(--ease); }
[data-rise].seen { opacity: 1; transform: none; }
[data-rise][data-d="1"] { transition-delay: .08s; }
[data-rise][data-d="2"] { transition-delay: .16s; }
[data-rise][data-d="3"] { transition-delay: .24s; }
[data-rise][data-d="4"] { transition-delay: .32s; }
[data-rise][data-d="5"] { transition-delay: .40s; }

/* ============================================================
   NAVIGATION — editorial masthead bar
   ============================================================ */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 100; transition: background .45s var(--ease), border-color .45s, padding .45s var(--ease); border-bottom: 1px solid transparent; padding: 22px 0; }
.topbar.stuck { background: rgba(239, 233, 221, 0.82); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-bottom-color: var(--line); padding: 12px 0; }
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.mark { display: inline-flex; align-items: center; gap: 11px; font-family: var(--f-display); font-weight: 600; font-size: 1.42rem; letter-spacing: -0.02em; }
.mark .glyph { width: 30px; height: 30px; flex: none; }
.mark .glyph svg { width: 100%; height: 100%; }
.mark em { font-style: italic; color: var(--coral); }
.menu { display: flex; align-items: center; gap: 6px; justify-self: center; }
.menu a { padding: 8px 14px; font-size: 0.9rem; color: var(--ink-dim); position: relative; transition: color .3s; }
.menu a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 1.5px; background: var(--coral); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.menu a:hover { color: var(--ink); }
.menu a:hover::after { transform: scaleX(1); }
.menu a.on { color: var(--ink); font-weight: 600; }
.menu a.on::after { transform: scaleX(1); }
.bar-end { justify-self: end; display: flex; align-items: center; gap: 14px; }
.burger { display: none; width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.burger span { width: 19px; height: 2px; background: var(--ink); border-radius: 2px; transition: .35s var(--ease); }
.burger.x span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.x span:nth-child(2) { opacity: 0; }
.burger.x span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   FOOTER — editorial
   ============================================================ */
.foot { border-top: 1px solid var(--ink); padding: clamp(56px, 8vw, 104px) 0 40px; position: relative; margin-top: 60px; }
.foot-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.foot-lede { font-family: var(--f-display); font-size: clamp(1.7rem, 3.2vw, 2.7rem); font-weight: 500; max-width: 15ch; line-height: 1.08; letter-spacing: -0.015em; }
.foot-lede span { font-style: italic; color: var(--coral); }
.foot-col h5 { font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 18px; font-weight: 600; }
.foot-col a { display: block; padding: 6px 0; color: var(--ink-dim); font-size: 0.94rem; transition: color .3s, padding-left .3s; }
.foot-col a:hover { color: var(--coral); padding-left: 6px; }
.foot-base { margin-top: clamp(44px, 7vw, 76px); padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; font-size: 0.8rem; color: var(--ink-faint); }

/* ---------- back to top ---------- */
.up { position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 52px; height: 52px; border-radius: 50%; background: var(--coral); color: var(--cream); display: grid; place-items: center; opacity: 0; transform: translateY(16px) scale(.7); pointer-events: none; transition: .45s var(--ease); box-shadow: var(--shadow); }
.up.show { opacity: 1; transform: none; pointer-events: auto; }
.up:hover { background: var(--ink); }
.up svg { width: 20px; height: 20px; }

/* ---------- cookie strip ---------- */
.ck { position: fixed; left: var(--edge); right: var(--edge); bottom: 22px; z-index: 120; max-width: 700px; margin-inline: auto; padding: 20px 24px; border-radius: var(--r); background: var(--paper-3); border: 1px solid var(--ink); box-shadow: var(--shadow); display: flex; gap: 20px; align-items: center; flex-wrap: wrap; transform: translateY(180%); transition: transform .55s var(--ease); }
.ck.show { transform: none; }
.ck p { font-size: 0.86rem; flex: 1 1 280px; color: var(--ink-2); }
.ck a { color: var(--coral); text-decoration: underline; text-underline-offset: 3px; }
.ck .row { display: flex; gap: 10px; }
.ck .act { padding: 11px 20px; font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-rise] { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 960px) { .foot-top { grid-template-columns: 1fr 1fr; gap: 34px; } }
@media (max-width: 720px) {
  .menu { position: fixed; inset: 0 0 0 auto; width: min(320px, 85vw); flex-direction: column; align-items: stretch; justify-content: flex-start;
    background: var(--paper-3); border-left: 1px solid var(--ink); padding: 96px 22px 40px; gap: 2px; transform: translateX(100%); transition: transform .5s var(--ease); }
  .menu.open { transform: none; }
  .menu a { padding: 15px 16px; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
  .menu a::after { display: none; }
  .burger { display: flex; z-index: 101; }
  .bar { grid-template-columns: auto 1fr; }
  .bar-end .act-cyan { display: none; }
  .foot-top { grid-template-columns: 1fr; }
}
