/* ==========================================================================
   ERETIA — corporate site
   Layers: .ocean (fixed decorative background)  /  .page (foreground content)
   ========================================================================== */

:root {
  /* Ocean identity */
  --ocean-deep: #072a6b;
  --ocean-cobalt: #1652d6;
  --ocean-aqua: #3fb4ea;
  --ocean-foam: #a9e6ff;

  /* Neutrals */
  --ink: #0a1b3d;
  --ink-soft: #46557a;
  --surface: #ffffff;
  --surface-tint: #f6f8fc;
  --line: rgba(10, 27, 61, .08);

  /* Brand accents */
  --amber: #ffb547;
  --cobalt: #2f6bff;

  /* Type */
  --font-display: "Fredoka", "Nunito", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Shape & depth */
  --radius-xl: 36px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 6px rgba(4, 22, 64, .08);
  --shadow-md: 0 14px 34px -12px rgba(4, 22, 64, .35), 0 2px 6px rgba(4, 22, 64, .08);
  --shadow-lg: 0 30px 60px -24px rgba(4, 22, 64, .55), 0 4px 12px rgba(4, 22, 64, .1);

  /* Layout */
  --gutter: clamp(16px, 5vw, 72px);
  --content: 1120px;
  --stack: clamp(28px, 5vw, 56px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ocean-deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink); font-weight: 800;
  transform: translateY(-150%); transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

/* ==========================================================================
   Background layer — ocean
   ========================================================================== */
.ocean {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(169, 230, 255, .55), transparent 55%),
    linear-gradient(180deg, var(--ocean-aqua) 0%, var(--ocean-cobalt) 42%, var(--ocean-deep) 100%);
}
.ocean__light {
  position: absolute; inset: -20% -10% auto;
  height: 90%;
  background:
    repeating-linear-gradient(100deg, rgba(255, 255, 255, .07) 0 40px, transparent 40px 130px);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  animation: caustic 22s linear infinite;
}
.ocean__life { position: absolute; inset: 0; }

.sea {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: auto;
  opacity: var(--o);
  transform: rotate(var(--r));
  animation: drift var(--t, 12s) ease-in-out var(--dl, 0s) infinite alternate;
  will-change: transform;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) rotate(var(--r)); }
  to   { transform: translate3d(10px, -18px, 0) rotate(calc(var(--r) + 5deg)); }
}
@keyframes caustic {
  from { transform: translateX(0); }
  to   { transform: translateX(130px); }
}

/* ==========================================================================
   Foreground layer
   ========================================================================== */
.page {
  position: relative;
  z-index: 1;
  width: min(var(--content), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: 20px 32px;
}
main { display: grid; gap: var(--stack); margin-block: var(--stack); }

.surface {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: max(12px, env(safe-area-inset-top, 0px));
  z-index: 10;
}
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  width: fit-content;
  margin-inline: auto;
  padding: 8px 8px 8px 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
}
.nav__brand img { height: 34px; width: auto; }
.nav__links { display: flex; gap: 2px; padding-left: 20px; border-left: 2px solid var(--line); }
.nav__links a {
  display: block;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  color: var(--ink-soft);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.nav__links a:hover { background: var(--surface-tint); color: var(--ink); }
.nav__links a[aria-current="true"] { background: var(--ink); color: #fff; }

.nav__toggle {
  display: none;
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: var(--surface-tint); cursor: pointer;
  place-content: center; gap: 6px;
}
.nav__toggle-bar { display: block; width: 20px; height: 2.5px; border-radius: 2px; background: var(--ink); transition: transform .25s var(--ease); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { transform: translateY(4.25px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) { transform: translateY(-4.25px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.btn--primary { background: var(--ink); color: #fff; box-shadow: 0 10px 22px -10px rgba(10, 27, 61, .8); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -12px rgba(10, 27, 61, .8); }
.btn--ghost { background: var(--surface-tint); color: var(--ink); }
.btn--ghost:hover { transform: translateY(-2px); background: #eaf0fb; }

/* ---------- Hero ---------- */
.hero {
  display: grid; justify-items: center; text-align: center;
  gap: 22px;
  padding: clamp(48px, 8vw, 96px) clamp(22px, 6vw, 80px);
  position: relative; overflow: hidden;
}
.hero::before {
  /* soft brand halo behind the logo — stays white-surface friendly */
  content: ""; position: absolute; inset: -40% 10% auto; height: 80%;
  background: radial-gradient(closest-side, rgba(255, 181, 71, .16), transparent);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero__logo { width: min(420px, 78%); animation: rise .9s var(--ease) both; }
.hero__title {
  font-size: clamp(2.2rem, 5.6vw, 4.1rem);
  font-weight: 700;
  animation: rise .9s .08s var(--ease) both;
}
.hero__title span { color: var(--cobalt); }
.hero__lead {
  max-width: 34ch;
  font-size: clamp(1.08rem, 1.9vw, 1.3rem);
  color: var(--ink-soft);
  animation: rise .9s .16s var(--ease) both;
}
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; animation: rise .9s .24s var(--ease) both; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Section head ---------- */
.section-head {
  justify-self: center;
  text-align: center;
  padding: 22px 40px;
}
.surface--pill { border-radius: var(--radius-pill); }
.section-head__title { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 700; }
.section-head__sub { color: var(--ink-soft); font-weight: 600; margin-top: 4px; }

/* ==========================================================================
   Game showcases — each game owns its palette via custom properties
   ========================================================================== */
.games { display: grid; gap: var(--stack); }

.game {
  --g-bg: #fff;
  --g-ink: var(--ink);
  --g-soft: var(--ink-soft);
  --g-accent: var(--ink);
  --g-chip: #f1f1f1;
  --g-art-bg: #f6f6f6;

  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(16px, 2.4vw, 28px);
  border-radius: var(--radius-xl);
  background: var(--g-bg);
  color: var(--g-ink);
  box-shadow: var(--shadow-lg);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.game:hover { transform: translateY(-4px); }
.game--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.game--flip .game__art { order: 2; }

.game__art {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--g-art-bg);
  aspect-ratio: 3 / 2;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04), 0 18px 30px -20px rgba(0, 0, 0, .45);
}
.game__art img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.game:hover .game__art img { transform: scale(1.035); }

.game__info { display: grid; gap: 18px; justify-items: start; padding: clamp(8px, 2vw, 20px) clamp(8px, 2vw, 24px) clamp(16px, 2vw, 24px) 0; }
.game--flip .game__info { padding-inline: clamp(8px, 2vw, 24px) 0; }

.game__release {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 16px 6px 6px;
  border-radius: var(--radius-pill);
  background: var(--g-chip);
  color: var(--g-soft);
  font-weight: 700; font-size: .92rem;
}
.game__release strong { color: var(--g-ink); font-weight: 800; }
.game__index {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--g-accent); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: .9rem;
}
.game__title { font-size: 0; }
.game__logo { width: min(100%, 400px); height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .12)); transition: transform .4s var(--ease); }
.game:hover .game__logo { transform: rotate(-1.5deg) scale(1.02); }
.game__logo--queen { width: min(100%, 330px); }
.game__title--text { font-size: clamp(2.2rem, 4.6vw, 3.3rem); font-weight: 700; }
.game__desc { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--g-soft); max-width: 40ch; text-wrap: pretty; }

.game__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.game__tags li {
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--g-chip); color: var(--g-ink);
  font-weight: 700; font-size: .85rem;
}

/* Oh My Elevator! — sunny, candy-bright */
.game--elevator {
  --g-bg: linear-gradient(160deg, #fffbe9 0%, #fff1cf 100%);
  --g-ink: #2a1846;
  --g-soft: #5d4b78;
  --g-accent: #ff5a5f;
  --g-chip: #ffe49a;
  --g-art-bg: #ffe9a8;
  background: linear-gradient(160deg, #fffbe9 0%, #fff1cf 100%);
}
/* Queen of Oumok — ivory, crimson & gold */
.game--queen {
  --g-ink: #3a0d1e;
  --g-soft: #6e3a48;
  --g-accent: #a51a3b;
  --g-chip: #f6e2c4;
  --g-art-bg: #7a1f4c;
  background: linear-gradient(160deg, #fffaf2 0%, #f8ead6 100%);
  box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(201, 138, 28, .28);
}
.game--elevator .game__art img { object-position: 0% 50%; }
.game--queen .game__art img { object-position: 68% 50%; }
/* Coming Soon — twilight teaser */
.game--soon {
  --g-ink: #fff6e6;
  --g-soft: #d8c8f0;
  --g-accent: #ff8fc0;
  --g-chip: rgba(255, 255, 255, .1);
  --g-art-bg: #1d0c3a;
  background: linear-gradient(160deg, #2a1550 0%, #160a30 100%);
}
.game--soon .game__title--text {
  background: linear-gradient(90deg, #fff4d6, #ffb3d4 60%, #c7a8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(32px, 6vw, 72px);
}
.about__head { display: grid; gap: 18px; align-content: start; }
.about__mark { width: 72px; height: 72px; }
.about__title { font-size: clamp(2rem, 4.2vw, 2.9rem); font-weight: 700; }
.about__body { display: grid; gap: 16px; font-size: clamp(1.05rem, 1.6vw, 1.18rem); color: var(--ink-soft); }
.about__body p:first-child { color: var(--ink); font-weight: 700; }
.about__facts {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  margin: 8px 0 0;
}
.about__facts div { padding: 18px 22px; border-radius: var(--radius-md); background: var(--surface-tint); }
.about__facts dt { font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cobalt); }
.about__facts dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }

/* ---------- Footer ---------- */
.site-footer {
  display: grid; justify-items: center; gap: 14px; text-align: center;
  padding: 36px 24px 28px;
}
.site-footer__logo { height: 36px; width: auto; }
.site-footer__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; color: var(--ink-soft); font-weight: 700; }
.site-footer__meta li + li::before { content: "•"; margin-right: 22px; color: #c3cbe0; }
.site-footer__copy { font-size: .9rem; color: #7d89a8; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .game, .game--flip, .about { grid-template-columns: 1fr; }
  .game--flip .game__art { order: 0; }
  .game__info, .game--flip .game__info { padding: 4px 8px 12px; }
  .about__facts { grid-template-columns: 1fr; }
  .sea--far { display: none; }
}

@media (max-width: 680px) {
  html { scroll-padding-top: 88px; }
  .nav { width: auto; padding: 8px 8px 8px 18px; flex-wrap: wrap; border-radius: 28px; }
  .nav__brand img { height: 30px; }
  .nav__toggle { display: grid; }
  .nav__links { display: none; width: 100%; flex-direction: column; padding: 6px 0 4px; border-left: 0; }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px 16px; font-size: 1.05rem; }
  .section-head { padding: 18px 26px; border-radius: var(--radius-lg); }
  .site-footer__meta { flex-direction: column; gap: 2px; }
  .site-footer__meta li + li::before { content: none; }
  .hero__actions .btn { flex: 1 1 100%; }
  .game__release { flex-wrap: nowrap; border-radius: 22px; padding-right: 18px; line-height: 1.25; }
  .game__when strong { display: block; font-size: 1rem; }
  .game__index { width: 30px; height: 30px; font-size: .8rem; }
  .sea { width: calc(var(--s) * .72); }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
