/*
 * Karrida portal — one stylesheet for every language.
 *
 * The design language is the sub-portals': night-blue and stone, one
 * gold accent, flat travel-poster scenes, a quiet aircraft. Layout
 * uses flex/grid and logical-friendly patterns, so `dir="rtl"` on the
 * Arabic page mirrors the page for free; the few genuinely
 * directional pieces (arrows, the aircraft in the night scene) are
 * mirrored explicitly under [dir="rtl"] .mirror.
 */
:root {
  --night-950: #060f1d;
  --night-900: #0b1526;
  --stone-50: #fafaf9;
  --stone-200: #e7e5e4;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --gold-400: #e5b45f;
  --gold-600: #b9862e;
  --card-radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--stone-50);
  color: var(--night-950);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }

.shell { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1.25rem; }

/* ── Header ─────────────────────────────────────────────────── */
header.site { border-bottom: 1px solid var(--stone-200); background: #fff; }
.site-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.9rem; }
.wordmark { display: flex; align-items: baseline; gap: 0.55rem; font-weight: 700; letter-spacing: -0.03em; font-size: 1.25rem; white-space: nowrap; }
.wordmark .k {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; background: var(--night-900);
  color: var(--gold-400); font-size: 1rem; font-weight: 800; letter-spacing: 0;
  transform: translateY(4px);
}
.wordmark small {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--stone-500);
}
[dir="rtl"] .wordmark small { letter-spacing: 0; }
.site-right { display: flex; align-items: center; gap: 1.6rem; }
nav.top { display: flex; gap: 1.4rem; font-size: 0.85rem; font-weight: 600; color: var(--stone-600); }
nav.top a:hover { color: var(--night-950); }
nav.langs { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; font-weight: 600; color: var(--stone-500); }
nav.langs a:hover { color: var(--night-950); }
nav.langs a[aria-current="page"] { color: var(--gold-600); }
@media (max-width: 700px) { nav.top { display: none; } }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { padding-block: 3.2rem 1.4rem; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15; letter-spacing: -0.03em; font-weight: 700;
  max-width: 24ch; text-wrap: balance;
}
[dir="rtl"] .hero h1 { letter-spacing: 0; }
.hero h1 em { font-style: normal; color: var(--gold-600); }
.hero p.lead {
  margin-top: 0.9rem; max-width: 56ch; font-size: 1.02rem;
  line-height: 1.75; color: var(--stone-600);
}

/* ── The three doors ───────────────────────────────────────── */
.doors { display: grid; gap: 1.1rem; padding-block: 1.6rem 1rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .doors { grid-template-columns: 1fr; } }
.door {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--stone-200);
  border-radius: var(--card-radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.door:hover {
  transform: translateY(-3px);
  border-color: #d6d3d1;
  box-shadow: 0 10px 30px rgba(6, 15, 29, 0.10);
}
.door .scene { position: relative; height: 136px; overflow: hidden; }
.door .scene svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transition: transform 0.7s ease;
}
.door:hover .scene svg { transform: scale(1.04); }
.door .body { padding: 1.05rem 1.15rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.door .kicker {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--stone-500);
}
[dir="rtl"] .door .kicker { letter-spacing: 0; }
.door h2 { margin-top: 0.3rem; font-size: 1.18rem; letter-spacing: -0.02em; }
[dir="rtl"] .door h2 { letter-spacing: 0; }
.door p { margin-top: 0.45rem; font-size: 0.88rem; line-height: 1.65; color: var(--stone-600); flex: 1; }
.door .go {
  margin-top: 0.95rem; display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; font-weight: 700; color: var(--night-950);
}
.door .go svg { transition: transform 0.2s ease; }
.door:hover .go svg { transform: translateX(3px); }
[dir="rtl"] .door:hover .go svg { transform: translateX(-3px) scaleX(-1); }
.door .go .host { color: var(--stone-500); font-weight: 500; direction: ltr; }

/* Directional artwork mirrors with the reading direction. */
[dir="rtl"] .mirror { transform: scaleX(-1); }
[dir="rtl"] svg .mirror { transform: scaleX(-1) translate(-300px, 108px) rotate(-8deg); }

/* ── Trust line ─────────────────────────────────────────────── */
.trust {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem;
  padding-block: 0.9rem 2.6rem; font-size: 0.82rem; color: var(--stone-500);
}
.trust span::before { content: "•"; color: var(--gold-600); margin-inline-end: 0.45rem; }

/* ── Skyline strip: dusk hills + the crossing aircraft ─────── */
.strip { position: relative; height: 180px; overflow: hidden; background: linear-gradient(180deg, #ffffff 0%, #f6efe3 55%, #f0dfc2 100%); }
.strip svg.land { position: absolute; inset: 0; width: 100%; height: 100%; }
.flightband { position: absolute; inset: 12px 0 auto 0; height: 56px; opacity: 0.6; }
.plane-path { offset-path: path("M-180 56 C 380 8 1120 6 1880 48"); offset-rotate: auto; offset-distance: 62%; }
.contrail { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .plane-path { offset-distance: 0%; animation: fly 14s linear 1s forwards; }
  @keyframes fly { to { offset-distance: 100%; } }
  .contrail {
    stroke-dasharray: 1000;
    animation: draw 14s linear 1s both, fadeout 4s ease 15s forwards;
  }
  @keyframes draw { from { stroke-dashoffset: 1000; opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
  @keyframes fadeout { to { opacity: 0; } }
}

/* ── Footer ─────────────────────────────────────────────────── */
footer.site { background: var(--night-950); color: rgba(255,255,255,0.65); font-size: 0.82rem; margin-top: auto; }
.foot-row {
  display: flex; flex-wrap: wrap; gap: 0.8rem 2rem;
  align-items: center; justify-content: space-between; padding-block: 1.4rem;
}
.foot-row nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.foot-row a:hover { color: #fff; }

/* ── Legal pages ────────────────────────────────────────────── */
.legal { padding-block: 2.6rem 3.5rem; max-width: 46rem; }
.legal h1 { font-size: 1.7rem; letter-spacing: -0.02em; }
.legal .stand { margin-top: 0.4rem; font-size: 0.82rem; color: var(--stone-500); }
.legal h2 { margin-top: 1.9rem; font-size: 1.05rem; }
.legal p, .legal li { margin-top: 0.6rem; font-size: 0.92rem; line-height: 1.7; color: var(--stone-600); }
.legal ul { padding-inline-start: 1.2rem; }
.legal a { color: var(--night-950); text-decoration: underline; text-underline-offset: 3px; }
.legal .todo {
  margin-top: 1.2rem; border: 1px solid #f0d9a8; background: #fdf6e3;
  border-radius: 10px; padding: 0.9rem 1rem; font-size: 0.88rem; color: #7a5c1e;
}
.legal .placeholder { background: #fdf0d0; border-radius: 4px; padding: 0.05rem 0.35rem; color: #8a6a20; font-style: italic; }

/* ── Dark theme ────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  body { background: var(--night-950); color: #fff; }
  header.site { background: var(--night-900); border-color: rgba(255,255,255,0.08); }
  nav.top, nav.langs { color: rgba(255,255,255,0.65); }
  nav.top a:hover, nav.langs a:hover { color: #fff; }
  nav.langs a[aria-current="page"] { color: var(--gold-400); }
  .hero p.lead, .door p, .trust { color: rgba(255,255,255,0.6); }
  .door { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.1); }
  .door:hover { border-color: rgba(255,255,255,0.22); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
  .door .go { color: #fff; }
  .door .kicker, .door .go .host { color: rgba(255,255,255,0.45); }
  .hero h1 em { color: var(--gold-400); }
  .strip { background: linear-gradient(180deg, var(--night-950) 0%, #0d1b31 60%, #14243f 100%); }
  .legal p, .legal li, .legal .stand { color: rgba(255,255,255,0.6); }
  .legal a { color: #fff; }
  .legal .todo { background: rgba(233,196,105,0.08); border-color: rgba(233,196,105,0.3); color: #e5c67d; }
  .legal .placeholder { background: rgba(233,196,105,0.12); color: #e5c67d; }
}
