@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
  --paper: #f7f1e7;
  --paper-deep: #eee4d5;
  --ink: #1c1c1a;
  --muted: #716b62;
  --line: rgba(28, 28, 26, 0.18);
  --saffron: #f3b63f;
  --saffron-soft: #f9d98d;
  --blue: #3157a5;
  --white: #fffdf8;
  --shadow: 0 18px 50px rgba(48, 36, 18, 0.11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Tajawal', system-ui, sans-serif;
  min-width: 320px;
}
button, a { font: inherit; }
button { cursor: pointer; }
.site-shell { max-width: 1440px; margin: 0 auto; padding: 0 5.5vw; overflow: hidden; }

.topbar {
  height: 94px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: rise 0.7s ease both;
}
.brand { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 11px; font-weight: 900; font-size: 1.05rem; }
.brand-mark { width: 29px; height: 29px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; transform: rotate(-16deg); }
.brand-mark::before, .brand-mark::after, .brand-mark span { content: ''; display: block; position: absolute; border-radius: 50%; }
.brand-mark::before { width: 17px; height: 8px; border-top: 2px solid var(--ink); transform: translateY(1px); }
.brand-mark::after { width: 3px; height: 3px; background: var(--ink); transform: translate(-7px, -5px); box-shadow: 11px 0 var(--ink); }
.brand-mark span { width: 13px; height: 5px; border-bottom: 2px solid var(--ink); transform: translateY(7px); }
.topbar-meta { display: flex; align-items: center; gap: 23px; }
.edition { color: var(--muted); font-family: 'Space Grotesk', sans-serif; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.11em; }
.share-button { color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 999px; padding: 9px 15px; display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 700; transition: 0.2s ease; }
.share-button:hover, .share-button:focus-visible { background: var(--ink); color: var(--paper); outline: none; transform: translateY(-2px); }
.share-icon { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; line-height: 0; }

.hero { min-height: 500px; display: flex; align-items: center; justify-content: space-between; position: relative; padding: 68px 4.5% 50px; }
.hero-copy { max-width: 720px; position: relative; z-index: 1; }
.eyebrow, .section-kicker { font-family: 'Space Grotesk', 'Tajawal', sans-serif; color: var(--blue); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.69rem; font-weight: 700; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 23px; }
.eyebrow-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 5px rgba(243, 182, 63, 0.18); }
h1 { margin: 0; font-size: clamp(3.6rem, 9vw, 8.5rem); line-height: 0.88; letter-spacing: -0.075em; font-weight: 900; }
h1 em { color: var(--blue); font-style: normal; position: relative; display: inline-block; }
h1 em::after { content: ''; position: absolute; right: 2%; bottom: -11px; width: 101%; height: 13px; border-bottom: 5px solid var(--saffron); border-radius: 50%; transform: rotate(-3deg); }
.hero-english { font-family: 'Space Grotesk', sans-serif; font-size: clamp(1rem, 1.6vw, 1.3rem); letter-spacing: 0.02em; margin: 32px 0 11px; color: var(--muted); direction: ltr; text-align: right; }
.hero-intro { font-size: clamp(1.15rem, 1.8vw, 1.4rem); font-weight: 500; margin: 0; max-width: 470px; line-height: 1.8; }
.hero-stamp { width: 184px; height: 184px; position: absolute; left: 12%; top: 78px; display: grid; place-items: center; color: var(--ink); transform: rotate(9deg); animation: float 4s ease-in-out infinite; }
.hero-stamp svg { width: 100%; height: 100%; overflow: visible; }
.hero-stamp text { font-family: 'Space Grotesk', 'Tajawal', sans-serif; font-size: 11px; letter-spacing: 2px; fill: var(--ink); }
.stamp-arrow { position: absolute; font-family: 'Space Grotesk', sans-serif; font-size: 2rem; color: var(--blue); transform: translateY(3px); }

.map-section { padding: 42px 0 76px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 22px; margin: 0 4.5% 30px; }
.section-heading h2 { margin: 7px 0 0; font-size: clamp(2rem, 4vw, 3.8rem); line-height: 1; letter-spacing: -0.06em; }
.section-heading h2 span { color: var(--blue); }
.section-note { color: var(--muted); font-size: 0.95rem; margin: 0 0 4px; }
.map-board { min-height: 580px; margin: 0 1.5%; position: relative; border: 1px solid var(--line); background: rgba(255, 253, 248, 0.22); overflow: hidden; }
.map-grid { position: absolute; inset: 0; opacity: 0.34; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px), linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 86px 86px; mask-image: linear-gradient(90deg, transparent, black 18%, black 82%, transparent); }
.map-board::before { content: ''; position: absolute; inset: 24px; border: 1px dashed rgba(49, 87, 165, 0.27); pointer-events: none; }
.map-route { position: absolute; border-color: var(--blue); border-style: dashed; opacity: 0.7; }
.route-one { width: 29%; height: 160px; top: 16%; right: 13%; border-width: 0 0 1px 1px; border-radius: 0 0 0 95%; transform: rotate(-8deg); }
.route-two { width: 25%; height: 152px; bottom: 19%; right: 14%; border-width: 1px 0 0 1px; border-radius: 70% 0 0 0; transform: rotate(8deg); }
.route-three { width: 29%; height: 1px; top: 49%; left: 11%; border-width: 1px 0 0; transform: rotate(5deg); }
.term-node { position: absolute; border: 0; text-align: right; color: var(--ink); }
.root-node { width: 265px; height: 265px; border-radius: 50%; background: var(--saffron); right: 38%; top: 26%; padding: 47px 41px; box-shadow: 0 22px 0 rgba(28, 28, 26, 0.08), var(--shadow); transform: rotate(-5deg); transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease; z-index: 2; }
.root-node:hover, .root-node:focus-visible, .root-node[aria-expanded="true"] { transform: rotate(-2deg) scale(1.045); box-shadow: 0 27px 0 rgba(28, 28, 26, 0.08), 0 22px 60px rgba(48, 36, 18, 0.17); outline: none; }
.node-orbit { position: absolute; border: 1px solid var(--blue); border-radius: 50%; pointer-events: none; }
.orbit-one { inset: -17px -11px 15px 9px; transform: rotate(12deg); opacity: 0.8; }
.orbit-two { inset: 9px 15px -14px -12px; transform: rotate(-22deg); border-color: var(--ink); opacity: 0.25; }
.node-index { display: block; color: rgba(28, 28, 26, 0.6); font-family: 'Space Grotesk', sans-serif; font-size: 0.68rem; letter-spacing: 0.12em; direction: ltr; margin-bottom: 10px; }
.node-title { display: block; font-size: 2.25rem; line-height: 1; font-weight: 900; letter-spacing: -0.07em; }
.node-subtitle { display: block; direction: ltr; text-align: right; font-family: 'Space Grotesk', sans-serif; font-size: 1.02rem; margin-top: 7px; }
.node-hint { display: block; margin-top: 27px; font-size: 0.76rem; font-weight: 700; }
.node-hint span { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; margin-right: 5px; }
.empty-branch { position: absolute; width: 92px; height: 92px; border: 1px solid var(--blue); border-radius: 50%; display: grid; place-items: center; color: var(--blue); font-family: 'Space Grotesk', 'Tajawal', sans-serif; font-size: 0.7rem; letter-spacing: 0.08em; opacity: 0.72; }
.branch-a { top: 13%; right: 14%; }
.branch-b { bottom: 12%; right: 13%; }
.branch-c { top: 42%; left: 8%; }
.empty-branch::before, .empty-branch::after { content: ''; position: absolute; background: var(--saffron); border-radius: 50%; }
.empty-branch::before { width: 7px; height: 7px; top: 12px; right: 18px; }
.empty-branch::after { width: 4px; height: 4px; bottom: 16px; left: 16px; }
.map-caption { position: absolute; left: 9%; bottom: 12%; display: flex; align-items: start; gap: 11px; color: var(--muted); transform: rotate(-4deg); }
.map-caption p { margin: 0; font-size: 0.86rem; line-height: 1.65; }
.caption-line { width: 36px; height: 23px; border-bottom: 1px solid var(--blue); border-radius: 50%; transform: rotate(-18deg); }
.term-details { margin: 0 4.5%; padding: 24px 28px 27px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); animation: reveal 0.45s ease both; }
.term-details[hidden] { display: none; }
.details-label { color: var(--saffron); font-family: 'Space Grotesk', sans-serif; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.66rem; margin-bottom: 20px; direction: ltr; text-align: right; }
.details-content { display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.details-content h3 { margin: 0 0 9px; font-size: 1.9rem; letter-spacing: -0.05em; }
.details-content h3 span { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 500; color: var(--saffron-soft); direction: ltr; display: inline-block; margin-right: 8px; letter-spacing: 0; }
.details-copy { margin: 0; color: rgba(247, 241, 231, 0.75); font-size: 1.05rem; }
.details-example { border-right: 1px solid rgba(247, 241, 231, 0.27); padding-right: 25px; min-width: 220px; }
.details-example span { color: var(--saffron-soft); font-size: 0.76rem; font-weight: 700; }
.details-example p { margin: 8px 0 0; color: var(--paper); font-size: 0.96rem; }

.source-note { display: flex; align-items: center; gap: 22px; padding: 28px 4.5%; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 50px; }
.source-symbol { width: 42px; height: 42px; border-radius: 50%; background: var(--blue); color: var(--paper); display: grid; place-items: center; font-size: 1.4rem; flex: 0 0 auto; }
.source-note p { max-width: 720px; margin: 7px 0 0; line-height: 1.85; color: var(--muted); font-size: 0.98rem; }
.source-number { margin-right: auto; color: var(--blue); font-family: 'Space Grotesk', sans-serif; font-size: 2.2rem; font-weight: 700; opacity: 0.65; }
.footer { display: flex; justify-content: center; gap: 13px; color: var(--muted); padding: 0 0 35px; font-size: 0.8rem; }
.footer-divider { color: var(--saffron); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 130%); background: var(--ink); color: var(--paper); padding: 11px 19px; border-radius: 999px; font-size: 0.86rem; box-shadow: var(--shadow); transition: transform 0.3s ease; z-index: 20; }
.toast.show { transform: translate(-50%, 0); }

@keyframes rise { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: rotate(9deg) translateY(0); } 50% { transform: rotate(12deg) translateY(-8px); } }
@keyframes reveal { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; } }

@media (max-width: 800px) {
  .site-shell { padding: 0 20px; }
  .topbar { height: 76px; }
  .edition { display: none; }
  .hero { min-height: 470px; padding: 67px 4% 40px; align-items: start; }
  .hero-stamp { width: 140px; height: 140px; left: -7px; top: 43px; opacity: 0.7; }
  h1 { font-size: clamp(3.7rem, 16vw, 6.5rem); }
  .hero-english { margin-top: 28px; }
  .section-heading { display: block; margin: 0 4% 22px; }
  .section-note { margin-top: 17px; }
  .map-board { min-height: 520px; margin: 0; }
  .root-node { right: 50%; transform: translateX(50%) rotate(-5deg); top: 30%; }
  .root-node:hover, .root-node:focus-visible, .root-node[aria-expanded="true"] { transform: translateX(50%) rotate(-2deg) scale(1.035); }
  .branch-a { top: 9%; right: 13%; }
  .branch-b { bottom: 11%; right: 12%; }
  .branch-c { top: 49%; left: 8%; }
  .route-one { width: 26%; top: 18%; right: 18%; }
  .route-two { width: 25%; bottom: 20%; right: 17%; }
  .map-caption { left: 7%; bottom: 11%; }
  .details-content { display: block; }
  .details-example { border-right: 0; border-top: 1px solid rgba(247, 241, 231, 0.27); padding: 17px 0 0; margin-top: 21px; }
  .source-note { align-items: start; padding: 24px 4%; }
  .source-number { display: none; }
}

@media (max-width: 470px) {
  .brand-name { font-size: 0.95rem; }
  .share-button { padding: 8px 11px; font-size: 0.75rem; }
  .hero { padding-top: 61px; }
  .hero-stamp { left: -33px; top: 24px; transform: rotate(9deg) scale(0.78); }
  .hero-intro { font-size: 1.08rem; max-width: 330px; }
  .map-board { min-height: 510px; }
  .root-node { width: 220px; height: 220px; padding: 38px 34px; }
  .node-title { font-size: 1.9rem; }
  .node-hint { margin-top: 20px; font-size: 0.68rem; }
  .empty-branch { width: 68px; height: 68px; font-size: 0.62rem; }
  .map-caption { left: 6%; bottom: 8%; }
  .map-caption p { font-size: 0.72rem; }
  .caption-line { width: 23px; }
}
