/* MrEGLD — design system
   Apple hierarchy + Wise numbers + Linear motion + Mercury dashboard */

:root {
  --paper: #f4f0e8;
  --paper-2: #ebe6db;
  --ink: #161513;
  --ink-soft: #3d3a35;
  --muted-light: #7a746a;
  --line-light: rgba(22, 21, 19, 0.08);
  --bg: #0c0c0d;
  --bg-2: #131314;
  --bg-3: #1b1b1e;
  --elev: #222226;
  --text: #f3efe7;
  --muted: #9b958b;
  --line: rgba(243, 239, 231, 0.09);
  --gold: #c9a56a;
  --gold-2: #ead7b0;
  --gold-dim: rgba(201, 165, 106, 0.16);
  --good: #8fbf8a;
  --warn: #d4a05a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --font: "Sora", "Inter", system-ui, sans-serif;
  --display: "Fraunces", "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
img { max-width: 100%; display: block; }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.wrap-wide { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  width: min(1240px, calc(100% - 40px));
  margin: 14px auto 0;
  padding: 10px 10px 10px 18px;
  background: rgba(244, 240, 232, 0.72);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line-light);
  border-radius: 999px;
  overflow: visible;
}
.nav.dark {
  background: rgba(12, 12, 13, 0.72);
  border-color: var(--line);
  color: var(--text);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: 0.12em; font-size: 12px; }
.brand-avatar,
.nav .brand > img.brand-avatar,
.side .brand > img.brand-avatar,
a.brand > img.brand-avatar {
  width: 30px !important;
  height: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  flex: 0 0 30px !important;
  border: 1px solid rgba(201, 165, 106, 0.72);
  border-radius: 50% !important;
  object-fit: cover !important;
  object-position: center;
  display: block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  /* never inherit hero/card sizing */
  min-width: 30px;
  min-height: 30px;
}
.nav-links { display: flex; gap: 22px; font-size: 13.5px; color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 8px; }
.lang-menu { position: relative; }
.lang-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-light); background: transparent; color: inherit;
  border-radius: 999px; padding: 6px 10px; cursor: pointer; font-size: 11.5px;
  letter-spacing: 0.04em; font-weight: 500;
  transition: border-color .2s ease, background .2s ease;
}
.lang-trigger:hover { border-color: rgba(22,21,19,.18); background: rgba(255,255,255,.35); }
.nav.dark .lang-trigger, .dark-page .lang-trigger {
  border-color: var(--line); color: var(--text);
}
.nav.dark .lang-trigger:hover, .dark-page .lang-trigger:hover {
  border-color: rgba(243,239,231,.22); background: rgba(255,255,255,.04);
}
.lang-flag { width: 24px; height: 16px; flex: 0 0 24px; object-fit: cover; border-radius: 2px; }
.lang-code { font-family: var(--mono); font-size: 11px; }
.lang-popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 120;
  min-width: 168px;
  padding: 6px;
  background: rgba(255,253,248,.96);
  border: 1px solid var(--line-light);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  backdrop-filter: blur(16px);
  display: none;
  flex-direction: column;
  gap: 2px;
}
.lang-menu.open .lang-popover,
.lang-popover:not([hidden]) {
  display: flex;
}
.dark-page .lang-popover {
  background: rgba(22,22,26,.96);
  border-color: var(--line);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  color: var(--text);
}
.lang-popover[hidden] { display: none !important; }
.nav-cta, .lang-menu, .app-head { overflow: visible; }
.lang-popover button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  border: 0; background: transparent; color: inherit;
  border-radius: 10px; padding: 8px 10px; cursor: pointer;
  font-size: 12.5px; text-align: left;
}
.lang-popover button .lang-code {
  font-size: 11px;
  letter-spacing: 0.04em;
}
.lang-popover button:hover { background: rgba(22,21,19,.06); }
.dark-page .lang-popover button:hover { background: rgba(255,255,255,.06); }
.lang-popover button.active {
  background: rgba(201,165,106,.16); color: #8a5a22;
}
.dark-page .lang-popover button.active {
  background: var(--gold-dim); color: var(--gold-2);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 18px;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-gold { background: var(--gold); color: #1a140c; }
.btn-ghost { background: transparent; border: 1px solid var(--line-light); color: inherit; }
.nav.dark .btn-ghost, .dark-page .btn-ghost { border-color: var(--line); }
.btn-lg { padding: 14px 22px; font-size: 14.5px; }

/* HERO */
.hero { padding: 72px 0 40px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-light); margin-bottom: 22px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(143,191,138,.18); }
.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  max-width: 14ch;
}
.hero h1 em { font-style: italic; color: #8a5a22; }
.lede { margin-top: 22px; max-width: 46ch; font-size: 18px; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; color: var(--muted-light); font-size: 13px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center;
}
.card-stage {
  position: relative; min-height: 420px;
  display: grid; place-items: center;
  perspective: 1100px;
  perspective-origin: 55% 40%;
}
.card-stage img.card-photo {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  filter: drop-shadow(0 36px 48px rgba(0,0,0,.28));
  transform-style: preserve-3d;
  /* Card tilts clockwise; the shorter, wider plate tilts the other way. */
  transform: rotateZ(12deg) rotateY(-14deg) rotateX(7deg);
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%,100% {
    transform: rotateZ(12deg) rotateY(-14deg) rotateX(7deg) translateY(0);
  }
  50% {
    transform: rotateZ(10.5deg) rotateY(-12deg) rotateX(6deg) translateY(-10px);
  }
}

/* SECTIONS */
section { padding: 88px 0; }
.section-label { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-light); margin-bottom: 14px; }
h2 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.03em; line-height: 1.05;
}
.sub { margin-top: 12px; color: var(--ink-soft); max-width: 52ch; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.step {
  background: #fffdf8; border: 1px solid var(--line-light);
  border-radius: var(--radius); padding: 24px;
  min-height: 210px;
}
.num { font-family: var(--mono); font-size: 12px; color: var(--gold); margin-bottom: 28px; }
.step h3 { font-size: 20px; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: 14.5px; }

/* CALCULATOR */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 40px; }
.panel {
  background: #fffdf8; border: 1px solid var(--line-light);
  border-radius: 24px; padding: 26px;
}
.field { margin-bottom: 18px; }
.field label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; color: var(--ink-soft); }
input[type="range"] { width: 100%; accent-color: var(--ink); }
.result-num {
  font-family: var(--display); font-size: 64px; letter-spacing: -0.04em; line-height: 1;
}
.result-num span { font-size: 22px; color: var(--muted-light); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.mini { background: var(--paper-2); border-radius: 14px; padding: 14px; }
.mini b { display: block; font-size: 20px; }
.mini span { font-size: 12px; color: var(--muted-light); }

/* CATALOG */
.tabs { display: flex; gap: 8px; margin: 32px 0 18px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line-light); background: transparent;
  border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 13px;
}
.tab.active { background: var(--ink); color: var(--paper); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.reward {
  background: #fffdf8; border: 1px solid var(--line-light);
  border-radius: 20px; padding: 20px; min-height: 180px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.reward .pts { font-family: var(--mono); font-size: 12px; color: #8a5a22; }
.reward h3 { font-size: 18px; margin: 10px 0 6px; }
.reward p { color: var(--ink-soft); font-size: 14px; }

/* DARK PRODUCT BAND */
.dark-band {
  background: var(--bg);
  color: var(--text);
  padding: 96px 0;
  border-radius: 36px;
  margin: 20px auto;
  width: min(1240px, calc(100% - 24px));
}
.dark-band .section-label, .dark-band .sub { color: var(--muted); }
.dash {
  margin-top: 36px;
  background: linear-gradient(180deg, #1a1a1d, #121214);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.dash-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.bento { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.tile {
  background: #18181b; border: 1px solid var(--line);
  border-radius: 18px; padding: 18px;
}
.tile.span { grid-column: 1 / 2; grid-row: 1 / 3; }
.tile .lbl { font-size: 12px; color: var(--muted); }
.tile .big { font-family: var(--display); font-size: 42px; letter-spacing: -0.03em; margin: 8px 0; }
.bar { height: 8px; background: #2a2a2e; border-radius: 99px; overflow: hidden; margin: 14px 0 8px; }
.bar > i { display: block; height: 100%; width: 72%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.row-item { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }

/* TRUST */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 36px; }
.trust article {
  border: 1px solid var(--line-light); border-radius: 18px; padding: 18px; background: #fffdf8;
}
.trust h3 { font-size: 16px; margin-bottom: 6px; }
.trust p { font-size: 13.5px; color: var(--ink-soft); }

.cta-end {
  text-align: center; padding: 100px 0 60px;
}
.cta-end h2 { max-width: 16ch; margin: 0 auto; }

footer {
  border-top: 1px solid var(--line-light);
  padding: 28px 0 48px; color: var(--muted-light); font-size: 13px;
}
.foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* APP SHELL */
.dark-page { background: var(--bg); color: var(--text); }
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--line); padding: 22px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.side a, .side button.navi {
  width: 100%; text-align: left; background: transparent; border: 0; color: var(--muted);
  padding: 10px 12px; border-radius: 12px; cursor: pointer; font-size: 14px;
}
.side a.active, .side button.navi.active, .side a:hover, .side button.navi:hover {
  background: var(--elev); color: var(--text);
}
.app-main { padding: 28px 28px 60px; }
.app-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; }
.app-head h1 { font-family: var(--display); font-size: 34px; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hidden { display: none !important; }

.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: grid; place-items: center; z-index: 80; padding: 20px;
}
.modal {
  width: min(420px, 100%);
  background: #fffdf8; color: var(--ink);
  border-radius: 24px; padding: 24px;
}
.modal h3 { font-family: var(--display); font-size: 28px; margin-bottom: 8px; }
.modal p { color: var(--ink-soft); margin-bottom: 18px; }
.modal input[type="email"] {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-light); margin-bottom: 10px; background: #fff;
}
.or { text-align: center; font-size: 12px; color: var(--muted-light); margin: 8px 0; }

@media (max-width: 900px) {
  .hero-grid, .calc-grid, .steps, .cards, .bento, .trust, .grid-2, .grid-3, .app-shell {
    grid-template-columns: 1fr;
  }
  .tile.span { grid-column: auto; grid-row: auto; }
  .nav-links { display: none; }
  .hero { padding-top: 36px; }
  .card-stage { min-height: 280px; }
  section { padding: 64px 0; }
  .app-main { padding: 18px; }
}
