/* Geo-Land — Calm horizon theme
   Soft slate-sky, restrained contrast, photo-first hero */
:root {
  --bg-deep: #d9e4ee;
  --bg: #e4edf5;
  --bg-elevated: #f3f6f9;
  --bg-card: #f8fafc;
  --bg-hover: #e8eef4;
  --border: rgba(45, 90, 130, 0.16);
  --border-subtle: rgba(45, 80, 120, 0.1);
  --accent: #2a6f9e;
  --accent-deep: #1e557a;
  --accent-soft: #5a9bc4;
  --teal: #3d8f9a;
  --teal-bright: #2f7d87;
  --text: #1c2d3c;
  --text-muted: #5c6f80;
  --text-dim: #8a9bab;
  --success: #2d8a5e;
  --danger: #c44242;
  --warning: #b8860b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(40, 70, 100, 0.1);
  --shadow-soft: 0 6px 18px rgba(40, 70, 100, 0.07);
  --font: "Segoe UI", "SF Pro Text", system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI", "SF Pro Display", Georgia, system-ui, sans-serif;
  --max: 1100px;
  --nav-h: 68px;

  /* legacy aliases used in some components */
  --gold: var(--accent);
  --gold-bright: var(--accent-deep);
  --gold-dim: var(--accent-soft);
  --ocean: var(--accent-soft);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Quiet atmospheric wash — not pure white */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 70% at 50% -15%, rgba(255, 255, 255, 0.55), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(120, 160, 195, 0.22), transparent 50%),
    radial-gradient(ellipse 45% 35% at 0% 40%, rgba(100, 145, 175, 0.14), transparent 50%),
    linear-gradient(180deg, #cfdce8 0%, #e4edf5 38%, #dce6ef 100%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 40% 18% at 20% 12%, rgba(255, 255, 255, 0.35), transparent 70%),
    radial-gradient(ellipse 30% 14% at 75% 18%, rgba(255, 255, 255, 0.22), transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-deep);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* ——— Layout ——— */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4.5vw, 2rem);
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.section {
  padding: 4.5rem 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.section-title span {
  color: var(--accent);
}

.section-lead {
  color: var(--text-muted);
  max-width: 34rem;
  margin-bottom: 2.25rem;
  font-size: 1.02rem;
}

/* ——— Nav ——— */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(14px) saturate(1.1);
  background: rgba(232, 239, 246, 0.9);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  gap: 0.65rem;
  padding: 0.55rem clamp(1.25rem, 4.5vw, 2rem);
  box-sizing: border-box;
  min-width: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 0;
}

.logo-text {
  white-space: nowrap;
}

/* Plain Earth sticker — no rectangular frame */
.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow:
    0 2px 8px rgba(30, 55, 90, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.35);
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
  line-height: 0;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  list-style: none;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.nav-links a {
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.88rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.55);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  min-width: 0;
}

.lang-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 2px;
  gap: 1px;
  flex-shrink: 0;
}

.lang-toggle button {
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.lang-toggle button.active {
  background: var(--accent);
  color: #fff;
}

/* Full vs short enter label (phone uses short) */
.nav-btn-enter .enter-short {
  display: none;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.68rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(165deg, #4a8cb8, #2a6f9e 55%, #245f88);
  color: #fff;
  box-shadow: 0 4px 14px rgba(42, 111, 158, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(42, 111, 158, 0.34);
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--border);
  color: var(--accent-deep);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-deep);
}

.btn-teal {
  background: linear-gradient(165deg, #4fa3ac, #3d8f9a);
  color: #fff;
  box-shadow: 0 4px 14px rgba(61, 143, 154, 0.25);
}

.btn-teal:hover {
  transform: translateY(-1px);
  color: #fff;
}

.btn-danger {
  background: rgba(196, 66, 66, 0.08);
  border-color: rgba(196, 66, 66, 0.28);
  color: #a83636;
}

.btn-danger:hover {
  background: rgba(196, 66, 66, 0.16);
  color: #8f2a2a;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.btn-sm {
  padding: 0.38rem 0.85rem;
  font-size: 0.84rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  z-index: 1;
  padding: clamp(2rem, 5vh, 3.25rem) 0 clamp(2.5rem, 6vh, 3.75rem);
  /* No full-viewport stretch — avoids empty “??” void under content */
  min-height: 0;
  display: flex;
  align-items: center;
  overflow-x: clip;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 3.5vw, 2.75rem);
  align-items: center;
  width: 100%;
  min-width: 0;
}

.hero-copy {
  min-width: 0;
  max-width: 36rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-eyebrow::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: var(--teal);
  opacity: 0.85;
  flex-shrink: 0;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4.2vw, 3.25rem);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
  color: var(--text);
  overflow-wrap: anywhere;
  hyphens: manual;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 32rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.75rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.35rem 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  max-width: 100%;
}

.hero-stat strong {
  display: block;
  font-size: 1.4rem;
  color: var(--accent-deep);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-stat span {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  display: block;
}

/* ——— Earth photo (hero right) ——— */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.earth-frame {
  margin: 0 auto;
  width: min(100%, 400px);
  max-width: min(100%, 42vw);
  text-align: center;
  position: relative;
}

/* soft glow behind planet */
.earth-frame::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 88%;
  height: 88%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(70, 120, 170, 0.28), transparent 68%);
  filter: blur(14px);
  z-index: 0;
  pointer-events: none;
}

.earth-orb {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
  /* robust square + circle (older Safari safe) */
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  -webkit-mask-image: radial-gradient(circle, #000 99%, transparent 100%);
  mask-image: radial-gradient(circle, #000 99%, transparent 100%);
  clip-path: circle(50% at 50% 50%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.25),
    0 0 0 8px rgba(255, 255, 255, 0.05),
    0 22px 48px rgba(30, 55, 90, 0.26);
  animation: earth-float 10s ease-in-out infinite;
}

.earth-orb picture {
  display: block;
  width: 100%;
  height: 100%;
}

.earth-orb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  max-width: 100%;
}

.earth-credit {
  position: relative;
  z-index: 1;
  margin-top: 0.85rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

@keyframes earth-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ——— Ascent path ——— */
.ascent {
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.28), transparent);
}

.path-track {
  display: grid;
  gap: 0;
  position: relative;
  margin-top: 0.5rem;
}

.path-track::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent), var(--accent-deep));
  border-radius: 999px;
  opacity: 0.4;
}

.path-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.15rem;
  padding: 0.95rem 0;
  cursor: default;
}

.path-dot {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--accent-soft);
  display: grid;
  place-items: center;
  font-weight: 750;
  color: var(--accent);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
  transition: all 0.25s;
  box-shadow: var(--shadow-soft);
}

.path-step:hover .path-dot {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(42, 111, 158, 0.2);
}

.path-step.final .path-dot {
  background: linear-gradient(145deg, #4a8cb8, #2a6f9e);
  color: #fff;
  border-color: transparent;
}

.path-body {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.05rem 1.25rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  box-shadow: var(--shadow-soft);
}

.path-step:hover .path-body {
  border-color: var(--border);
  transform: translateX(3px);
  box-shadow: var(--shadow);
}

.path-body h3 {
  font-size: 1.02rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.path-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.path-tag {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(61, 143, 154, 0.1);
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}

/* ——— Topics ——— */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.8rem;
}

.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.15rem 0.9rem;
  text-align: center;
  transition: all 0.25s;
  cursor: default;
  box-shadow: var(--shadow-soft);
}

.topic-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.topic-icon {
  font-size: 1.6rem;
  margin-bottom: 0.55rem;
  display: block;
}

.topic-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.topic-card p {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.materials-cta {
  margin-top: 1.75rem;
}

.materials-cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.25rem 1.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.materials-cta-inner h3 {
  font-size: 1.05rem;
  color: var(--accent-deep);
  margin-bottom: 0.25rem;
}

.materials-cta-inner p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 36rem;
}

/* ——— Mentor / medals ——— */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-soft);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  color: var(--accent-deep);
}

.card p {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.mentor-role {
  font-size: 0.82rem !important;
  font-weight: 600;
  color: var(--teal) !important;
  margin-bottom: 0.65rem;
}

/* ——— iGeo achievements map (collapsed by default) ——— */
.igeo-map-reveal {
  margin-top: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 242, 250, 0.95));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.igeo-map-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: background 0.2s;
}

.igeo-map-toggle:hover {
  background: rgba(47, 111, 158, 0.06);
}

.igeo-map-toggle-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.igeo-map-toggle-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: linear-gradient(145deg, #e8f4fc, #d4e8f5);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 #fff;
}

.igeo-map-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.igeo-map-toggle-text strong {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-deep);
}

.igeo-map-toggle-text span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.igeo-map-chevron {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: var(--accent);
  background: rgba(47, 111, 158, 0.08);
  border: 1px solid var(--border-subtle);
  transition: transform 0.35s ease, background 0.2s;
}

.igeo-map-reveal.is-open .igeo-map-chevron {
  transform: rotate(180deg);
  background: rgba(47, 111, 158, 0.14);
}

.igeo-map-panel {
  border-top: 1px solid transparent;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(90, 160, 210, 0.12), transparent 55%),
    #f4f8fc;
  padding: 0 1rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.35s ease, padding 0.35s ease, border-color 0.25s;
}

.igeo-map-reveal.is-open .igeo-map-panel {
  max-height: 960px;
  opacity: 1;
  padding: 1rem 1rem 1.15rem;
  border-top-color: var(--border-subtle);
}

.igeo-map-panel[hidden] {
  display: none;
}

.igeo-map-reveal.is-open .igeo-map-panel[hidden] {
  display: block;
}

.igeo-map-figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #fff;
  box-shadow: 0 12px 32px rgba(40, 70, 100, 0.1);
}

.igeo-map-figure img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

.igeo-map-figure figcaption {
  padding: 0.55rem 0.85rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: linear-gradient(180deg, #fafcfe, #f0f6fb);
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 640px) {
  .igeo-map-toggle {
    padding: 0.9rem 1rem;
  }
  .igeo-map-toggle-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }
  .igeo-map-toggle-text span {
    font-size: 0.78rem;
  }
  .igeo-map-reveal.is-open .igeo-map-panel {
    padding: 0.75rem;
  }
}

.medal-list {
  list-style: none;
  display: grid;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.medal-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.medal-list .m {
  font-size: 1.15rem;
  line-height: 1;
}

/* ——— CTA ——— */
.cta-band {
  text-align: center;
  padding: 3.5rem 2rem;
  background:
    radial-gradient(ellipse at center, rgba(90, 140, 180, 0.12), transparent 60%),
    linear-gradient(180deg, #d5e2ed, #e4edf5);
  border-block: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1;
}

.cta-band h2 {
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  margin-bottom: 0.65rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.cta-band p {
  color: var(--text-muted);
  margin-bottom: 1.35rem;
  max-width: 26rem;
  margin-inline: auto;
}

/* ——— Footer ——— */
.footer {
  padding: 2.25rem 0;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1;
  color: var(--text-dim);
  font-size: 0.85rem;
  background: rgba(220, 230, 240, 0.45);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

/* ——— Modal ——— */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(25, 45, 65, 0.4);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: min(100%, 400px);
  background: #f5f8fb;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 1.85rem;
  box-shadow: 0 24px 50px rgba(30, 55, 85, 0.2);
  transform: translateY(12px);
  transition: transform 0.25s;
  position: relative;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal h2 {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.modal .hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.35rem;
}

.form-group {
  margin-bottom: 0.95rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(90, 155, 196, 0.2);
}

.form-error {
  color: var(--danger);
  font-size: 0.84rem;
  margin-bottom: 0.7rem;
  min-height: 1.2em;
}

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.95rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
}

/* ——— App shell ——— */
.app-main {
  width: 100%;
  max-width: var(--max);
  margin: 1.35rem auto 2.75rem;
  padding-inline: clamp(1.25rem, 4.5vw, 2rem);
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-teacher {
  background: rgba(42, 111, 158, 0.1);
  color: var(--accent-deep);
  border: 1px solid rgba(42, 111, 158, 0.2);
}

.badge-student {
  background: rgba(61, 143, 154, 0.1);
  color: var(--teal);
  border: 1px solid rgba(61, 143, 154, 0.2);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 0.95rem;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-soft);
}

.dash-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.dash-card .icon {
  font-size: 1.6rem;
}

.dash-card h3 {
  font-size: 1.05rem;
  color: var(--text);
}

.dash-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  flex: 1;
}

.dash-card .meta {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.dash-card-wa {
  align-items: center;
  text-align: center;
}

.dash-card-wa p {
  text-align: center;
}

.wa-qr-link {
  display: block;
  margin: 0.25rem auto;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s, box-shadow 0.15s;
}

.wa-qr-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.wa-qr {
  width: 160px;
  height: 160px;
  display: block;
  image-rendering: pixelated;
}

.wa-phone {
  margin-top: 0.15rem !important;
  letter-spacing: 0.02em;
}

.q-img-preview {
  margin: 0.65rem 0 0.85rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #fff;
  max-width: 420px;
}

.q-img-preview img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 320px;
  object-fit: contain;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.check-row input {
  width: 1.05rem;
  height: 1.05rem;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1.15rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.cat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border);
  box-shadow: var(--shadow);
  color: inherit;
}

.cat-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.cat-card h3 {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text);
}

.form-group select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  outline: none;
  color: var(--text);
}

.form-group select:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(90, 155, 196, 0.2);
}

.cat-chip-row,
.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cat-chip,
.mode-chip {
  border: 1px solid var(--border-subtle);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-chip:hover,
.mode-chip:hover {
  border-color: var(--border);
  background: var(--bg-hover);
}

.cat-chip.is-on,
.mode-chip.is-on {
  background: linear-gradient(165deg, #4a8cb8, #2a6f9e);
  border-color: transparent;
  color: #fff;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.user-chip strong {
  color: var(--text);
  font-weight: 600;
}

/* ——— Quiz ——— */
.quiz-progress {
  height: 5px;
  background: rgba(45, 80, 120, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.35rem;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  border-radius: 999px;
  transition: width 0.3s;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow-soft);
}

.question-card .q-num {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.question-card .q-text {
  font-size: 1rem;
  margin-bottom: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.q-statements {
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.q-statements li {
  padding: 0.18rem 0;
}

.options {
  display: grid;
  gap: 0.45rem;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
  color: var(--text);
}

.option:hover {
  border-color: var(--accent-soft);
  background: #fff;
}

.option.selected {
  border-color: var(--accent);
  background: rgba(42, 111, 158, 0.08);
}

.option.correct {
  border-color: var(--success);
  background: rgba(45, 138, 94, 0.08);
}

.option.wrong {
  border-color: var(--danger);
  background: rgba(196, 66, 66, 0.06);
}

.option-letter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.option.selected .option-letter {
  background: var(--accent);
  color: #fff;
}

.calc-answer {
  margin-top: 0.65rem;
}

.calc-answer textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.7rem;
  color: var(--text);
}

.calc-answer textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(90, 155, 196, 0.2);
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: flex-end;
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border-subtle);
}

.result-banner {
  background: linear-gradient(155deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.85rem;
  text-align: center;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow-soft);
}

.result-banner .score {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--accent-deep);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0.45rem 0;
}

.result-banner .score span {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ——— Tables ——— */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.data th,
table.data td {
  padding: 0.8rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

table.data th {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data tr:hover td {
  background: rgba(255, 255, 255, 0.4);
}

.status-pill {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-pill.done {
  background: rgba(45, 138, 94, 0.1);
  color: var(--success);
}

.status-pill.pending {
  background: rgba(184, 134, 11, 0.1);
  color: var(--warning);
}

.empty-state {
  text-align: center;
  padding: 2.75rem 1.5rem;
  color: var(--text-muted);
}

.empty-state .big {
  font-size: 2.35rem;
  margin-bottom: 0.65rem;
}

.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-top: 0.9rem;
  box-shadow: var(--shadow-soft);
}

.detail-panel h3 {
  margin-bottom: 0.9rem;
  color: var(--accent-deep);
}

.answer-row {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.answer-row:last-child {
  border-bottom: none;
}

.answer-row .label {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 0.22rem;
}

.mark-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: flex-end;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
}

.mark-row .form-group {
  margin: 0;
  flex: 1;
  min-width: 120px;
}

.storage-banner {
  background: rgba(42, 111, 158, 0.08);
  border: 1px solid rgba(42, 111, 158, 0.18);
  color: var(--accent-deep);
  padding: 0.6rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  margin-bottom: 1.15rem;
}

.hidden {
  display: none !important;
}

/* ——— Laptop / tablet landscape ——— */
@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(200px, 0.8fr);
    gap: 1.5rem 1.75rem;
  }

  .earth-frame {
    width: min(100%, 300px);
    max-width: min(100%, 36vw);
  }

  .earth-orb {
    max-width: 300px;
  }

  .hero h1 {
    font-size: clamp(1.95rem, 3.8vw, 2.75rem);
  }
}

/* ——— Tablet portrait ——— */
@media (max-width: 860px) {
  .hero-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 1.75rem 0 2.5rem;
    min-height: auto;
  }

  .earth-frame {
    width: min(72vw, 280px);
    margin: 0.25rem auto 0.5rem;
  }

  .earth-orb {
    max-width: 280px;
  }

  .path-track::before {
    left: 20px;
  }

  .path-dot {
    width: 42px;
    height: 42px;
    font-size: 0.78rem;
  }

  .path-step {
    grid-template-columns: 42px 1fr;
  }
}

/* ——— Phone nav & hero ——— */
@media (max-width: 640px) {
  :root {
    --nav-h: 56px;
  }

  .nav-inner {
    gap: 0.4rem;
    padding: 0.4rem 1rem;
  }

  .logo {
    font-size: 0.95rem;
    gap: 0.4rem;
  }

  .logo-mark {
    width: 34px;
    height: 34px;
  }

  /* Hide long brand text if ultra-narrow; keep mark + short name via CSS */
  .logo-text {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-btn-login {
    display: none; /* primary enter is enough on phone */
  }

  .nav-btn-enter {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
  }

  .nav-btn-enter .enter-full {
    display: none;
  }

  .nav-btn-enter .enter-short {
    display: inline;
  }

  .lang-toggle button {
    padding: 0.22rem 0.42rem;
    font-size: 0.68rem;
  }

  .hero {
    padding: 1.35rem 0 2rem;
  }

  .hero-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.85rem;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 8.5vw, 2.35rem);
    margin-bottom: 0.85rem;
  }

  .hero-sub {
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
  }

  .hero-cta {
    margin-bottom: 1.5rem;
    gap: 0.55rem;
  }

  .hero-cta .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .hero-stats {
    gap: 1rem 1.35rem;
    max-width: none;
  }

  .hero-stat strong {
    font-size: 1.2rem;
  }

  /* Earth after copy on phone — natural grid order */
  .hero-grid {
    gap: 1.5rem;
  }

  .earth-frame {
    width: min(68vw, 240px);
  }

  .earth-orb {
    max-width: 240px;
  }

  .earth-credit {
    margin-top: 0.65rem;
    font-size: 0.62rem;
  }

  .section {
    padding: 3rem 0;
  }
}

@media (max-width: 360px) {
  .logo-text {
    display: none; /* only globe mark on very small screens */
  }
}

/* Cache-bust friendly: force circular earth even if img loads late */
@supports not (aspect-ratio: 1 / 1) {
  .earth-orb {
    height: 0;
    padding-bottom: 100%;
  }
  .earth-orb img {
    position: absolute;
    inset: 0;
  }
}
