/* "Choose a simulation" page */
.home-body {
  min-height: 100vh; overflow-x: hidden; overflow-y: auto; font-family: 'Inter', 'IBM Plex Sans Arabic', sans-serif;
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(143,116,51, .16), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(99, 102, 241, .12), transparent 60%),
    var(--bg);
}
html[dir="rtl"] .home-body { font-family: 'IBM Plex Sans Arabic', 'Inter', sans-serif; }
.home-body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
.home-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 28px; }
.home-brand { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.home-brand b { display: block; color: var(--text); font-size: 15.5px; }
.home-brand small { display: block; color: var(--muted); font-size: 12.5px; }
.home-actions { display: flex; align-items: center; gap: 8px; }
.home-pill, .home-icon { height: 38px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.home-pill { padding: 0 12px; }
.home-pill .flag { width: 20px; height: 14px; border-radius: 3px; object-fit: cover; }
.home-icon { width: 38px; justify-content: center; }
.home-icon .ic { width: 18px; height: 18px; }
.home-pill:hover, .home-icon:hover { border-color: var(--accent); color: var(--accent); }
.home-user { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px 0 4px; height: 38px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; }
.home-user:empty { display: none; }
.home-user .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.home-user .avatar:empty { display: none; }

.home-main { position: relative; z-index: 1; max-width: 1220px; margin: 0 auto; padding: 18px 28px 48px; }
.home-hero { text-align: center; margin: 10px auto 34px; max-width: 760px; animation: hUp .6s ease both; }
.home-hello { margin: 0 0 8px; color: var(--accent-2); font-weight: 600; font-size: 14px; min-height: 1.2em; }
.home-hero h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.02em; line-height: 1.15; }
.home-lead { margin: 12px 0 0; color: var(--text-2); font-size: 15.5px; line-height: 1.6; }

.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.mode-card {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: 20px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px -18px rgba(0,0,0,.25);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s;
  animation: hUp .6s ease both; animation-delay: calc(.12s + var(--d));
}
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-6px); box-shadow: 0 24px 50px -22px rgba(0,0,0,.35); border-color: var(--mc); outline: none; }
.mode-card.ped { --mc: #8f7433; --mc-soft: #efe2bf; }
.mode-card.bus { --mc: #e11d48; --mc-soft: #ffe4e6; }
.mode-card.train { --mc: #4f46e5; --mc-soft: #e0e7ff; }
.mode-scene { height: 190px; position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.mode-scene svg { width: 100%; height: 100%; display: block; }
.mode-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.mode-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--mc-soft); color: var(--mc); margin-top: -44px; position: relative; border: 3px solid var(--surface); box-sizing: content-box; }
.mode-ic .ic { width: 24px; height: 24px; }
.mode-body h2 { margin: 12px 0 6px; font-size: 20px; letter-spacing: -.01em; }
.mode-body p { margin: 0 0 12px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.mode-body ul { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mode-body li { position: relative; padding-inline-start: 22px; font-size: 13px; color: var(--text); }
.mode-body li::before { content: ''; position: absolute; inset-inline-start: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--mc-soft); box-shadow: inset 0 0 0 4px var(--mc-soft), inset 0 0 0 10px var(--mc); transform: scale(.75); }
.mode-go { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 12px; background: var(--mc); color: #fff; font-weight: 700; font-size: 14px; transition: gap .2s, filter .2s; }
.mode-go .ic { width: 18px; height: 18px; }
html[dir="rtl"] .mode-go .ic { transform: scaleX(-1); }
.mode-card:hover .mode-go { gap: 14px; filter: brightness(1.07); }
.mode-card.last .mode-body h2::after { content: '•'; color: var(--mc); margin-inline-start: 8px; }
.mode-card.chosen { transform: scale(.98); }
body.leaving .mode-card:not(.chosen) { opacity: .5; transition: opacity .3s; }

.home-note { text-align: center; color: var(--muted); font-size: 13px; margin: 28px 0 0; }

/* scene animations */
.bus-move { animation: busDrive 7s linear infinite; }
@keyframes busDrive { 0% { transform: translateX(-120px); } 42% { transform: translateX(176px); } 58% { transform: translateX(176px); } 100% { transform: translateX(380px); } }
.wheel { transform-box: fill-box; transform-origin: center; animation: spin .6s linear infinite; }
.mode-card.bus .sc-lane { animation: lane 1.2s linear infinite; }
@keyframes lane { to { stroke-dashoffset: -28; } }
@keyframes spin { to { transform: rotate(360deg); } }
.train-move { animation: trainRun 6s cubic-bezier(.45,.05,.55,.95) infinite; }
@keyframes trainRun { 0% { transform: translateX(-310px); } 100% { transform: translateX(370px); } }
.sc-tents path { animation: tent 3s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
.sc-tents path:nth-child(2) { animation-delay: .4s; } .sc-tents path:nth-child(3) { animation-delay: .8s; }
@keyframes tent { 50% { transform: scaleY(1.06); } }
@keyframes hUp { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .bus-move, .train-move, .wheel, .sc-lane, .sc-tents path { animation: none !important; } }

html[data-theme="dark"] .mode-scene { filter: brightness(.82) saturate(.9); }
html[data-theme="dark"] .mode-card.ped { --mc-soft: rgba(189,160,98, .18); }
html[data-theme="dark"] .mode-card.bus { --mc-soft: rgba(244, 63, 94, .18); }
html[data-theme="dark"] .mode-card.train { --mc-soft: rgba(99, 102, 241, .22); }

@media (max-width: 980px) { .mode-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; } }
@media (max-width: 560px) { .home-top { padding: 12px 16px; } .home-main { padding: 8px 16px 32px; } .home-user span:last-child, .home-brand small { display: none; } }

/* icons (the app styles are not loaded on this page) */
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }

/* ------------------------------------------------------------ circular mode cards */
.mode-grid { gap: 36px; align-items: start; }
.mode-card, .mode-card:hover, .mode-card:focus-visible {
  background: none; border: 0; box-shadow: none; overflow: visible; border-radius: 24px; align-items: center; text-align: center; transform: none;
}
.mode-card { padding: 8px 6px 14px; outline: none; }
.mode-card:focus-visible { box-shadow: 0 0 0 3px var(--mc-soft); }
.mode-card.ped .mode-scene { --scene-bg: linear-gradient(#d1fae5, #efe2bf); }
.mode-card.bus .mode-scene { --scene-bg: linear-gradient(#fef3c7, #fde68a); }
.mode-card.train .mode-scene { --scene-bg: linear-gradient(#e0e7ff, #c7d2fe); }

.orb { position: relative; width: 252px; height: 252px; margin: 26px auto 0; animation: orbFloat 6s ease-in-out infinite; animation-delay: calc(var(--d) * -12); transition: scale .35s cubic-bezier(.2,.8,.2,1); }
@keyframes orbFloat { 50% { translate: 0 -9px; } }
.mode-card:hover .orb, .mode-card:focus-visible .orb { scale: 1.05; }
.orb-glow { position: absolute; inset: 12%; border-radius: 50%; background: var(--mc); filter: blur(40px); opacity: .26; transition: opacity .35s; }
.mode-card:hover .orb-glow { opacity: .5; }
/* spinning gradient ring */
.orb-ring {
  position: absolute; inset: -11px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--mc), transparent 28%, var(--mc) 50%, transparent 78%, var(--mc));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
  animation: spin 9s linear infinite; opacity: .9;
}
.mode-card:hover .orb-ring { animation-duration: 2.6s; }
/* dashed orbit with a travelling dot */
.orb-orbit { position: absolute; inset: -24px; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--mc) 45%, transparent); animation: spin 16s linear infinite reverse; }
.orb-orbit i { position: absolute; top: -6px; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: var(--mc); box-shadow: 0 0 0 4px var(--mc-soft), 0 0 16px var(--mc); }
.mode-card .mode-scene {
  position: absolute; inset: 0; height: auto; border-radius: 50%; overflow: hidden; border: 6px solid var(--surface); border-bottom: 6px solid var(--surface);
  background: var(--scene-bg); box-shadow: 0 22px 44px -18px rgba(0,0,0,.4), inset 0 0 0 1px rgba(0,0,0,.05);
}
.mode-card .mode-scene svg { position: absolute; left: -19%; top: 50%; width: 138%; height: auto; transform: translateY(-50%); }
.last-badge { display: none; position: absolute; top: 4px; inset-inline-end: 4px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: var(--mc); color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 6px 14px -6px var(--mc); }
.mode-card.last .last-badge { display: inline-block; }
.mode-card.last .mode-body h2::after { content: none; }

.mode-card .mode-body { padding: 0 10px; align-items: center; }
.mode-card .mode-ic { width: 54px; height: 54px; border-radius: 50%; margin: -30px auto 0; z-index: 3; border: 4px solid var(--surface); box-shadow: 0 8px 18px -8px rgba(0,0,0,.35); box-sizing: border-box; }
.mode-card .mode-ic .ic { width: 24px; height: 24px; }
.mode-card .mode-body h2 { margin: 14px 0 6px; font-size: 21px; }
.mode-card .mode-body p { max-width: 320px; margin: 0 auto 12px; }
.mode-body ul.chips { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 18px; }
.mode-body ul.chips li { padding: 5px 11px 5px 24px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; position: relative; }
html[dir="rtl"] .mode-body ul.chips li { padding: 5px 24px 5px 11px; }
.mode-body ul.chips li::before { inset-inline-start: 8px; top: 50%; margin-top: -5px; width: 10px; height: 10px; transform: none; box-shadow: none; background: var(--mc); opacity: .85; }
.mode-card .mode-go { height: 46px; padding: 0 28px; border-radius: 999px; margin: 0 auto; box-shadow: 0 12px 26px -12px var(--mc); }
.mode-card:hover .mode-go { gap: 14px; filter: brightness(1.08); }
html[data-theme="dark"] .mode-card .mode-scene { border-color: var(--surface); }
@media (prefers-reduced-motion: reduce) { .orb, .orb-ring, .orb-orbit { animation: none !important; } }
@media (max-width: 980px) { .orb { width: 220px; height: 220px; } }

/* ------------------------------------------------------------ compact layout: everything fits on one screen */
.home-top { padding: 10px 28px; }
.home-main { max-width: 1120px; padding: 0 24px 14px; }
.home-hero { margin: 0 auto 6px; }
.home-hello { margin: 0 0 2px; font-size: 13px; }
.home-hero h1 { font-size: clamp(24px, 3.2vw, 36px); }
.home-lead { margin-top: 6px; font-size: 14px; }
.mode-grid { gap: 10px; }
.mode-card { padding: 4px 4px 8px; }
.orb { --orb: clamp(150px, calc(100vh - 560px), 236px); width: var(--orb); height: var(--orb); margin: 26px auto 0; }
.mode-card .mode-ic { width: 46px; height: 46px; margin-top: -26px; }
.mode-card .mode-ic .ic { width: 21px; height: 21px; }
.mode-card .mode-body h2 { margin: 8px 0 4px; font-size: 19px; }
.mode-card .mode-body p { margin: 0 auto 8px; font-size: 13px; line-height: 1.45; max-width: 300px; }
.mode-body ul.chips { gap: 4px 5px; margin: 0 0 12px; }
.mode-body ul.chips li { padding: 3px 10px 3px 22px; font-size: 11.5px; }
html[dir="rtl"] .mode-body ul.chips li { padding: 3px 22px 3px 10px; }
.mode-card .mode-go { height: 40px; padding: 0 24px; font-size: 13.5px; }
.home-note { margin: 8px 0 0; font-size: 12px; }
@media (max-width: 980px) { .orb { --orb: 200px; } .mode-grid { gap: 28px; } }

/* ------------------------------------------------------------ smooth hover, closer circles, breathing room */
/* the circles sit closer together */
.mode-grid { max-width: 940px; margin: 0 auto; gap: 6px; }
/* a line of space under the intro text, under each circle and above the Start buttons */
.home-hero { margin-bottom: 26px; }
.mode-card .mode-body h2 { margin-top: 20px; }
.mode-body ul.chips { margin-bottom: 24px; }

/* hover in and out at the same, gentle pace (no jump in the ring's spin) */
.orb { transition: scale .55s cubic-bezier(.22, .9, .3, 1); }
.mode-card:hover .orb-ring { animation-duration: 9s; }
.orb-ring { transition: opacity .55s ease, filter .55s ease; }
.mode-card:hover .orb-ring, .mode-card:focus-visible .orb-ring { opacity: 1; filter: drop-shadow(0 0 6px var(--mc)); }
.orb-glow { transition: opacity .55s ease, scale .55s ease; }
.mode-card:hover .orb-glow, .mode-card:focus-visible .orb-glow { opacity: .5; scale: 1.08; }
.mode-card .mode-scene { transition: box-shadow .55s ease; }
.mode-card:hover .mode-scene { box-shadow: 0 26px 50px -18px rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.05); }
.mode-card .mode-ic { transition: transform .55s cubic-bezier(.22, .9, .3, 1); }
.mode-card:hover .mode-ic { transform: translateY(-3px); }
.mode-card .mode-go { transition: gap .45s ease, filter .45s ease, box-shadow .45s ease, transform .45s ease; }
.mode-card:hover .mode-go { transform: translateY(-1px); box-shadow: 0 16px 30px -12px var(--mc); }

/* LardhGIS: brand mark, plan chip, the GIS tool card */
.gk-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #bda062, #e0c88a); color: #04111c; box-shadow: 0 8px 20px -8px rgba(189,160,98, .6); }
.home-pill.plan { text-decoration: none; font-size: 12.5px; font-weight: 600; }
.home-pill.plan.trial { color: #b45309; border-color: rgba(245, 158, 11, .45); background: rgba(251, 191, 36, .12); }
.home-pill.plan.active { color: #047857; border-color: rgba(224,200,138, .45); background: rgba(224,200,138, .1); }
html[data-theme="dark"] .home-pill.plan.trial { color: #fbbf24; }
html[data-theme="dark"] .home-pill.plan.active { color: #e0c88a; }
a.home-pill { text-decoration: none; }
.hidden { display: none !important; }
.gis-card { display: flex; align-items: center; gap: 20px; max-width: 940px; margin: 0 auto 30px; padding: 20px 24px; border-radius: 20px; text-decoration: none; color: inherit;
  background: linear-gradient(120deg, rgba(189,160,98, .12), rgba(224,200,138, .08)), var(--surface); border: 1px solid rgba(143,116,51, .35);
  box-shadow: 0 14px 40px -24px rgba(143,116,51, .7); transition: transform .2s, box-shadow .2s, border-color .2s; animation: hUp .6s .05s ease both; }
.gis-card:hover { transform: translateY(-3px); border-color: #8f7433; box-shadow: 0 20px 50px -22px rgba(143,116,51, .8); }
.gis-ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, #bda062, #8f7433); }
.gis-ic .ic { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.gis-txt { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gis-txt small { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8f7433; }
.gis-txt b { font-size: 20px; }
.gis-txt > span { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.gis-txt .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.gis-txt .chips i { font-style: normal; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; color: #8f7433; background: rgba(189,160,98, .14); }
html[data-theme="dark"] .gis-txt .chips i { color: #67e8f9; }
.gis-card .mode-go { flex: none; }
.home-sec { text-align: center; margin: 0 0 18px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) { .gis-card { flex-direction: column; align-items: flex-start; } }
.gis-card { --mc: #8f7433; } .gis-card .mode-go { padding: 0 18px; }
/* GIS card animation */
.gis-anim { position: relative; flex: none; width: 300px; aspect-ratio: 300 / 168; border-radius: 16px; overflow: hidden; border: 1px solid rgba(143,116,51, .35); box-shadow: 0 12px 30px -16px rgba(143,116,51, .7), inset 0 0 0 1px rgba(255, 255, 255, .04); }
.gis-anim canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gis-card:hover .gis-anim { border-color: #8f7433; }
.gis-txt .chips i { transition: background .3s, color .3s, box-shadow .3s; }
.gis-txt .chips i.on { background: #8f7433; color: #fff; box-shadow: 0 4px 14px -4px rgba(143,116,51, .8); }
html[data-theme="dark"] .gis-txt .chips i.on { background: #bda062; color: #04111c; }
@media (max-width: 760px) { .gis-anim { width: 100%; } }

/* GIS card: the same gentle hover in and out as the simulation cards.
   (Its entrance animation holds `transform`, so the lift uses `translate` / `scale`.) */
.gis-card { position: relative; transition: translate .55s cubic-bezier(.22, .9, .3, 1), box-shadow .55s ease, border-color .55s ease, background-color .55s ease; }
.gis-card:hover, .gis-card:focus-visible { transform: none; translate: 0 -6px; border-color: #8f7433; outline: none; box-shadow: 0 28px 60px -24px rgba(143,116,51, .85), 0 0 0 1px rgba(143,116,51, .25); }
.gis-card::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .55s ease;
  background: radial-gradient(420px 160px at 20% 50%, rgba(189,160,98, .16), transparent 70%); }
.gis-card:hover::before, .gis-card:focus-visible::before { opacity: 1; }
.gis-anim { transition: scale .55s cubic-bezier(.22, .9, .3, 1), box-shadow .55s ease, border-color .55s ease; }
.gis-card:hover .gis-anim, .gis-card:focus-visible .gis-anim { scale: 1.035; box-shadow: 0 22px 44px -18px rgba(143,116,51, .9), 0 0 0 1px rgba(189,160,98, .25); }
.gis-txt b { transition: color .55s ease; }
.gis-card:hover .gis-txt b { color: #8f7433; }
html[data-theme="dark"] .gis-card:hover .gis-txt b { color: #67e8f9; }
.gis-card .mode-go { transition: gap .45s ease, filter .45s ease, box-shadow .45s ease, translate .45s ease; }
.gis-card:hover .mode-go, .gis-card:focus-visible .mode-go { gap: 14px; filter: brightness(1.08); translate: 0 -1px; box-shadow: 0 16px 30px -12px #8f7433; }
@media (prefers-reduced-motion: reduce) { .gis-card, .gis-anim, .gis-card .mode-go { transition: none; } }
.gis-card > * { position: relative; z-index: 1; }
/* hovering the LardhGIS card must not change its layout: the arrow slides, the button keeps its width */
.gis-card .mode-go, .gis-card:hover .mode-go, .gis-card:focus-visible .mode-go { gap: 8px; }
.gis-card .mode-go { white-space: nowrap; }
.gis-card .mode-go .ic { transition: transform .45s ease; }
.gis-card:hover .mode-go .ic, .gis-card:focus-visible .mode-go .ic { transform: translateX(5px); }
html[dir="rtl"] .gis-card:hover .mode-go .ic, html[dir="rtl"] .gis-card:focus-visible .mode-go .ic { transform: scaleX(-1) translateX(5px); }
.gis-txt b { white-space: nowrap; }

/* ------------------------------------------------------------ fit one screen: sizes follow the window height, so no scrollbar */
.home-top { padding: 5px 28px; }
.home-main { padding-bottom: 6px; }
.home-hero { margin-bottom: clamp(6px, 1.6vh, 18px); }
.home-hero h1 { font-size: clamp(22px, 3.6vh, 34px); }
.home-lead { margin-top: 4px; font-size: clamp(12.5px, 1.7vh, 14px); line-height: 1.45; }
.gis-card { margin-bottom: clamp(8px, 1.8vh, 20px); padding: clamp(10px, 1.8vh, 18px) 24px; }
.gis-anim { width: clamp(150px, 26vh, 280px); }
.gis-txt > span { font-size: clamp(12.5px, 1.7vh, 14px); line-height: 1.4; }
.gis-txt .chips { margin-top: 2px; }
.home-sec { margin-bottom: clamp(2px, 1vh, 10px); }
.orb { --orb: clamp(110px, 23vh, 230px); margin-top: 24px; }
.mode-card .mode-body h2 { margin-top: 14px; font-size: clamp(16px, 2.3vh, 19px); }
.mode-card .mode-body p { font-size: clamp(12px, 1.6vh, 13px); margin-bottom: 8px; }
.mode-card .mode-go { height: clamp(34px, 4.6vh, 40px); }
.home-note { margin-top: 4px; }
/* short windows: drop the long texts instead of scrolling */
@media (min-width: 981px) and (max-height: 800px) { .home-lead, .mode-card .mode-body p { display: none; } .home-note { display: none; } }
@media (min-width: 981px) and (max-height: 660px) { .gis-txt > span { display: none; } }

/* spare height is shared above and below the content instead of all sitting at the bottom */
.home-body { display: flex; flex-direction: column; }
.home-main { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: center; padding-bottom: clamp(6px, 3vh, 36px); }

/* LardhGIS logo: the pattern mark replaces the old pin glyph everywhere */
.gk-mark { background: url(/img/logo.svg) center / cover no-repeat !important; border: 0 !important; box-shadow: 0 6px 18px -8px rgba(0,0,0,.55) !important; }
.gk-mark svg { display: none !important; }

/* ------------------------------------------------------------ ArdhSolutions: three technologies (LardhGIS, LardhTraffic, LardhPedestrian) */
/* more than one screen now: the page scrolls, the circles keep a comfortable size */
.home-main { justify-content: flex-start; max-width: 1120px; padding-bottom: 48px; }
.orb { --orb: clamp(170px, 22vw, 232px); }
.mode-card .mode-body p { display: block !important; font-size: 13px; }
.home-lead { display: block !important; }
.home-note { display: none !important; }
.mode-grid { gap: 22px; align-items: start; }
.gk-mark.ardh { background: url(/img/ardh-logo.svg) center / cover no-repeat !important; }

/* technology headings */
.home-sec.tech { display: flex; align-items: baseline; justify-content: center; gap: 14px; flex-wrap: wrap; margin: clamp(18px, 3vh, 34px) 0 10px; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.home-sec.tech b { font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.home-sec.tech b::before { content: ''; display: inline-block; width: 28px; height: 4px; border-radius: 4px; margin-inline-end: 12px; vertical-align: middle; background: linear-gradient(90deg, #bda062, #e0c88a); }
#traffic b::before { background: linear-gradient(90deg, #e11d48, #4f46e5); }
#pedestrian b::before { background: linear-gradient(90deg, #8f7433, #16a34a); }
.home-sec.tech:first-of-type { margin-top: 4px; }

/* colours of the new circles */
.mode-card.metro { --mc: #0891b2; --mc-soft: #cffafe; }
.mode-card.stad { --mc: #16a34a; --mc-soft: #dcfce7; }
.mode-card.evac { --mc: #dc2626; --mc-soft: #fee2e2; }
.mode-card.metro .mode-scene { --scene-bg: linear-gradient(#0f172a, #1e3a4a); }
.mode-card.stad .mode-scene { --scene-bg: linear-gradient(#dcfce7, #bbf7d0); }
.mode-card.evac .mode-scene { --scene-bg: linear-gradient(#fff1f2, #fecdd3); }
html[data-theme="dark"] .mode-card.metro { --mc-soft: rgba(8, 145, 178, .22); }
html[data-theme="dark"] .mode-card.stad { --mc-soft: rgba(34, 197, 94, .18); }
html[data-theme="dark"] .mode-card.evac { --mc-soft: rgba(244, 63, 94, .2); }

/* metro: the set arrives, stops, the doors open, people get on and off, it leaves */
.metro-move { animation: metroRun 9s linear infinite; }
@keyframes metroRun {
  0% { transform: translateX(-400px); animation-timing-function: cubic-bezier(.2, .75, .3, 1); }
  30% { transform: translateX(0); }
  62% { transform: translateX(0); animation-timing-function: cubic-bezier(.6, 0, .9, .55); }
  94%, 100% { transform: translateX(420px); }
}
.mdoor { transform-box: fill-box; transform-origin: center; animation: metroDoor 9s ease-in-out infinite; }
@keyframes metroDoor { 0%, 32% { transform: scaleX(1); } 37%, 57% { transform: scaleX(.1); } 62%, 100% { transform: scaleX(1); } }
.pax { animation-duration: 9s; animation-iteration-count: infinite; animation-timing-function: ease-in-out; }
.pax.board { animation-name: paxBoard; }
.pax.out { animation-name: paxOut; }
@keyframes paxBoard { 0% { opacity: 0; transform: none; } 8%, 40% { opacity: 1; transform: none; } 56% { opacity: 0; transform: translateY(-28px); } 100% { opacity: 0; transform: translateY(-28px); } }
@keyframes paxOut { 0%, 38% { opacity: 0; transform: translateY(-28px); } 44% { opacity: 1; transform: translateY(-28px); } 60%, 88% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; transform: none; } }
.mlight { animation: mlight 2.4s ease-in-out infinite; }
@keyframes mlight { 50% { opacity: .35; } }
.ev-exit rect { animation: evExit 1.2s ease-in-out infinite; }
@keyframes evExit { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .metro-move, .mdoor, .pax, .mlight, .ev-exit rect { animation: none !important; } .pax.out { opacity: 0; } }

/* ------------------------------------------------------------ launcher: LardhGIS + the project list */
.home-main { max-width: 1020px; }
.proj { max-width: 940px; width: 100%; margin: 26px auto 0; padding: 18px 18px 14px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 14px 40px -28px rgba(0, 0, 0, .5); animation: hUp .6s .1s ease both; }
.proj-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.proj-head h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.proj-count { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.proj-count:empty { display: none; }
.proj-search { position: relative; margin-inline-start: auto; flex: 0 1 260px; min-width: 160px; }
.proj-search .ic { position: absolute; inset-inline-start: 11px; top: 50%; margin-top: -8px; color: var(--muted); }
.proj-search input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 0 12px; padding-inline-start: 34px; font: inherit; font-size: 13.5px; outline: none; transition: border-color .2s, box-shadow .2s; }
.proj-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.proj-new { height: 38px; padding: 0 16px; border-radius: 10px; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 700; font-size: 13.5px; background: var(--accent); color: var(--on-accent); transition: filter .2s, transform .2s; }
.proj-new:hover { filter: brightness(1.08); transform: translateY(-1px); }
.proj-new:disabled { opacity: .6; cursor: wait; }
.proj-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; max-height: min(430px, 46vh); overflow-y: auto; padding: 4px 8px 6px 4px; margin-inline: -4px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 60%, transparent) transparent; overscroll-behavior: contain; -webkit-mask-image: linear-gradient(#000 calc(100% - 22px), transparent); mask-image: linear-gradient(#000 calc(100% - 22px), transparent); }
.proj-list::-webkit-scrollbar { width: 8px; }
.proj-list::-webkit-scrollbar-track { background: transparent; }
.proj-list::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
.proj-list::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: content-box; }
.proj-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: inherit; border: 1px solid var(--border); background: var(--bg); transition: transform .25s cubic-bezier(.22, .9, .3, 1), border-color .25s, box-shadow .25s; }
.proj-card:hover, .proj-card:focus-visible { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 14px 28px -18px var(--accent); outline: none; }
.pc-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pc-ic .ic { width: 20px; height: 20px; }
.pc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-tag { flex: none; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: var(--muted); border: 1px solid var(--border); font-style: normal; }
.pc-tag.shared { color: #2563eb; border-color: rgba(37, 99, 235, .35); background: rgba(37, 99, 235, .08); }
html[data-theme="dark"] .pc-tag.shared { color: #93c5fd; }
.pc-go { width: 16px; height: 16px; color: var(--muted); flex: none; transition: transform .25s, color .25s; }
.proj-card:hover .pc-go { color: var(--accent); transform: translateX(3px); }
html[dir="rtl"] .pc-go { transform: scaleX(-1); } html[dir="rtl"] .proj-card:hover .pc-go { transform: scaleX(-1) translateX(3px); }
.proj-empty { grid-column: 1 / -1; text-align: center; padding: 28px 12px; color: var(--muted); font-size: 14px; }
.proj-skel { height: 66px; border-radius: 14px; background: linear-gradient(90deg, var(--bg), color-mix(in srgb, var(--accent) 10%, var(--bg)), var(--bg)); background-size: 200% 100%; animation: projSkel 1.2s linear infinite; }
@keyframes projSkel { to { background-position: -200% 0; } }
@media (max-width: 560px) { .proj-search { flex-basis: 100%; margin-inline-start: 0; order: 3; } .proj-new { margin-inline-start: auto; } }

/* greeting: breathing room under the top bar */
.home-hero { margin-top: clamp(26px, 7vh, 72px); }
.home-hello { margin-bottom: 8px; }

/* project cards: the card opens the project, the two buttons rename / delete */
.proj-card { position: relative; padding: 0; }
.pc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 14px; text-decoration: none; color: inherit; border-radius: 14px; outline: none; }
html[dir="rtl"] .pc-main { padding: 12px 14px 12px 8px; }
.pc-acts { display: flex; gap: 2px; padding-inline-end: 8px; opacity: 0; transition: opacity .2s; }
.proj-card:hover .pc-acts, .proj-card:focus-within .pc-acts { opacity: 1; }
@media (hover: none) { .pc-acts { opacity: 1; } }
.pc-act { width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; }
.pc-act .ic { width: 16px; height: 16px; }
.pc-act:hover, .pc-act:focus-visible { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); outline: none; }
.pc-act.danger:hover, .pc-act.danger:focus-visible { background: rgba(220, 38, 38, .14); color: #ef4444; }
.pc-go { display: none; }

/* dialog */
.hm-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(8, 6, 2, .55); backdrop-filter: blur(4px); animation: hFade .2s ease; }
.hm-box { width: min(420px, 100%); padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); animation: hPop .25s cubic-bezier(.2, .9, .3, 1); }
.hm-box h3 { margin: 0 0 12px; font-size: 17px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hm-box p { margin: 0 0 14px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.hm-box input { width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 0 12px; font: inherit; font-size: 14px; outline: none; margin-bottom: 16px; }
.hm-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.hm-acts { display: flex; justify-content: flex-end; gap: 8px; }
.hm-btn { height: 38px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: filter .2s, border-color .2s; }
.hm-btn:hover { border-color: var(--accent); }
.hm-btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.hm-btn.primary.danger { background: #dc2626; color: #fff; }
.hm-btn.primary:hover { filter: brightness(1.08); }
@keyframes hFade { from { opacity: 0; } }
@keyframes hPop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
/* the action buttons float over the card's right edge, so names keep the full width */
.pc-acts { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); padding: 2px; border-radius: 10px; background: var(--bg); box-shadow: 0 0 0 6px var(--bg); }
.pc-main { padding-inline-end: 14px; }

/* LardhTraffic / LardhPedestrian launchers: their own logo (placeholder files in /img) */
body.app-traffic .gk-mark { background-image: url(/img/traffic-logo.svg) !important; }
body.app-pedestrian .gk-mark { background-image: url(/img/pedestrian-logo.svg) !important; }
body.app-traffic, body.app-pedestrian { --accent: #8f7433; }
body.app-traffic .home-sec.tech, body.app-pedestrian .home-sec.tech { margin-top: 4px; }
.hm-box select { width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 0 12px; font: inherit; font-size: 14px; outline: none; margin: -6px 0 16px; }
.hm-box select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* LardhTraffic / LardhPedestrian launchers: everything on one screen (sizes follow the window height), no card descriptions */
body.app-traffic .home-main, body.app-pedestrian .home-main { padding-bottom: 14px; }
body.app-traffic .home-hero, body.app-pedestrian .home-hero { margin-top: clamp(6px, 2.2vh, 26px); margin-bottom: 0; }
body.app-traffic .home-lead, body.app-pedestrian .home-lead { display: none !important; }
body.app-traffic .home-hero h1, body.app-pedestrian .home-hero h1 { font-size: clamp(22px, 3.6vh, 32px); }
body.app-traffic .home-sec.tech, body.app-pedestrian .home-sec.tech { margin: clamp(2px, 1vh, 10px) 0 0; }
body.app-traffic .orb, body.app-pedestrian .orb { --orb: clamp(104px, 21vh, 184px); margin-top: 20px; }
body.app-traffic .mode-card .mode-body p, body.app-pedestrian .mode-card .mode-body p { display: none !important; }
body.app-traffic .mode-card .mode-body h2, body.app-pedestrian .mode-card .mode-body h2 { margin: 8px 0 8px; font-size: clamp(15px, 2.3vh, 19px); }
body.app-traffic .mode-card .mode-go, body.app-pedestrian .mode-card .mode-go { height: clamp(32px, 4.4vh, 38px); }
body.app-traffic .mode-grid, body.app-pedestrian .mode-grid { gap: 4px; }
body.app-traffic .mode-card, body.app-pedestrian .mode-card { padding-bottom: 2px; }
/* the project list: small cards, two rows visible, the rest scrolls */
body.app-traffic .proj, body.app-pedestrian .proj { margin-top: clamp(8px, 1.6vh, 18px); padding: 10px 14px 8px; border-radius: 18px; }
body.app-traffic .proj-head, body.app-pedestrian .proj-head { margin-bottom: 8px; gap: 10px; }
body.app-traffic .proj-head h2, body.app-pedestrian .proj-head h2 { font-size: 15.5px; }
body.app-traffic .proj-search input, body.app-pedestrian .proj-search input, body.app-traffic .proj-new, body.app-pedestrian .proj-new { height: 32px; font-size: 13px; }
body.app-traffic .proj-list, body.app-pedestrian .proj-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; max-height: clamp(78px, 14vh, 130px); }
body.app-traffic .pc-main, body.app-pedestrian .pc-main { padding: 6px 8px 6px 10px; gap: 9px; }
body.app-traffic .pc-ic, body.app-pedestrian .pc-ic { width: 30px; height: 30px; border-radius: 9px; }
body.app-traffic .pc-ic .ic, body.app-pedestrian .pc-ic .ic { width: 16px; height: 16px; }
body.app-traffic .pc-txt b, body.app-pedestrian .pc-txt b { font-size: 13px; }
body.app-traffic .pc-txt small, body.app-pedestrian .pc-txt small { font-size: 11px; }
body.app-traffic .proj-skel, body.app-pedestrian .proj-skel { height: 44px; }
body.app-traffic .proj-empty, body.app-pedestrian .proj-empty { padding: 10px 8px; font-size: 13px; }

/* the second part of each technology's name (GIS, Traffic, Pedestrian) takes the system gold */
.gx { font-style: normal; color: #b6a16a; }
html:not([data-theme="dark"]) .gx { color: #8f7433; }
.home-sec.tech b .gx, .home-brand b .gx { font-weight: inherit; }

/* LardhTraffic / LardhPedestrian: the greeting sits lower, and a little air between the circles and the projects */
body.app-traffic .home-hero, body.app-pedestrian .home-hero { margin-top: clamp(16px, 5vh, 52px); }
body.app-traffic .proj, body.app-pedestrian .proj { margin-top: clamp(16px, 3.4vh, 32px); }
