:root {
  color-scheme: light;

  --paper: #F7F7F4;
  --surface: #FFFFFF;
  --ink: #1A2238;
  --ink-soft: #545C70;
  --gold: #B28430;
  --gold-ink: #85601C;
  --cobalt: #24439A;
  --cobalt-press: #1B3478;
  --hair: #DEDCD4;

  --display: "Marcellus", "Times New Roman", serif;
  --text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Rota çizgisinin yatay konumu: saat sütunu + boşluk + ray sütununun yarısı */
  --col-time: 52px;
  --col-rail: 18px;
  --gap: 12px;
  --rail-x: calc(var(--col-time) + var(--gap) + var(--col-rail) / 2);

  --page: 600px;
  --side: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* Marcellus ve Hanken Kiril/Arap harflerini içermez */
:root:lang(ru) {
  --display: "Forum", "Times New Roman", serif;
  --text: "Golos Text", system-ui, -apple-system, sans-serif;
}

:root:lang(ar) {
  --display: "Amiri", "Times New Roman", serif;
  --text: "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif;
}

/* Arapça bitişik yazılır: harf aralığı açılmaz, satır yüksekliği artar */
:lang(ar) .hero-title,
:lang(ar) .d-name { letter-spacing: 0; line-height: 1.35; }
:lang(ar) .stop-name { line-height: 1.4; }
:lang(ar) .group-title { line-height: 1.4; }
[dir="rtl"] .back svg { transform: scaleX(-1); }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.locked { overflow: hidden; }

img { display: block; max-width: 100%; }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.app {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--side);
}

/* ---------- Karşılama ---------- */

.hero {
  position: relative;
  padding: 52px 0 36px;
  text-align: center;
}

.hero-logo {
  width: min(64vw, 270px);
  height: auto;
  margin: 0 auto;
  mix-blend-mode: multiply;
}

.hero-title {
  margin: 22px auto 0;
  max-width: 16ch;
  font: 400 clamp(30px, 8.4vw, 40px)/1.08 var(--display);
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.hero-text {
  margin: 14px auto 0;
  max-width: 34ch;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.5;
}

.lang {
  position: absolute;
  top: 12px;
  inset-inline-end: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 13px/1 "Hanken Grotesk", system-ui, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.lang svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lang .caret { width: 14px; height: 14px; color: var(--ink-soft); }

/* Yerel seçim listesi görünmez ama dokunulabilir: telefonda kendi seçicisini açar */
.lang select {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  font-size: 16px;
  cursor: pointer;
}

.lang:focus-within {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

body.pending .app { visibility: hidden; }

/* ---------- Rota ---------- */

.route {
  list-style: none;
  margin: 0;
  padding: 0 0 12px;
}

.route > li {
  position: relative;
  display: grid;
  grid-template-columns: var(--col-time) var(--col-rail) 1fr;
  column-gap: var(--gap);
  align-items: center;
}

/* Ray: her satır kendi çizgi parçasını çizer */
.route > li::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: calc(var(--rail-x) - 1px);
  width: 2px;
  background: var(--gold);
  transform-origin: top;
}

.route > li.ride::before,
.route > li.group-ride::before {
  background: repeating-linear-gradient(to bottom, var(--gold) 0 6px, transparent 6px 12px);
}

.route > li.origin::before { top: 50%; }
.route > li.last::before { bottom: 50%; }

/* Otel: rotanın başlangıcı */
.origin {
  padding: 4px 0 18px;
}

.origin-mark {
  grid-column: 2;
  justify-self: center;
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: var(--surface);
  overflow: hidden;
}

.origin-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.18);
  mix-blend-mode: multiply;
}

.origin-text {
  grid-column: 3;
  padding-inline-start: 10px;
}

.origin-name {
  display: block;
  font: 400 17px/1.2 var(--display);
}

.origin-sub {
  display: block;
  color: var(--ink-soft);
  font-size: 14px;
}

/* Grup başlıkları */
.group {
  padding: 22px 0 10px;
}

.group-node {
  grid-column: 2;
  justify-self: center;
  position: relative;
  width: 14px;
  height: 14px;
  border: 2px solid var(--gold);
  background: var(--paper);
  transform: rotate(45deg);
}

.group-text { grid-column: 3; }

.group-title {
  margin: 0;
  font: 400 25px/1.15 var(--display);
}

.group-sub {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* Duraklar arasındaki ince çizgi: rayı kesmeden metin sütunundan başlar */
.stop + .stop::after {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: calc(var(--col-time) + var(--col-rail) + var(--gap) * 2);
  inset-inline-end: 0;
  height: 1px;
  background: var(--hair);
}

/* Duraklar */
.stop-link {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--col-time) var(--col-rail) 1fr 76px;
  column-gap: var(--gap);
  align-items: center;
  padding: 16px 0;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
}

.stop-link:active .stop-name { color: var(--cobalt); }

@media (hover: hover) {
  .stop-link:hover .stop-name { color: var(--cobalt); }
  .stop-link:hover .stop-thumb img { transform: scale(1.04); }
}

.stop-time {
  text-align: end;
  line-height: 1;
}

.stop-time b {
  display: block;
  color: var(--gold-ink);
  font: 500 23px/1 var(--text);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.02em;
}

.stop-time small {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.2;
}

.stop-dot {
  position: relative;
  justify-self: center;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--paper);
}

.ride .stop-dot {
  background: var(--paper);
  border: 2px solid var(--gold);
}

.stop-text { min-width: 0; }

.stop-name {
  display: block;
  font: 400 20px/1.15 var(--display);
  transition: color .15s;
}

.stop-tag {
  display: -webkit-box;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stop-thumb {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--hair);
}

.stop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

/* Açılışta rota otelden dışarı doğru çizilir */
@media (prefers-reduced-motion: no-preference) {
  .route.drawing > li::before {
    animation: rail 260ms linear both;
    animation-delay: calc(var(--i) * 70ms);
  }
  .route.drawing .stop-dot,
  .route.drawing .group-node {
    animation: node 240ms ease-out both;
    animation-delay: calc(var(--i) * 70ms + 110ms);
  }
}

@keyframes rail { from { transform: scaleY(0); } }
@keyframes node { from { opacity: 0; scale: .3; } }

/* ---------- Alt bilgi ---------- */

.foot {
  margin-top: 28px;
  padding: 28px 0 calc(40px + var(--safe-b));
  border-top: 1px solid var(--hair);
}

.foot-title {
  margin: 0;
  font: 400 22px/1.2 var(--display);
}

.foot-addr {
  margin: 4px 0 14px;
  color: var(--ink-soft);
  font-size: 14.5px;
}

.foot-note {
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  max-width: 60ch;
}

.credits {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

.credits summary {
  cursor: pointer;
  padding: 6px 0;
  color: var(--ink);
  font-weight: 500;
}

.credits ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.credits li { padding: 3px 0; }

.credits a { color: inherit; }

/* ---------- Düğmeler ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.btn-quiet {
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.btn-quiet:active { background: var(--surface); }

.btn-go {
  width: 100%;
  min-height: 56px;
  background: var(--cobalt);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 8px 24px -10px rgba(36, 67, 154, .6);
}

.btn-go:active { background: var(--cobalt-press); }

/* ---------- Detay ---------- */

.detail {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--paper);
}

.detail[hidden] { display: none; }

.detail-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: no-preference) {
  .detail.opening { animation: sheet-in 420ms cubic-bezier(.2, .8, .2, 1) both; }
  .detail.closing { animation: sheet-out 260ms ease-in both; }
}

@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }

.d-photo {
  position: relative;
  margin: 0 auto;
  max-width: 900px;
  aspect-ratio: 4 / 3;
  max-height: 58vh;
  background: var(--hair);
  overflow: hidden;
}

.d-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.d-photo figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 28px 12px 7px;
  color: rgba(255, 255, 255, .88);
  font-size: 11px;
  text-align: end;
  background: linear-gradient(to top, rgba(0, 0, 0, .45), transparent);
}

.back {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  inset-inline-start: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(247, 247, 244, .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(26, 34, 56, .18);
  cursor: pointer;
}

.back svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.d-body {
  max-width: var(--page);
  margin: 0 auto;
  padding: 26px 20px calc(140px + var(--safe-b));
}

.d-name {
  margin: 0;
  font: 400 clamp(32px, 9vw, 42px)/1.05 var(--display);
  letter-spacing: -0.005em;
}

.d-tag {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.45;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 24px 0 26px;
  padding: 14px 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.facts.two { grid-template-columns: repeat(2, 1fr); }

.facts div + div {
  padding-inline-start: 14px;
  border-inline-start: 1px solid var(--hair);
}

.facts dt {
  color: var(--ink-soft);
  font-size: 12.5px;
}

.facts dd {
  margin: 3px 0 0;
  font: 500 16px/1.3 var(--text);
  font-variant-numeric: lining-nums;
}

.d-how {
  margin: -12px 0 24px;
  padding: 12px 14px;
  border-inline-start: 2px dashed var(--gold);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  background: var(--surface);
  border-start-end-radius: 10px;
  border-end-end-radius: 10px;
}

.d-lead {
  margin: 0;
  font-size: 18.5px;
  line-height: 1.6;
}

.d-text p {
  margin: 1.1em 0 0;
  font-size: 16.5px;
  line-height: 1.7;
  color: #2A3146;
}

.tips {
  margin-top: 34px;
  padding: 20px 18px 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--hair);
}

.tips h3 {
  margin: 0 0 6px;
  font: 400 21px/1.2 var(--display);
}

.tips ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tips li {
  position: relative;
  padding-block: 10px 12px;
  padding-inline-start: 22px;
  font-size: 15.5px;
  line-height: 1.5;
}

.tips li + li { border-top: 1px solid var(--hair); }

.tips li::before {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  top: 18px;
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
}

.d-action {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 26px var(--side) calc(14px + var(--safe-b));
  background: linear-gradient(to top, var(--paper) 62%, rgba(247, 247, 244, 0));
  pointer-events: none;
}

.d-action > * {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  pointer-events: auto;
}

.d-app {
  margin-top: 8px;
  margin-bottom: 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.d-app[hidden] { display: none; }

.link-btn {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--cobalt);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Harita seçici ---------- */

.picker {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.picker[hidden] { display: none; }

.picker-shade {
  position: absolute;
  inset: 0;
  background: rgba(26, 34, 56, .48);
}

.picker-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 10px 20px calc(18px + var(--safe-b));
  border-radius: 22px 22px 0 0;
  background: var(--paper);
}

@media (prefers-reduced-motion: no-preference) {
  .picker:not([hidden]) .picker-sheet { animation: sheet-in 300ms cubic-bezier(.2, .8, .2, 1) both; }
  .picker:not([hidden]) .picker-shade { animation: fade 300ms ease both; }
}

@keyframes fade { from { opacity: 0; } }

.grip {
  display: block;
  width: 38px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 4px;
  background: var(--hair);
}

.picker h2 {
  margin: 0;
  font: 400 23px/1.2 var(--display);
}

.picker-dest {
  margin: 4px 0 16px;
  color: var(--ink-soft);
  font-size: 14.5px;
}

.picker-opts {
  display: grid;
  gap: 10px;
}

.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 0 16px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--surface);
  font-size: 17px;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
}

.opt:active { border-color: var(--cobalt); }

.opt-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--paper);
}

.opt-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--cobalt);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.opt-hint {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 400;
}

.remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 6px;
  font-size: 15px;
  cursor: pointer;
}

.remember input {
  width: 20px;
  height: 20px;
  accent-color: var(--cobalt);
}

.picker-cancel {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

/* ---------- Geniş ekran ---------- */

@media (min-width: 700px) {
  :root { --side: 24px; }
  .hero { padding-top: 72px; }
  .stop-link { grid-template-columns: var(--col-time) var(--col-rail) 1fr 96px; }
  .stop-thumb { width: 96px; height: 96px; }
}
