:root {
  --brown: #8e3a1f;
  --brown-deep: #7a2a12;
  --ink: #1e1a17;
  --muted: #6b5b50;
  --cream: #f6f1ec;
  --sand: #eae1d8;
  --sand-deep: #d9cbbe;
  --tag: #f4e7df;
  --line: #e5e0da;
  --gutter: clamp(16px, 5.56vw, 80px);
  --display: "Roboto Flex", "Arial Black", sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: #fff; color: var(--ink); font: 400 15px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; }

.display {
  font-family: var(--display);
  font-weight: 1000;
  font-stretch: 151%;
  font-variation-settings: "wdth" 151, "wght" 1000, "opsz" 144;
}

/* Шапка */
.nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 32px; min-height: 68px; padding: 12px var(--gutter); background: var(--cream); border-bottom: 1px solid var(--line); }
.nav--plain { background: #fff; }
.logo { font-size: 20px; line-height: 1; color: var(--brown); letter-spacing: -.01em; }
.nav__links { display: flex; gap: 24px; font-weight: 500; white-space: nowrap; }
.nav__links a:hover, .nav__links a[aria-current] { color: var(--brown); }
.nav__links a[aria-current] { font-weight: 600; }
.lang { display: flex; gap: 4px; margin-left: auto; }
.lang a { display: grid; place-items: center; width: 44px; height: 36px; border: 1px solid var(--sand-deep); border-radius: 18px; font-size: 13px; font-weight: 600; }
.lang a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.lang--plain { margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; }
.lang--plain a:hover { color: var(--brown); }
.lang--plain a[aria-current] { color: var(--brown); }

/* Первый экран */
.hero { padding: 40px var(--gutter) 64px; background: var(--brown); }
.hero__panel { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; min-height: 520px; padding: 40px; background: #fff; }
.hero__top { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-start; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hero__tabs { display: flex; gap: 24px; }
.hero__tabs a { padding-bottom: 10px; color: var(--muted); border-bottom: 2px solid transparent; }
.hero__tabs a:hover { color: var(--brown); }
.hero__tabs a[aria-current] { color: var(--brown); border-color: var(--brown); }
.hero__photo { position: relative; align-self: end; display: grid; place-items: center; height: 160px; background: var(--sand); color: var(--muted); font-size: 13px; overflow: hidden; }
.hero h1 { align-self: end; justify-self: end; font-size: 13.76vw; line-height: .72; color: var(--brown); letter-spacing: -.01em; white-space: nowrap; }

/* Секции */
.section { padding: 104px var(--gutter) 0; }
.section--fill { padding-block: 104px; }
.section--cream { background: var(--cream); }
.section--sand { background: var(--sand); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.section--sand .head { border-color: var(--sand-deep); }
.title { font-size: clamp(44px, 6.53vw, 94px); line-height: .9; color: var(--brown); }
.head__side { flex: 0 0 auto; max-width: 380px; text-align: right; color: var(--muted); }
.head__side--left { max-width: 380px; text-align: left; font-size: 17px; font-weight: 500; color: var(--ink); padding-bottom: 16px; }
.btn { display: inline-flex; align-items: center; gap: 12px; padding: 12px 22px; border-radius: 24px; background: var(--ink); color: #fff; font-weight: 600; transition: background .15s; }
.btn:hover { background: var(--brown); }
.head__side .btn { margin-top: 12px; }
.link { display: inline-block; padding-bottom: 10px; border-bottom: 2px solid currentColor; font-weight: 600; white-space: nowrap; }

/* Карточки кафе */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 24px; margin-top: 40px; }
.photo { position: relative; display: grid; place-items: center; height: 308px; border-radius: 16px; background: var(--sand); color: var(--muted); font-size: 13px; overflow: hidden; }
.photo img, .hero__photo img { position: absolute; inset: 0; }
.credit { position: absolute; top: 12px; right: 12px; max-width: calc(100% - 24px); padding: 3px 7px; border-radius: 6px; background: rgba(30, 26, 23, .62); color: #fff; font-size: 10px; line-height: 1.35; text-align: right; }
.credit:hover { background: var(--ink); }
.hero__photo .credit { top: auto; right: 6px; bottom: 6px; left: 6px; max-width: none; text-align: left; }
.pill { position: absolute; left: 12px; bottom: 12px; padding: 8px 12px; border-radius: 17px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 600; }
.cafe { scroll-margin-top: 88px; }
.cafe:target .photo { box-shadow: 0 0 0 3px var(--brown); }
.cafe__occasion { margin-top: 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brown-deep); }
.cafe__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 16px; }
.cafe__occasion + .cafe__head { margin-top: 12px; }
.cafe h3 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.price { font-size: 14px; font-weight: 700; white-space: nowrap; }
.price__off { color: #b8a99a; }
.cafe__place { margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.cafe__desc { margin-top: 10px; }
.cafe__contacts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; font-weight: 500; }
.cafe__contacts a { color: var(--brown-deep); text-decoration: underline; text-underline-offset: 2px; }
.cafe__contacts a:hover { color: var(--ink); }
.tags li.is-warning { background: var(--ink); color: #fff; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tags li { padding: 4px 10px; border-radius: 6px; background: var(--tag); color: var(--brown-deep); font-size: 12px; font-weight: 600; }
.note { margin-top: 48px; font-size: 13px; color: var(--muted); }

/* Карта */
.map-wrap { padding: 72px var(--gutter) 96px; }
.map { position: relative; height: 520px; border-radius: 16px; background: #efe7df; overflow: hidden; isolation: isolate; }
.map__canvas { position: absolute; inset: 0; z-index: 0; background: #efe7df; font: inherit; }
.map__canvas .leaflet-tile-pane { filter: grayscale(.8) sepia(.28) brightness(1.04) contrast(.92); }
.map__fallback { padding: 24px; color: var(--muted); }
.map__legend { position: absolute; z-index: 1000; top: 16px; left: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.map__legend button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--sand-deep); border-radius: 20px; background: #fff; color: var(--ink); font: 600 13px/1.2 var(--text); cursor: pointer; box-shadow: 0 2px 8px rgba(30, 26, 23, .12); }
.map__legend button[aria-pressed="false"] { opacity: .5; }
.map__legend .mk { width: 14px; height: 14px; }
.map .btn { position: absolute; z-index: 1000; right: 20px; bottom: 20px; }
.mk { display: block; width: 22px; height: 22px; border: 2px solid #fff; border-radius: 50%; background: var(--brown); box-shadow: 0 2px 6px rgba(30, 26, 23, .3); }
.mk--school { border-radius: 6px; background: var(--ink); }
.mk--eat { border-radius: 50% 50% 50% 0; background: #5f7046; }
.mk-wrap { display: grid; place-items: center; }
.leaflet-tooltip.map-tip { padding: 5px 10px; border: 0; border-radius: 6px; background: var(--ink); color: #fff; font: 600 12px/1.3 var(--text); box-shadow: none; }
.leaflet-tooltip-top.map-tip::before { border-top-color: var(--ink); }
.map-pop { font: 400 13px/1.45 var(--text); color: var(--ink); }
.map-pop small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brown-deep); }
.map-pop b { display: block; margin-top: 4px; font-size: 15px; }
.map-pop span { display: block; margin-top: 2px; color: var(--muted); }
.leaflet-container .map-pop > a { display: inline-block; margin-top: 8px; color: var(--brown-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.leaflet-container .map-pop span a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Маршрут */
.route { padding: 104px var(--gutter); background: var(--brown); color: #fff; }
.route .eyebrow { color: #f0dccf; }
.route .head { align-items: flex-end; border: 0; padding: 0; }
.route .title { color: #fff; }
.route__stats { display: flex; align-items: flex-end; gap: 32px; }
.route__stats b { display: block; font-size: 28px; line-height: 1.1; }
.route__stats small { font-size: 13px; color: #f0dccf; }
.stops { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; margin-top: 40px; }
.stop { position: relative; padding-top: 24px; }
.stop::before { content: ""; position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.stop::after { content: ""; position: absolute; top: 6px; left: 14px; right: 0; height: 2px; background: rgba(255, 255, 255, .4); }
.stop b { display: block; font-size: 24px; line-height: 1.1; }
.stop h3 { margin-top: 12px; font-size: 18px; font-weight: 600; }
.stop p { margin-top: 8px; font-size: 14px; color: #f7e8de; }

/* Студентам */
.schools { display: grid; grid-template-columns: repeat(3, 1fr); align-items: start; gap: 24px; margin-top: 48px; }
.school { padding: 28px; border-radius: 16px; background: #fff; }
.school h3 { margin-top: 10px; font-size: 21px; font-weight: 600; line-height: 1.25; }
.school .cafe__occasion { margin-top: 0; }
.school .cafe__contacts { margin-top: 12px; }
.nearby { margin-top: 20px; }
.nearby summary { padding: 10px 18px; font-size: 14px; cursor: pointer; list-style: none; }
.nearby summary::-webkit-details-marker { display: none; }
.nearby summary span { transition: transform .15s; }
.nearby[open] summary span { transform: rotate(180deg); }
.nearby ul { margin-top: 14px; border-top: 1px solid var(--line); }
.nearby li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.nearby li a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.nearby li a:hover { color: var(--brown); }
.nearby li span { flex: 0 0 auto; color: var(--muted); }

/* Секреты */
.secret { border-radius: 16px; background: var(--cream); overflow: hidden; }
.secret .photo { border-radius: 0; background: var(--sand-deep); }
.secret__body { padding: 24px; }
.secret__where { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brown-deep); }
.secret h3 { margin-top: 12px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.secret h3 + p { margin-top: 10px; color: var(--muted); }
.secret .cafe__contacts { margin-top: 12px; }
.grid--tight { gap: 24px; margin-top: 48px; }

/* Каталог */
.catalog { padding: 56px var(--gutter) 96px; }
.back { display: inline-block; font-weight: 600; color: var(--muted); margin-bottom: 48px; }
.back:hover { color: var(--brown); }
.catalog h1 { font-size: clamp(48px, 8.6vw, 124px); line-height: .95; color: var(--brown); }
.catalog__lead { max-width: 380px; margin-top: 14px; font-size: 17px; font-weight: 500; }
.catalog__rule { margin: 24px 0 32px; border: 0; border-top: 1px solid var(--line); }
.filter-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { padding: 11px 18px; border: 1px solid var(--sand-deep); border-radius: 22px; background: #fff; color: var(--ink); font: 600 14px/1.4 var(--text); cursor: pointer; }
.chip span { font-weight: 400; color: var(--muted); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] span { color: var(--sand-deep); }
.shown { margin-top: 28px; color: var(--muted); }
.shown b { color: var(--ink); }
.catalog .grid { margin-top: 32px; }
.catalog--sand { background: var(--sand); }
.catalog--sand .catalog__rule { border-color: var(--sand-deep); }

/* Подвал */
.footer { padding: 72px var(--gutter) 48px; background: var(--ink); color: #fff; }
.footer__top { display: grid; grid-template-columns: repeat(2, 328px) 1fr auto; align-items: start; }
.footer__about { max-width: 300px; color: var(--sand-deep); }
.footer h2 { font: 600 12px/1.5 var(--text); letter-spacing: .08em; text-transform: uppercase; color: #a89a8c; }
.footer li { margin-top: 10px; }
.footer li a:hover { color: var(--sand-deep); }
.btn--ghost { background: none; border: 2px solid #fff; padding: 12px 20px; }
.btn--ghost:hover { background: #fff; color: var(--ink); }
.footer__word { margin-top: 48px; font-size: 19.95vw; line-height: .8; text-align: center; color: var(--brown); white-space: nowrap; }
.footer--short { display: flex; justify-content: space-between; align-items: center; padding-block: 52px; }
.footer--short .logo { font-size: 36px; }

/* Уведомление */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; padding: 12px 20px; border-radius: 24px; background: var(--ink); color: #fff; font-weight: 500; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Маршруты */
.route-block { padding: 48px 0 64px; border-bottom: 1px solid var(--line); }
.route-block:last-child { border-bottom: 0; }
.route-block__lead { max-width: 560px; margin-top: 14px; font-size: 17px; font-weight: 500; }
.route-block__facts { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 24px; }
.route-block__facts b { display: block; font-size: 28px; line-height: 1.1; color: var(--brown); }
.route-block__facts small { font-size: 13px; color: var(--muted); }
.route-block__when { margin-top: 16px; font-size: 14px; color: var(--muted); }
.route-block .btn { margin-top: 20px; }
.route-block__body { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; margin-top: 32px; align-items: start; }
.route-map { height: 480px; border-radius: 16px; background: #efe7df; overflow: hidden; z-index: 0; }
.route-map .leaflet-tile-pane { filter: grayscale(.8) sepia(.28) brightness(1.04) contrast(.92); }
.route-stops { list-style: none; padding: 0; margin: 0; }
.route-stops li { position: relative; padding: 0 0 22px 48px; }
.route-stops li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.route-stops li:last-child::before { display: none; }
.route-stops i { position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brown); color: #fff; font: 700 13px/1 var(--text); font-style: normal; }
.route-stops b { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--brown-deep); }
.route-stops h3 { margin-top: 2px; font-size: 18px; font-weight: 600; }
.route-stops p { margin-top: 4px; color: var(--muted); }
.mk--num { display: grid; place-items: center; width: 26px; height: 26px; color: #fff; font: 700 12px/1 var(--text); font-style: normal; }

@media (max-width: 1100px) {
  .nav { flex-wrap: wrap; gap: 8px 24px; }
  .nav__links { order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .stops { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
  .schools { grid-template-columns: repeat(2, 1fr); }
  .footer__top { grid-template-columns: 1fr 1fr 1fr; gap: 32px; }
  .footer__top .btn { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 700px) {
  html { scroll-padding-top: 120px; }
  .hero { padding-block: 16px 32px; }
  .hero__panel { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 20px; gap: 32px; }
  .hero__top { font-size: 12px; }
  .hero__tabs { gap: 14px; }
  .hero__photo { width: 100%; }
  .hero h1 { justify-self: start; font-size: 21vw; }
  .section { padding-top: 64px; }
  .section--fill, .route { padding-block: 64px; }
  .head, .route .head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .head__side { max-width: none; text-align: left; }
  .head__side--left { padding-bottom: 0; }
  .route__stats { flex-wrap: wrap; }
  .grid, .schools { grid-template-columns: 1fr; }
  .route-block__body { grid-template-columns: 1fr; }
  .route-block .title { font-size: 7.4vw; }
  .route-map { height: 360px; }
  .mk-wrap .mk--num { width: 24px; height: 24px; }
  .photo { height: 240px; }
  .stops { grid-template-columns: 1fr; row-gap: 28px; }
  .map-wrap { padding-block: 48px 64px; }
  .map { height: 440px; }
  .map__legend { top: 12px; left: 12px; }
  .map .btn { right: 12px; bottom: 30px; padding: 10px 16px; font-size: 13px; }
  .mk-wrap .mk { width: 16px; height: 16px; }
  .catalog { padding-block: 32px 64px; }
  .back { margin-bottom: 28px; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__about { grid-column: 1 / -1; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
