/* «Порто Франко», Севастополь — третья тема, не похожая ни на «Лайнер»,
   ни на «Партенит Парк», ни на общий lp.css.

   Продукт другой по СОСТОЯНИЮ, а не только по смыслу: из 216 квартир свободно
   семь. Значит и страница не про «выберите из каталога», а про «осталось
   столько-то, вот они все». Отсюда:
   · крупные карточки последних квартир вместо сетки подбора;
   · шахматка идёт доказательством спроса, а не инструментом выбора;
   · палитра севастопольского известняка: тёплый камень, графит и морская
     бирюза — холоднее глины «Партенита» и светлее корпуса «Лайнера»;
   · плотная, «городская» типографика: узкие межстрочные, деловой ритм.

   ⚠️ БЕЗ ОБВОДОК, как и на остальных объектах. Разделение — плоскостями,
   тенью и воздухом. */

:root {
  --stone: #f6f4f1;        /* известняк — фон */
  --stone-2: #ebe7e1;      /* секция потемнее */
  --stone-3: #ded8d0;
  --card: #ffffff;

  --deep: #14343d;         /* графит с морским отливом — основной */
  --sea: #0d6a72;          /* бирюза — акцент, 5.2:1 с белым */
  --sea-d: #095057;

  --ink: #17242a;          /* 14.6:1 на камне */
  --ink-2: #4a5a61;        /* 6.9:1 */
  --ink-3: #556369;        /* 5.05:1 на тонированной секции и 4.4:1 на самой
                              тёмной плоскости: мелкий текст лежит и там тоже */

  --free: #12796a;
  --booked: #a8791f;
  --sold: #c9c2b8;

  --wrap: 1240px;
  --gut: clamp(18px, 4vw, 60px);
  --sect: clamp(70px, 9vw, 132px);
  --r: 4px;                /* почти прямой угол — городская, а не «природная» пластика */

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --plate: #ffffff;          /* подложка под чертёж — он читается только на светлом */
  --btn-ink: #ffffff;
  --free-ink: #07434a;       /* цвет НОМЕРА в клетке ≠ цвет заливки: 8.8:1 */
  --booked-ink: #664711;
  --sold-ink: #5f5a52;
  --sold-ink-b: #55504a;
  --on-deep: rgba(255,255,255,.15);
  --on-deep-ink: #ffffff;
  --foot-ink: #4f5c62;       /* подвал на тонированном камне: 5.61:1 */
  --sh-1: rgba(23,36,42,.08);
  --sh-2: rgba(23,36,42,.16);
  --sh-3: rgba(23,36,42,.3);
  --veil: rgba(20,52,61,.55);
}

/* ── ТЁМНАЯ ВЕРСИЯ ──────────────────────────────────────────────────────
   Тот же квартал вечером: мокрый камень и подсвеченная вода вместо дневного
   известняка. Правила вёрстки не дублируются — меняются только переменные.
   Селектор без запятой с голым :root (запятая в такой паре красит документ). */
:root[data-theme="dark"] {
  --stone: #0b1417;
  --stone-2: #111d21;
  --stone-3: #18272c;
  --card: #132126;

  --deep: #7fd3d8;           /* на тёмном графит обязан стать светлее фона */
  --sea: #57bcc4;
  --sea-d: #8ad8de;

  --ink: #e9f3f4;            /* 15.1:1 на ночном камне */
  --ink-2: #b0c6ca;          /* 8.6:1 */
  --ink-3: #8ba3a8;          /* 5.6:1 */

  --free: #2f9d87;
  --booked: #c79a35;
  --sold: #2a3b41;

  --plate: #eef2f2;          /* чертёж остаётся на светлой плашке всегда */
  --btn-ink: #082024;        /* тёмные буквы на светлой бирюзе: 9.1:1 */
  --free-ink: #9fe3d4;
  --booked-ink: #f0d089;
  --sold-ink: #8ea3a8;
  --sold-ink-b: #9db2b7;
  --on-deep: rgba(0,0,0,.24);
  --on-deep-ink: #08181c;
  --foot-ink: #93aab0;
  --sh-1: rgba(0,0,0,.42);
  --sh-2: rgba(0,0,0,.52);
  --sh-3: rgba(0,0,0,.68);
  --veil: rgba(3,10,12,.7);
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }

body {
  margin: 0; background: var(--stone); color: var(--ink);
  font: 400 17px/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gut); }
.sect { padding-block: var(--sect); }
.sect--alt { background: var(--stone-2); }
section[id], h2, h3 { scroll-margin-top: 96px; }

/* ── типографика ───────────────────────────────────────────────────────── */

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.028em; line-height: 1.04; }
h1 { font-size: clamp(38px, 6.4vw, 78px); }
h2 { font-size: clamp(28px, 4vw, 46px); }
h3 { font-size: clamp(19px, 2vw, 25px); font-weight: 600; }

.eyebrow {
  font: 600 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--sea); margin-bottom: 16px;
}
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-3); }
.empty { padding: 30px; color: var(--ink-3); }

/* ── шапка ─────────────────────────────────────────────────────────────── */

.hdr {
  position: fixed; inset: 0 0 auto; z-index: 60;
  display: flex; align-items: center; gap: 24px; padding: 12px var(--gut);
  background: color-mix(in srgb, var(--stone) 78%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 transparent; transition: background .25s, box-shadow .25s;
}
.hdr.scrolled { background: color-mix(in srgb, var(--stone) 96%, transparent); box-shadow: 0 8px 26px var(--sh-1); }
.hdr__logo { display: inline-flex; align-items: center; min-height: 44px;
  font-size: 19px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; color: var(--deep); }
.hdr__nav { display: flex; gap: 26px; margin-left: auto; }
.hdr__nav a { font-size: 14.5px; color: var(--ink-2); text-decoration: none; padding: 6px 0;
  box-shadow: 0 1px 0 transparent; transition: color .2s, box-shadow .2s; }
.hdr__nav a:hover { color: var(--deep); box-shadow: 0 1px 0 var(--sea); }
.hdr__tel { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; text-decoration: none; }

/* кнопка смены темы: показываем ту иконку, куда переключимся */
.hdr__theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; padding: 0; cursor: pointer;
  background: transparent; color: var(--ink-2); transition: color .2s, background .2s;
}
.hdr__theme:hover { color: var(--sea); }
.hdr__theme .ic-sun { display: none; }
:root[data-theme="dark"] .hdr__theme .ic-sun { display: block; }
:root[data-theme="dark"] .hdr__theme .ic-moon { display: none; }

/* ── первый экран ──────────────────────────────────────────────────────── */

.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; padding-bottom: clamp(34px, 6vw, 74px); }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, var(--stone) 6%, color-mix(in srgb, var(--stone) 92%, transparent) 36%,
                    color-mix(in srgb, var(--stone) 58%, transparent) 64%, transparent 90%),
    linear-gradient(to right, color-mix(in srgb, var(--stone) 88%, transparent) 8%,
                    color-mix(in srgb, var(--stone) 52%, transparent) 46%, transparent 74%);
}
/* Тот же случай: под надзаголовком кадр (#CED1D3), обычная бирюза даёт
   4.12:1. Своя, темнее — 5.63:1. */
.hero .eyebrow { color: #0a545b; }
.hero .wrap { position: relative; z-index: 1; width: 100%; }
.hero h1 { max-width: 14ch; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--sea-d); }
.hero__sub { font-size: clamp(17px, 1.8vw, 20px); color: var(--ink-2); max-width: 46ch; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)); gap: 10px; margin-top: clamp(26px, 4vw, 46px); }
.facts__i { background: var(--card); border-radius: var(--r); padding: 19px 21px; box-shadow: 0 6px 20px var(--sh-1); }
.facts__v { display: block; font-size: clamp(25px, 2.8vw, 33px); font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.facts__v small { font-size: .5em; font-weight: 500; color: var(--ink-2); margin-left: 4px; }
.facts__k { font-size: 12.5px; color: var(--ink-3); margin-top: 7px; }

/* ── кнопки ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 14px 28px; border: 0; border-radius: var(--r);
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  background: var(--sea); color: var(--btn-ink); transition: background .2s;
}
.btn:hover { background: var(--sea-d); }
.btn--ghost { background: var(--stone-3); color: var(--deep); }
.btn--ghost:hover { background: var(--card); box-shadow: 0 6px 18px var(--sh-2); }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }

/* Кольцо фокуса. Браузер рисует ЭЛЕМЕНТАМ С role="button" собственное —
   в Chrome и Safari синее (`outline: auto`), поверх нашей обводки. Убираем его
   для мыши и оставляем для клавиатуры: без этого страница становится
   непроходимой с клавиатуры.
   ⚠️ У SVG-полигона кольцо не убирается общим `:focus-visible` — нужен свой
   селектор, иначе Chrome рисует своё поверх. */
*:focus:not(:focus-visible) { outline: none; }
.deck__zone:focus, .zone:focus { outline: none; }
.deck__zone:focus-visible, .zone:focus-visible { outline: none; stroke: currentColor; stroke-width: 6; }

/* ── последние квартиры: крупные карточки, а не сетка подбора ──────────── */

.last { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.lot {
  background: var(--card); border: 0; border-radius: var(--r); padding: 0;
  text-align: left; cursor: pointer; color: inherit; font: inherit;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 4px 18px var(--sh-1);
  transition: transform .2s, box-shadow .2s;
}
.lot:hover { transform: translateY(-3px); box-shadow: 0 18px 40px var(--sh-2); }
.lot__pic { position: relative; aspect-ratio: 1 / 1; background: var(--plate); }
.lot__pic img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.lot__noplan { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px;
  text-align: center; font-size: 13px; color: var(--ink-3); background: var(--stone-2); }
.lot__body { padding: 17px 20px 21px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.lot__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lot__area { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.lot__fl { font-size: 12.5px; color: var(--ink-3); }
.lot__price { font-size: 20px; font-weight: 600; color: var(--sea-d); font-variant-numeric: tabular-nums; margin-top: 8px; }
.lot__m2 { font-size: 12.5px; color: var(--ink-3); margin-top: auto; padding-top: 10px; }

/* ── шахматка ──────────────────────────────────────────────────────────── */

.chess__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chess__tab {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px;
  padding: 10px 18px; border: 0; border-radius: var(--r); cursor: pointer;
  background: var(--card); color: var(--ink-2); font: 600 14px var(--sans);
  box-shadow: 0 2px 10px var(--sh-1); transition: background .2s, color .2s, box-shadow .2s;
}
.chess__tab span { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums;
  background: var(--stone-2); color: var(--sea-d); padding: 3px 9px; border-radius: var(--r); }
.chess__tab:hover { color: var(--ink); box-shadow: 0 6px 18px var(--sh-2); }
.chess__tab.is-on { background: var(--deep); color: var(--on-deep-ink); }
.chess__tab.is-on span { background: var(--on-deep); color: var(--on-deep-ink); }

.chess__legend { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
.lg { display: inline-flex; align-items: center; gap: 8px; }
.lg::before { content: ''; width: 11px; height: 11px; border-radius: 2px; background: var(--sold); }
.lg--free::before { background: var(--free); }
.lg--booked::before { background: var(--booked); }
.lg--hint { color: var(--ink-3); }
.lg--hint::before { display: none; }

.chess__scroll { overflow-x: auto; padding: 4px 4px 10px; }
.chess__grid { display: grid; gap: 5px; min-width: max-content; }
.chess__row { display: grid; grid-template-columns: 32px repeat(var(--cols), 84px); gap: 5px; align-items: stretch; }
.chess__fl { display: flex; align-items: center; justify-content: flex-end; padding-right: 6px;
  font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.cell {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 56px; padding: 7px 9px; border: 0; border-radius: var(--r);
  cursor: pointer; text-align: left; font: inherit;
  background: var(--stone-3); color: var(--ink-3);
  transition: transform .14s, box-shadow .14s, background .14s;
}
.cell b { font: 700 14px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cell i { font: 400 11px/1 var(--sans); font-style: normal; }
.cell u { font: 600 11px/1 var(--sans); text-decoration: none; font-variant-numeric: tabular-nums; }

.cell--free { background: color-mix(in srgb, var(--free) 16%, var(--card)); }
.cell--free b, .cell--free u { color: var(--free-ink); }
.cell--booked { background: color-mix(in srgb, var(--booked) 22%, var(--card)); }
.cell--booked b { color: var(--booked-ink); }
/* Номер проданного лота обязан читаться — иначе непонятно, что именно занято */
.cell--sold { background: var(--stone-3); color: var(--sold-ink); cursor: default; }
.cell--sold b { color: var(--sold-ink-b); }
.cell--sold u { display: none; }
.cell--none { background: transparent; cursor: default; }
.cell--dim { opacity: .3; cursor: default; }
.cell--free:hover, .cell--booked:hover {
  transform: translateY(-2px); box-shadow: 0 10px 24px var(--sh-2);
  background: color-mix(in srgb, var(--sea) 18%, var(--card));
}

/* миниатюра по наведению */
.peek { position: fixed; top: 0; left: 0; z-index: 95; width: 268px;
  background: var(--card); border-radius: var(--r); overflow: hidden;
  box-shadow: 0 24px 60px var(--sh-3); opacity: 0; pointer-events: none; transition: opacity .16s; }
.peek.on { opacity: 1; }
.peek__pic { background: var(--plate); aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 10px; }
.peek__pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.peek__pic--no { background: var(--stone-2); color: var(--ink-3); font-size: 12.5px; text-align: center; }
.peek__b { padding: 14px 16px 16px; }
.peek__t { font-size: 17px; font-weight: 600; }
.peek__m { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.peek__p { font-size: 20px; font-weight: 600; color: var(--sea-d); font-variant-numeric: tabular-nums; margin-top: 10px; }
.peek__s { display: inline-block; margin-top: 11px; padding: 4px 11px; border-radius: var(--r);
  font-size: 11.5px; background: var(--stone-2); color: var(--ink-2); }
.peek__s--free { background: color-mix(in srgb, var(--free) 16%, var(--card)); color: var(--sea-d); }
.peek__s--booked { background: color-mix(in srgb, var(--booked) 24%, var(--card)); color: var(--booked-ink); }

/* ── карточка лота ─────────────────────────────────────────────────────── */

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__bg { position: absolute; inset: 0; background: var(--veil); backdrop-filter: blur(3px); }
.modal__box { position: relative; width: min(980px, 100%); max-height: 90svh; overflow: auto;
  background: var(--card); border-radius: var(--r); box-shadow: 0 30px 80px var(--sh-3);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); }
.modal__pic { background: var(--plate); display: grid; place-items: center; padding: 26px; min-height: 320px; }
.modal__side { padding: 28px; background: var(--stone); }
.modal__x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px;
  border: 0; border-radius: var(--r); background: var(--stone-2); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.modal__x:hover { background: var(--stone-3); color: var(--sea-d); }
.spec { list-style: none; margin: 20px 0; padding: 0; }
.spec li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 14px; font-size: 14.5px; border-radius: var(--r); }
.spec li:nth-child(odd) { background: var(--stone-2); }
.spec b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── квартал ───────────────────────────────────────────────────────────── */

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(20px, 3vw, 46px); align-items: start; }
.near { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr)); gap: 14px; }
.near__i { background: var(--card); border-radius: var(--r); padding: 25px 23px; box-shadow: 0 5px 20px var(--sh-1); }
.near__v { font-size: 27px; font-weight: 600; letter-spacing: -.03em; color: var(--sea-d); font-variant-numeric: tabular-nums; }
.near__t { font-size: 16px; font-weight: 600; margin: 9px 0 7px; }
.near__d { font-size: 14px; color: var(--ink-2); line-height: 1.55; }

/* ── форма ─────────────────────────────────────────────────────────────── */

.form { display: grid; gap: 12px; max-width: 460px; }
.form input { min-height: 52px; padding: 14px 18px; width: 100%; border: 0; border-radius: var(--r);
  background: var(--card); color: var(--ink); font: 400 16px var(--sans); box-shadow: 0 2px 12px var(--sh-1); }
.form input::placeholder { color: var(--ink-3); }
.form input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--card) inset;   /* автозаполнение красит в белый */
  -webkit-text-fill-color: var(--ink);
}
.form__note { font-size: 12.5px; color: var(--ink-3); }
.form__msg { font-size: 14.5px; color: var(--sea-d); min-height: 1.4em; }

.foot { background: var(--stone-2); padding-block: 40px; font-size: 14px; color: var(--foot-ink); }
.foot a { color: var(--ink-2); }
.foot .muted { color: var(--foot-ink); }

.rv { opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s; }
.rv.in { opacity: 1; transform: none; }

@media (max-width: 1000px) { .modal__box { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .hdr__nav { display: none; } .facts { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Видеофон первого экрана ведёт себя ровно как кадр под ним: тот же размер
   и кадрирование, иначе в момент подмены картинка «прыгает». Тег создаёт
   sev-theme.js после загрузки и только на широком экране. */
.hero__media video { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; }

/* Ссылка входа в режим правки в подвале. Разметку (.foot__edit) выдают все
   сборщики, а правило жило только в общем lp.css — у объектов со своей темой
   она рисовалась обычной ссылкой подвала и читалась посетителем как пункт
   меню. Неприметность держится мелким кеглем, а не нечитаемым цветом:
   цвет берётся из токена подвала этой темы, проверенного на контраст. */
.foot__edit { margin-top: 14px; }
.foot__edit a { font-size: 12px; color: var(--foot-ink); text-decoration: none;
  border-bottom: 1px dashed currentColor; padding-bottom: 1px; }
.foot__edit a:hover { color: var(--sea); }
