/* ================================================================
   HiBase — landing page
   Paper + two inks. "Hi" is red ink, "Base" is blue ink.
   ================================================================ */

:root {
  --paper: #F8F7F4;
  --paper-2: #EFEDE8;
  --ink: #141414;
  --ink-soft: #4A4A48;
  --ink-meta: #8A8884;
  --line: rgba(20, 20, 20, 0.12);

  --red: #E1172A;
  --red-deep: #B80F1F;
  --blue: #1C4DD9;
  --blue-deep: #1538A3;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;

  --container: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas { display: block; }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

/* ---------- brand ---------- */
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
}
.brand__hi   { color: var(--red); }
.brand__base { color: var(--blue); }
.brand--inline { font: inherit; letter-spacing: inherit; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  border: 1.5px solid transparent;
  transition: transform 0.35s var(--ease), background 0.25s, color 0.25s, border-color 0.25s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--ink   { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: #000; }
.btn--red   { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-deep); }
.btn--blue  { background: var(--blue); color: #fff; }
.btn--blue:hover { background: var(--blue-deep); }
.btn--paper { background: var(--paper); color: var(--red-deep); }
.btn--paper:hover { background: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  transition: background 0.35s, box-shadow 0.35s, padding 0.35s;
}
.site-header.is-scrolled {
  background: rgba(248, 247, 244, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  box-shadow: 0 1px 0 var(--line);
  padding-block: 12px;
}
.site-nav { display: none; align-items: center; gap: 28px; font-size: 0.92rem; font-weight: 500; }
.site-nav > a:not(.btn) { position: relative; color: var(--ink-soft); }
.site-nav > a:not(.btn):hover { color: var(--ink); }
.site-nav > a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1.5px;
  background: linear-gradient(90deg, var(--red), var(--blue));
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.site-nav > a:not(.btn):hover::after { transform: scaleX(1); }
.lang { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.78rem; }
.lang a { padding: 3px 9px; border-radius: 999px; color: var(--ink-meta); }
.lang a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.burger {
  width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  display: grid; place-content: center; gap: 6px;
}
@media (min-width: 900px) { .site-nav { display: inline-flex; } .burger { display: none; } }
.burger span { display: block; width: 24px; height: 2px; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.3s; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child  { transform: translateY(-4px) rotate(-45deg); }

.overlay { position: fixed; inset: 0; z-index: 40; background: var(--paper); padding: 110px var(--gutter) 40px; }
.overlay__inner { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.overlay__list li a {
  display: flex; align-items: baseline; gap: 18px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-display); font-size: clamp(1.7rem, 7vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em;
}
.overlay__index { font-size: 0.8rem; font-weight: 500; color: var(--red); letter-spacing: 0.1em; }
.overlay__cta { align-self: flex-start; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: flex-start;
  padding: clamp(120px, 17vh, 190px) 0 120px; overflow: hidden; isolation: isolate;
}
.hero-ink { position: absolute; inset: 0; z-index: -1; background: var(--paper); }
/* CSS fallback when WebGL is unavailable: the silhouette as a soft red→blue wash */
.hero-ink.no-webgl::before {
  content: ""; position: absolute; right: 3%; bottom: 4%; width: min(40%, 62vh * 0.95); aspect-ratio: 0.95;
  background: linear-gradient(120deg, rgba(225, 23, 42, 0.85), rgba(28, 77, 217, 0.85));
  -webkit-mask: url("assets/apac-mask.png") center / contain no-repeat;
  mask: url("assets/apac-mask.png") center / contain no-repeat;
  opacity: 0.9;
}
.hero-ink__canvas { position: relative; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s ease; }
.hero-ink__canvas.is-ready { opacity: 1; }
.hero-ink__hk {
  position: absolute; left: 0; top: 0; pointer-events: none;
  padding: 4px 9px 4px 14px; margin: -11px 0 0 10px;
  font-family: var(--font-display); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink); background: rgba(248, 247, 244, 0.86); border: 1px solid var(--line); border-radius: 999px;
  opacity: 0; transition: opacity 0.6s ease 1.4s;
}
.hero-ink__hk::before {
  content: ""; position: absolute; left: -14px; top: 50%; width: 14px; height: 1px; background: var(--ink);
}
.hero-ink__hk.is-ready { opacity: 1; }
.hero-ink__hk[hidden] { display: none; }

.hero__inner { max-width: 1100px; }
.hero__eyebrow {
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 26px;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 6rem);
  font-weight: 700; line-height: 0.98; letter-spacing: -0.04em;
}
.hero__lede {
  margin-top: 28px; max-width: 560px;
  font-size: clamp(1.02rem, 1.5vw, 1.2rem); color: var(--ink-soft);
}
.hero__ctas { margin-top: 36px; }
.hero__ctas > span { display: inline-flex; flex-wrap: wrap; gap: 12px; }

/* staggered line reveal (a la editorial masthead) */
.reveal-line { display: block; overflow: hidden; }
.reveal-line > span {
  display: inline-block;
  transform: translateY(115%);
  animation: lineUp 1s var(--ease) forwards;
  animation-delay: calc(0.35s + var(--i, 0) * 0.11s);
}
@keyframes lineUp { to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .reveal-line > span { transform: none; animation: none; }
}

.hero__scroll {
  position: absolute; left: var(--gutter); bottom: 32px;
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-soft);
}
.hero__scrollLine { width: 48px; height: 1px; background: var(--ink); transform-origin: left; animation: scrollPulse 2.2s var(--ease) infinite; }
@keyframes scrollPulse { 0%, 100% { transform: scaleX(0.4); } 50% { transform: scaleX(1); } }

/* ---------- sections ---------- */
.section { padding: clamp(84px, 11vw, 150px) 0; position: relative; }
.section--paper { background: var(--paper); }
.section--white { background: #fff; }
.section--red   { background: var(--red); color: #fff; }
.section--blue  { background: var(--blue); color: #fff; }

/* paper grain overlay for ink sections */
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.grain > * { position: relative; z-index: 1; }

.tag {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-display); font-size: 0.74rem; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase; opacity: 0.85;
}
.tag__index { font-weight: 700; letter-spacing: 0.1em; }
.tag__index::after { content: ""; display: inline-block; width: 28px; height: 1px; background: currentColor; margin-left: 14px; vertical-align: middle; opacity: 0.7; }

.heading { max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }
.heading h2 {
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 700; line-height: 1.02; letter-spacing: -0.035em;
}
.heading__note { margin-top: 20px; max-width: 600px; color: var(--ink-soft); font-size: 1.05rem; }
.heading--onink .heading__note { color: rgba(255, 255, 255, 0.82); }

/* ---------- statement ---------- */
.statement { max-width: 1040px; }
.statement__punch {
  margin-top: 36px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.6vw, 4.6rem); font-weight: 700; line-height: 1.02; letter-spacing: -0.04em;
}
.statement__line { display: block; }
.statement__punch em {
  font-style: normal; position: relative; display: inline-block; padding: 0 0.12em;
}
.statement__punch em::before {
  content: ""; position: absolute; inset: 12% -0.06em 6%; z-index: -1;
  background: var(--paper); border-radius: 0.12em; transform: rotate(-1.2deg);
}
.statement__punch em { color: var(--red-deep); }
.statement__body { margin-top: 44px; display: grid; gap: 18px; max-width: 640px; font-size: clamp(1.02rem, 1.5vw, 1.2rem); color: rgba(255, 255, 255, 0.9); }
.statement .btn { margin-top: 40px; }

/* ---------- games ---------- */
.game-grid { display: grid; gap: 22px; }
@media (min-width: 820px) { .game-grid { grid-template-columns: 1fr 1fr; } }
.game-card { border-radius: var(--radius); overflow: hidden; }
.game-card__link {
  display: flex; flex-direction: column; height: 100%;
  padding: 30px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--line);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.3s;
}
.game-card__link:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.25); }
.game-card--red  .game-card__link:hover { border-color: var(--red); }
.game-card--blue .game-card__link:hover { border-color: var(--blue); }
.game-card__num { font-family: var(--font-display); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; }
.game-card--red  .game-card__num { color: var(--red); }
.game-card--blue .game-card__num { color: var(--blue); }
.game-card h3 { margin-top: 18px; font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.game-card p { margin-top: 10px; color: var(--ink-soft); }
.game-card__cta { margin-top: auto; padding-top: 22px; font-weight: 600; }
.game-card--red  .game-card__cta { color: var(--red); }
.game-card--blue .game-card__cta { color: var(--blue); }

/* stylised card fan (placeholder art) */
.game-card__art { position: relative; height: 230px; margin-top: 22px; border-radius: 16px; overflow: hidden; background: var(--paper-2); }
.tcg {
  position: absolute; left: 50%; bottom: -8%; width: 120px; aspect-ratio: 5 / 7;
  border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.45);
  display: flex; align-items: flex-end; padding: 10px;
  font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; color: #fff; letter-spacing: 0.02em;
  transition: transform 0.6s var(--ease);
}
.tcg--a { transform: translateX(-120%) rotate(-14deg); }
.tcg--b { transform: translateX(-50%) translateY(-8%); z-index: 1; }
.tcg--c { transform: translateX(20%) rotate(14deg); }
.game-card__link:hover .tcg--a { transform: translateX(-135%) rotate(-18deg) translateY(-4%); }
.game-card__link:hover .tcg--c { transform: translateX(35%) rotate(18deg) translateY(-4%); }
.game-card__link:hover .tcg--b { transform: translateX(-50%) translateY(-16%); }
.game-card--red  .tcg { background: linear-gradient(160deg, #FF5566, var(--red-deep) 60%, #3A0710); }
.game-card--blue .tcg { background: linear-gradient(160deg, #5C8BFF, var(--blue-deep) 60%, #0A1540); }

/* ---------- why ---------- */
.why-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 720px) { .why-grid { grid-template-columns: 1fr 1fr; } }
.why { background: #fff; padding: clamp(26px, 3.5vw, 40px); position: relative; }
.why__num {
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em;
  background: linear-gradient(90deg, var(--red), var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.why h3 { margin-top: 18px; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; }
.why p { margin-top: 12px; color: var(--ink-soft); }

.trust-strip {
  margin-top: 36px; display: flex; flex-wrap: wrap; gap: 10px 28px;
  font-size: 0.9rem; font-weight: 500; color: var(--ink-soft);
}
.trust-strip li { display: inline-flex; align-items: center; gap: 10px; }
.trust-strip li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--red), var(--blue)); }

/* ---------- stores ---------- */
.store-grid { display: grid; gap: 18px; }
@media (min-width: 720px) { .store-grid { grid-template-columns: 1fr 1fr; } }
.store {
  padding: 34px; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
}
.store__label { font-family: var(--font-display); font-size: 0.74rem; letter-spacing: 0.24em; text-transform: uppercase; opacity: 0.8; }
.store h3 { margin-top: 12px; font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.store p:last-child { margin-top: 14px; opacity: 0.85; }

/* ---------- cta ---------- */
.cta__inner { text-align: center; max-width: 820px; }
.cta__title {
  margin-top: 26px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.6vw, 4.4rem); font-weight: 700; line-height: 1.02; letter-spacing: -0.04em;
}
.cta__actions { margin-top: 38px; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.cta__meta { margin-top: 22px; color: var(--ink-meta); font-size: 0.92rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 36px; background: var(--paper); }
.site-footer__inner { display: grid; gap: 36px; }
@media (min-width: 820px) { .site-footer__inner { grid-template-columns: 1fr 2fr; align-items: start; } .site-footer__copy { grid-column: 1 / -1; } }
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; font-size: 0.92rem; }
.site-footer__cols a { display: block; padding: 4px 0; color: var(--ink-soft); }
.site-footer__cols a:hover { color: var(--ink); }
.site-footer__h { font-family: var(--font-display); font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-meta); margin-bottom: 8px; }
.site-footer__copy { color: var(--ink-meta); font-size: 0.82rem; }

/* ---------- scroll reveal ---------- */
.will-reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 0.09s);
}
.will-reveal.is-in { opacity: 1; transform: none; }
