/* One-page homepage: the section wheel. Tokens (colours, fonts) come from
   the <style> block in index.html. The page is always dark, like the hero. */

.page {
  min-height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 600px at 85% 0%, rgba(72,104,230,.35), transparent 60%),
    radial-gradient(800px 600px at 0% 100%, rgba(255,106,69,.24), transparent 60%),
    linear-gradient(165deg, var(--night) 0%, var(--night-2) 100%);
}

/* ---------- Header ---------- */
header.top { padding: 18px 0; width: 100%; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topright { display: flex; align-items: center; gap: 14px; }
.acct { color: rgba(255,255,255,.82); text-decoration: none; font-weight: 600; font-size: .92rem; }
.acct:hover { color: #fff; }

/* ---------- Title ---------- */
.stage { flex: 1; width: 100%; padding-block: 4px 40px; text-align: center; }
.title { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.02; margin: 6px 0 6px; }
[dir="rtl"] .title { line-height: 1.4; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.kick { margin: 0 0 18px; color: rgba(255,255,255,.66); font-size: 1rem; }

/* ---------- Wheel ---------- */
.wheelbox { position: relative; width: min(100%, 600px); aspect-ratio: 1; margin: 0 auto; }
.wheel { width: 100%; height: 100%; display: block; overflow: visible; }

.halo { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 2; stroke-dasharray: 3 10; }
.disc { fill: #fff; filter: drop-shadow(0 12px 30px rgba(0,0,0,.35)); pointer-events: none; }

.seg { cursor: pointer; outline: none; }
.seg-in { transform-box: view-box; transform-origin: 500px 500px; transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s, filter .25s; }
.seg-shape { stroke: var(--night); stroke-width: 7; stroke-linejoin: round; }
.seg-label { font: 700 25px var(--sans); letter-spacing: .01em; pointer-events: none; }
[dir="rtl"] .seg-label { font-family: var(--arabic); font-size: 27px; }
@media (max-width: 600px) {
  .seg-label { font-size: 36px; }
  [dir="rtl"] .seg-label { font-size: 38px; }
  .seg-icon { display: none; }
}
.seg-icon { pointer-events: none; }

.wheel.has-active .seg .seg-in { filter: brightness(.72) saturate(.85); }
.wheel .seg.on .seg-in,
.wheel .seg:hover .seg-in { opacity: 1; filter: drop-shadow(0 14px 22px rgba(0,0,0,.35)); transform: translate(var(--dx), var(--dy)) scale(1.03); }
.seg:focus-visible .seg-shape { stroke: #fff; stroke-width: 9; }

/* Entry: the wheel fans open once, segment after segment. */
.js .wheel:not(.ready) .seg-in { opacity: 0; transform: scale(.55) rotate(-25deg); }
.js .wheel.ready:not(.still) .seg-in { animation: fan .7s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: var(--d); }
.js .wheel.still .seg-in { opacity: 1; transform: none; }
@keyframes fan { from { opacity: 0; transform: scale(.55) rotate(-25deg); } }

/* Hub: HTML text over the white centre disc (38 % of the wheel). */
.hub { position: absolute; left: 50%; top: 50%; width: 35.6%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; display: grid; place-items: center; text-align: center; color: var(--night); cursor: default; }
.hub-in { display: grid; justify-items: center; gap: 2px; padding: 12%; }
.hub-icon { width: clamp(22px, 5vw, 34px); height: clamp(22px, 5vw, 34px); }
.hub-icon:empty { display: none; }
.hub-icon svg { width: 100%; height: 100%; }
.hub-t { font-family: var(--serif); font-weight: 400; font-size: clamp(1.15rem, 3.6vw, 2.1rem); line-height: 1.05; }
[dir="rtl"] .hub-t { font-family: var(--arabic); font-weight: 800; font-size: clamp(1rem, 3vw, 1.6rem); line-height: 1.4; }
.hub-p { font-size: clamp(.68rem, 1.8vw, .9rem); color: var(--ink-soft); font-weight: 600; }
.wheel.has-active ~ .hub { cursor: pointer; }

/* ---------- Intro under the wheel ---------- */
.intro { max-width: 640px; margin: 18px auto 0; }
.intro .lead { margin: 0 0 18px; color: rgba(255,255,255,.82); line-height: 1.6; font-size: 1.02rem; }

/* ---------- All sections, one after another ---------- */
.secs { display: grid; gap: 22px; max-width: 980px; margin: 56px auto 0; text-align: start; }
.sec { --c: var(--coral); --ink: #fff; display: grid; grid-template-columns: 1fr; border-radius: 24px; overflow: hidden;
  background: rgba(255,255,255,.05); border: 1px solid color-mix(in srgb, var(--c) 40%, rgba(255,255,255,.1));
  box-shadow: 0 20px 50px rgba(0,0,0,.28); scroll-margin-top: 16px; }
@media (min-width: 760px) { .sec { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.sec.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--c), 0 0 60px color-mix(in srgb, var(--c) 45%, transparent); } }
.sec-img { display: block; position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--night); }
@media (min-width: 760px) { .sec-img { aspect-ratio: auto; min-height: 100%; } }
.sec-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.sec-img:hover img { transform: scale(1.04); }
.sec-body { padding: 22px 22px 24px; display: flex; flex-direction: column; justify-content: center; }
.sec-body h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.1; margin: 0 0 10px; }
[dir="rtl"] .sec-body h2 { line-height: 1.4; font-size: 1.55rem; }
.sec-i { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--c); color: var(--ink); }
.sec-i svg { width: 22px; height: 22px; }
.sec-body > p { margin: 0 0 16px; color: rgba(255,255,255,.8); line-height: 1.6; font-size: .97rem; }
.sec-body .warn { display: flex; gap: 8px; align-items: flex-start; background: rgba(255,106,69,.12); border: 1px solid rgba(255,106,69,.35);
  color: #ffd2c4; font-weight: 600; font-size: .9rem; padding: 10px 12px; border-radius: 14px; }
.sec-body .warn::before { content: "!"; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--coral); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.btn.open { width: 100%; justify-content: center; background: var(--c); color: var(--ink); box-shadow: 0 12px 28px color-mix(in srgb, var(--c) 40%, transparent); margin-bottom: 12px; }
.btn.open:hover { filter: brightness(1.08); }
.tiles { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 480px) { .tiles { grid-template-columns: 1fr 1fr; } .tiles .tile:only-child { grid-column: 1 / -1; } }
.tiles:empty { display: none; }
.tile { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px;
  color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; line-height: 1.3;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); transition: background .15s, border-color .15s, transform .15s; }
.tile:hover { background: rgba(255,255,255,.1); border-color: color-mix(in srgb, var(--c) 60%, transparent); transform: translateY(-1px); }
.tile-i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 22%, transparent); color: color-mix(in srgb, var(--c) 70%, #fff); }
.tile-i svg { width: 18px; height: 18px; }
.tile-go { color: rgba(255,255,255,.45); }
[dir="rtl"] .tile-go { transform: scaleX(-1); }

.totop { position: fixed; z-index: 5; bottom: 20px; inset-inline-end: 20px; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; color: var(--night); background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.totop[hidden] { display: none; }
.totop svg { width: 22px; height: 22px; }
.totop:hover { transform: translateY(-2px); }

.fallback { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.fallback a { color: #fff; }

/* ---------- Footer ---------- */
footer.bottom { padding: 22px 0 28px; color: rgba(255,255,255,.55); font-size: .85rem; text-align: center; border-top: 1px solid rgba(255,255,255,.08); }
footer.bottom p { margin: 0 0 6px; }
footer.bottom a { color: rgba(255,255,255,.8); text-decoration: none; }
footer.bottom a:hover { color: #fff; text-decoration: underline; }

/* ---------- Waitlist dialog ---------- */
.dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: 24px; padding: 28px 22px 22px;
  background: var(--bg); color: var(--ink); box-shadow: 0 40px 100px rgba(0,0,0,.5); }
.dlg::backdrop { background: rgba(5,8,20,.7); }
.dlg h3 { font-family: var(--serif); font-weight: 400; font-size: 1.9rem; margin: 0 0 6px; }
[dir="rtl"] .dlg h3 { font-family: var(--arabic); font-weight: 800; font-size: 1.5rem; }
.dlg > p { color: var(--ink-soft); margin: 0 0 16px; font-size: .95rem; }
.dlg-x { position: absolute; top: 10px; inset-inline-end: 12px; border: 0; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.dlg form.card { background: transparent; border: 0; padding: 0; box-shadow: none; }
.dlg .field { margin-bottom: 14px; }
.dlg label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.dlg input[type=text], .dlg input[type=email], .dlg select { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; }
.dlg .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .dlg .row2 { grid-template-columns: 1fr; } }
.dlg .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .86rem; color: var(--ink-soft); }
.dlg .check input { margin-top: 4px; }
.dlg .btn.primary { width: 100%; justify-content: center; }
.dlg .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.dlg .exam-other { display: none; }

@media (prefers-reduced-motion: reduce) {
  .seg-in { transition: none; }
  .js .wheel:not(.ready) .seg-in { opacity: 1; transform: none; }
  .js .wheel.ready .seg-in { animation: none; }
  .sec.flash { animation: none; }
  .sec-img img { transition: none; }
}

/* Language menu (filled by functions/_middleware.js) */
.langpick { position: relative; flex: none; }
.langpick summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: rgba(255,255,255,.88); font-weight: 600; font-size: .88rem;
  padding: 7px 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); line-height: 1; }
.langpick summary::-webkit-details-marker { display: none; }
.langpick summary:hover, .langpick[open] summary { color: #fff; background: rgba(255,255,255,.12); }
.langlist { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 60; background: #fff; color: #0b1226; border-radius: 14px;
  box-shadow: 0 14px 44px rgba(11,18,38,.28); padding: 6px; display: grid; grid-template-columns: repeat(2, minmax(135px, 1fr)); gap: 2px; width: max-content; max-width: calc(100vw - 32px); }
.langlist a { display: block; padding: 8px 12px; border-radius: 9px; color: inherit; text-decoration: none; font-size: .95rem; white-space: nowrap; }
.langlist a:hover { background: #eef1f8; }
.langlist a[aria-current] { background: #0b1226; color: #fff; }
.legal-note { margin: 0 0 1.5rem; padding: .8rem 1rem; border-radius: 10px; background: rgba(255,106,69,.12); font-size: .95rem; }
