/* MIRAEUM commits to one dark, navy visual identity — not viewer-preference-driven */
:root {
  color-scheme: dark;
  --ink: #eef2f7;
  --ink-soft: #93a2b6;
  --paper: #0f1726;
  --paper-raised: #17202f;
  --paper-sunken: #0a0f18;
  --line: rgba(238, 242, 247, 0.10);
  --line-strong: rgba(238, 242, 247, 0.20);
  --accent: #57ade6;
  --accent-soft: #7cc0ee;
  --accent-tint: rgba(87, 173, 230, 0.18);
  --gold: #e2ab5b;
  --gold-tint: rgba(226, 171, 91, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 16px 36px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
main { flex: 1; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 620px) { .wrap { padding: 0 20px; } }

.eyebrow {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
}
.tag { color: var(--ink-soft); font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Nav ---------- */
nav.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
nav.top .row { display: flex; align-items: center; justify-content: space-between; padding-top: clamp(10px, 2vh, 16px); padding-bottom: clamp(10px, 2vh, 16px); }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand .icon {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  background: var(--accent); color: var(--paper-raised); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.4rem;
}
.brand .mark { font-size: 1.25rem; letter-spacing: -0.02em; }
.brand .dot { color: var(--gold); }
@media (max-width: 500px) { .brand .mark { display: none; } }
nav.top .links { display: flex; gap: 42px; font-size: 0.96rem; }
nav.top .links a { text-decoration: none; color: var(--ink); opacity: 0.6; font-weight: 500; padding-bottom: 5px; border-bottom: 2px solid transparent; transition: opacity 0.15s; }
nav.top .links a:hover, nav.top .links a:focus-visible { opacity: 1; }
nav.top .links a[aria-current="page"] { opacity: 1; font-weight: 700; border-bottom-color: var(--gold); }
nav.top .nav-actions { display: flex; align-items: center; gap: 10px; }
nav.top .cta {
  font-size: 0.88rem; font-weight: 600; text-decoration: none; border: none;
  color: var(--paper-raised); background: var(--accent); padding: 9px 18px; border-radius: 999px;
  box-shadow: var(--shadow);
}
nav.top .cta:hover { background: var(--accent-soft); }

.nav-toggle {
  display: none;
  flex: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: transparent; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: var(--ink); transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle span + span { margin-top: 4px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  nav.top .links {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.22s ease;
  }
  nav.top .links.open { max-height: 320px; visibility: visible; }
  nav.top .links a {
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    border-left: 3px solid transparent;
    opacity: 0.85;
    font-size: 1rem;
  }
  nav.top .links a[aria-current="page"] {
    border-bottom-color: var(--line);
    border-left-color: var(--gold);
    background: var(--gold-tint);
  }
}

/* ---------- Hero (home page) ---------- */
.hero { padding: clamp(36px, 6.5vh, 88px) 0 clamp(40px, 7vh, 96px); }
.hero-grid { display: flex; gap: 48px; align-items: flex-start; flex-wrap: wrap; }
.hero-inner { flex: 1 1 420px; max-width: 540px; }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.3rem); line-height: 1.05; margin-top: 16px; }
.hero .tag { margin-top: clamp(12px, 2.4vh, 22px); font-size: 1.2rem; max-width: 26em; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(20px, 4vh, 38px); align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 0.98rem; font-weight: 600;
  text-decoration: none; border-radius: 999px; padding: 13px 24px;
  border: none; cursor: pointer; box-shadow: var(--shadow);
}
.btn-primary { background: var(--accent); color: var(--paper-raised); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--accent-soft); }
.btn-ghost { background: var(--paper-raised); color: var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: var(--paper-sunken); }
.btn:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

/* ---------- Talk cloud (home hero — the languages MIRA is built for, mid-conversation) ---------- */
.talk-cloud-wrap { flex: 1 1 320px; max-width: min(420px, 42vh); margin: 0 auto; }
.talk-cloud { position: relative; width: 100%; aspect-ratio: 1 / 1; }
.cloud-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cloud-lines path { fill: none; stroke: var(--line-strong); stroke-width: 0.7; stroke-dasharray: 1.5 3.5; stroke-linecap: round; }

.cloud-node, .cloud-chip {
  position: absolute; left: var(--x); top: var(--y);
  animation: cloud-float 7s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.cloud-node {
  display: flex; align-items: center; justify-content: center;
  /* inherits the body's font stack (matches the phone demo's avatars) rather
     than the display face, which has no Arabic glyphs of its own */
  color: #fff; font-weight: 800; font-size: 1.05rem;
  box-shadow: var(--shadow);
}
/* organic blobs rather than plain circles or literal heads — five different
   radius presets (and sizes) so no two nodes read as a repeated stamp */
.cloud-node.n1 {
  width: 54px; height: 54px; margin: -27px 0 0 -27px;
  border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 60%, #fff 40%), var(--gold));
}
.cloud-node.n2 {
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 58% 42% 38% 62% / 62% 44% 56% 38%;
  background: linear-gradient(135deg, color-mix(in srgb, #3fa088 60%, #fff 40%), #3fa088);
}
.cloud-node.n3 {
  width: 58px; height: 58px; margin: -29px 0 0 -29px;
  border-radius: 65% 35% 45% 55% / 40% 62% 38% 60%;
  background: linear-gradient(135deg, color-mix(in srgb, #c96a4a 60%, #fff 40%), #c96a4a);
}
.cloud-node.n4 {
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 38% 62% 55% 45% / 55% 35% 65% 45%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 60%, #fff 40%), var(--accent));
}
.cloud-node.n5 {
  width: 50px; height: 50px; margin: -25px 0 0 -25px;
  border-radius: 55% 45% 40% 60% / 48% 58% 42% 52%;
  background: linear-gradient(135deg, color-mix(in srgb, #8f7bd6 60%, #fff 40%), #8f7bd6);
}

.cloud-chip {
  margin-top: -14px; white-space: nowrap;
  background: var(--paper-raised); border: 1px solid var(--line-strong);
  color: var(--ink); font-size: 0.82rem; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow);
}
.cloud-chip.c1 { margin-left: -14px; }
.cloud-chip.c2 { margin-left: -14px; }
.cloud-chip.c3 { margin-left: -14px; }
.cloud-chip.c4 { margin-left: -14px; }
.cloud-chip.c5 { margin-left: -14px; }

@keyframes cloud-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}
@media (prefers-reduced-motion: reduce) { .cloud-node, .cloud-chip { animation: none; } }

.cloud-caption { display: block; margin-top: 22px; font-size: 0.95rem; color: var(--ink-soft); text-align: center; }
.cloud-caption a { color: var(--accent-soft); font-weight: 600; text-decoration: none; white-space: nowrap; }
.cloud-caption a:hover { text-decoration: underline; }

/* ---------- Mirror demo (a real-looking mobile chat screen) ---------- */
.mirror-demo { flex: 1 1 290px; max-width: 350px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.phone-shell { background: #0b0e13; border-radius: 44px; padding: 10px; box-shadow: var(--shadow); }
.phone-screen {
  /* the chat screen itself stays a warm ivory, independent of the page's navy tone */
  --paper: #f7f3e8;
  --paper-raised: #fffdf6;
  --paper-sunken: #ece6d3;
  --ink: #241f19;
  --ink-soft: #746a58;
  --line: rgba(36, 31, 25, 0.10);
  --line-strong: rgba(36, 31, 25, 0.20);
  background: var(--paper-raised); border-radius: 34px; overflow: hidden; display: flex; flex-direction: column;
  /* height is what bends to the viewport (see clamp below); width is left to derive
     from it via the aspect-ratio, so the phone always keeps true smartphone
     proportions — the chat column just runs narrower on shorter screens rather than
     the device looking squat. Values are the earlier ones scaled up ~10% to widen
     the whole device while keeping that same true ratio. */
  aspect-ratio: 9 / 19.5;
  height: clamp(528px, 66vh, 726px);
  max-height: 726px;
}

.phone-status { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 2px; font-size: 0.68rem; font-weight: 700; color: var(--ink); flex: none; }
.status-icons { display: flex; align-items: center; gap: 5px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 9px; }
.bars i { display: block; width: 3px; background: var(--ink); border-radius: 1px; }
.bars i:nth-child(1) { height: 4px; } .bars i:nth-child(2) { height: 6px; } .bars i:nth-child(3) { height: 8px; } .bars i:nth-child(4) { height: 9px; }
.battery { width: 20px; height: 10px; border: 1.4px solid var(--ink); border-radius: 3px; position: relative; padding: 1.5px; box-sizing: border-box; }
.battery::after { content: ""; position: absolute; right: -3px; top: 3px; width: 2px; height: 4px; background: var(--ink); border-radius: 0 1px 1px 0; }
.battery .fill { display: block; width: 80%; height: 100%; background: var(--ink); border-radius: 1px; }

.chat-header { display: flex; align-items: center; gap: 6px; padding: 9px 10px 10px; border-bottom: 1px solid var(--line); flex: none; }
.chat-header .back { font-size: 1.1rem; font-weight: 700; color: var(--accent); flex: none; line-height: 1; }
.chat-header .group-avatar {
  width: 25px; height: 25px; border-radius: 50%; flex: none;
  background: var(--accent-tint); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.7rem;
}
.chat-header .titles { flex: 1; min-width: 0; }
.chat-header .title { display: block; font-size: 0.76rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header .subtitle { display: block; font-size: 0.56rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lang-select {
  flex: none; appearance: none; -webkit-appearance: none; cursor: pointer;
  font-family: inherit; font-size: 0.52rem; font-weight: 700; color: var(--ink);
  background: var(--paper-sunken) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6'%3E%3Cpath d='M0 0l4 6 4-6z' fill='%2393a2b6'/%3E%3C/svg%3E") no-repeat right 6px center;
  border: none; border-radius: 999px; padding: 4px 15px 4px 8px; max-width: 64px;
}
.lang-select:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.lang-select.hint { animation: select-hint 1.6s ease-in-out 3; }
@keyframes select-hint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(87, 173, 230, 0.55); }
  50% { box-shadow: 0 0 0 6px rgba(87, 173, 230, 0); }
}

.chat-body {
  flex: 1; min-height: 0; padding: 12px; display: flex; flex-direction: column;
  justify-content: flex-start; gap: 10px; background: var(--paper);
  /* a real chat scrolls internally rather than clipping — matters on shorter
     viewports where the phone itself has less room to give */
  overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
}
.chat-body::-webkit-scrollbar { display: none; }
.time-divider { align-self: center; font-size: 0.56rem; font-weight: 700; color: var(--ink-soft); background: var(--paper-sunken); padding: 3px 10px; border-radius: 999px; margin-bottom: 2px; }

.msg { display: flex; gap: 6px; align-items: flex-start; max-width: 92%; }
.msg .avatar { width: 21px; height: 21px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 0.54rem; font-weight: 800; color: #fff; }
.avatar.c1 { background: var(--gold); }
.avatar.c2 { background: #3fa088; }
.avatar.c3 { background: #c96a4a; }
.msg .msg-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.msg .who { font-size: 0.6rem; font-weight: 700; color: var(--ink-soft); }
.msg .bubble-text { position: relative; overflow: hidden; background: var(--paper-sunken); padding: 6px 10px; border-radius: 3px 12px 12px 12px; font-size: 0.76rem; color: var(--ink); }

/* Mirror's translation pass: a film settles over each bubble rather than a dropdown's
   instant swap. It arrives translucent and slightly soft-focus, as if still drifting
   into place; as it comes to rest it sharpens and turns opaque — that's the instant
   the text underneath actually changes — then it softens and fades translucent again
   as it lifts back off, revealing the result. */
.msg .bubble-text::after {
  content: "";
  position: absolute; inset: -2px;
  background: linear-gradient(180deg,
    transparent,
    color-mix(in srgb, var(--gold) 20%, #fff 80%) 25%,
    color-mix(in srgb, var(--gold) 20%, #fff 80%) 75%,
    transparent);
  opacity: 0;
  transform: translateY(-120%);
  filter: blur(3px);
  pointer-events: none;
}
.msg .bubble-text.mirroring::after { animation: mirror-film 1.05s cubic-bezier(.3, 0, .2, 1); }
@keyframes mirror-film {
  0%   { transform: translateY(-120%); opacity: 0;   filter: blur(3px); }
  24%  { transform: translateY(-14%);  opacity: .22; filter: blur(2px); }
  42%  { transform: translateY(0%);    opacity: .94; filter: blur(0); }
  60%  { transform: translateY(0%);    opacity: .94; filter: blur(0); }
  80%  { transform: translateY(12%);   opacity: .2;  filter: blur(2px); }
  100% { transform: translateY(120%);  opacity: 0;   filter: blur(3px); }
}

/* the viewer's own sent message: right-aligned, accent-colored, no avatar */
.msg.sent { align-self: flex-end; flex-direction: row-reverse; }
.msg.sent .msg-main { align-items: flex-end; }
.msg.sent .who { align-self: flex-end; }
.msg.sent .bubble-text { background: var(--accent); color: var(--paper-raised); border-radius: 12px 3px 12px 12px; }

.chat-input { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-top: 1px solid var(--line); flex: none; }
.chat-input .field { flex: 1; background: var(--paper-sunken); border-radius: 999px; padding: 8px 13px; font-size: 0.72rem; color: var(--ink-soft); }
.chat-input .send { flex: none; width: 27px; height: 27px; border-radius: 50%; background: var(--accent); color: var(--paper-raised); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; }
.demo-caption { margin-top: 12px; font-size: 0.8rem; color: var(--ink-soft); text-align: center; }

/* ---------- Page shell (inner pages) ---------- */
.page-hd { padding: 72px 0 0; }
.page-hd h2 { font-size: clamp(2.1rem, 4.2vw, 3rem); margin-top: 10px; }
.page-hd .tag { margin-top: 18px; font-size: 1.05rem; max-width: 42em; }
.page-hd .tag strong { color: var(--ink); font-weight: 700; }
section.block { padding: 44px 0 96px; }

/* ---------- Mirror showcase (How it works — the live demo lives here now) ---------- */
.showcase-grid { display: flex; gap: 48px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }
.showcase-copy { flex: 1 1 360px; max-width: 480px; padding-top: 8px; }
.showcase-copy h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-top: 10px; }
.showcase-copy .tag { margin-top: 16px; font-size: 1.05rem; max-width: 30em; }
.rooms-divider { border: none; border-top: 1px solid var(--line); margin: 88px 0 44px; }

/* ---------- Rooms (Agora / Nexus / Board) ---------- */
.rooms { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.room { flex: 1 1 200px; }
.room .eyebrow { display: block; margin-bottom: 6px; }
.room h3 { font-size: 2.3rem; }
.room .tag { margin-top: 8px; font-size: 0.98rem; }
.joiner { flex: none; align-self: center; font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.6rem; color: var(--gold); padding-top: 6px; }
@media (max-width: 760px) { .joiner { display: none; } }
.next-link { display: inline-block; margin-top: 48px; font-size: 0.95rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.next-link:hover { color: var(--accent-soft); }

/* ---------- Get MIRA ---------- */
.access { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; margin-top: 12px; }
.access .cta-col { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.platform-row { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.platform {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 2px; font-size: 0.96rem; border-bottom: 1px solid var(--line);
}
.platform .name { font-weight: 600; }
.badge { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.badge.live { background: var(--accent); color: var(--paper-raised); box-shadow: var(--shadow); }
.badge.soon { background: var(--paper-sunken); color: var(--ink-soft); }
.fineprint { font-size: 0.84rem; color: var(--ink-soft); }
@media (max-width: 820px) { .access { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 36px; margin-top: 12px; }
.card h3 { font-size: 1.4rem; }
.card .tag { display: block; margin-top: 6px; font-size: 0.95rem; }
.card .mail { display: inline-block; margin-top: 12px; font-weight: 600; text-decoration: none; color: var(--accent); font-size: 0.97rem; }
.card .mail:hover { color: var(--accent-soft); text-decoration: underline; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Legal pages ---------- */
.legal-doc { padding: 40px 0 96px; max-width: 700px; }
.legal-doc .updated { color: var(--ink-soft); font-size: 0.85rem; }
.legal-doc h3 { font-size: 1.25rem; margin-top: 38px; }
.legal-doc h3:first-of-type { margin-top: 8px; }
.legal-doc p { margin-top: 14px; line-height: 1.7; color: var(--ink-soft); }
.legal-doc p strong { color: var(--ink); font-weight: 700; }
.legal-doc ul { list-style: disc; padding-left: 1.25em; margin-top: 12px; }
.legal-doc li { margin-top: 8px; line-height: 1.65; color: var(--ink-soft); }
.legal-doc li::marker { color: var(--accent-soft); }
.legal-doc a { color: var(--accent); }
.legal-doc a:hover { color: var(--accent-soft); }
.legal-doc .callout {
  margin-top: 32px; padding: 16px 18px; border-radius: 12px;
  background: var(--gold-tint); border: 1px solid var(--line);
  font-size: 0.9rem; color: var(--ink-soft); line-height: 1.6;
}

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: clamp(20px, 4vh, 40px) 0 clamp(28px, 5vh, 56px); }
footer .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
footer .legal { font-size: 0.82rem; color: var(--ink-soft); max-width: 46em; line-height: 1.7; }
footer .links { display: flex; gap: 18px; font-size: 0.85rem; color: var(--ink-soft); }
footer .links a { text-decoration: none; }
footer .links a:hover { color: var(--ink); }
