/* ELBIAN · 2027 - собрано по макету Figma «Troitskii», десктоп 1440 */

:root {
  --cream: #f6f2eb;
  --navy: #0e2a3b;
  --navy-deep: #081a26;
  --accent: #c0703a;
  --accent-light: #e3a574;
  --text: #33414c;
  --muted: #6b7680;
  --line: #d8cfc2;
  --sand: #d9cfc1;
  --sand-dark: #c9bba8;
  --sand-text: #7a6a58;
  --quote-bg: #efe8dd;
  --close-bg: #e4ddd2;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --pad: 80px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
[id] { scroll-margin-top: 24px; }

.wrap {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------- общие элементы ---------- */

.kicker {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}

.h2 {
  margin-top: 16px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 52px;
  line-height: 1.1;
  color: var(--navy);
}
.h2--light { color: #fff; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  padding: 16px 30px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: #a95f2f; }
.btn--outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn--outline:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn--light { background: #fff; color: var(--navy); font-size: 15px; padding: 12px 24px; }
.btn--light:hover { background: var(--cream); }

:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

/* ---------- HERO ---------- */

.hero {
  position: relative;
  min-height: max(100vh, 760px);
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(8,26,38,.55) 0%, rgba(8,26,38,.12) 32%, rgba(8,26,38,.25) 60%, rgba(8,26,38,.78) 100%),
    url("/img/hero.jpg") center 55% / cover no-repeat,
    var(--navy);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  padding-bottom: 32px;
}
.logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .5px;
  color: #fff;
}
.nav__links { display: flex; align-items: center; gap: 40px; font-size: 15px; }
.nav__links a:not(.btn) { opacity: .95; transition: opacity .2s; }
.nav__links a:not(.btn):hover { opacity: .7; }

.hero__body {
  margin-top: auto;
  padding-bottom: 140px; /* место под заезд карточки «Набираем команду» */
}
.hero__kicker {
  font-size: 16px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.hero__title {
  margin-top: 16px;
  max-width: 900px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 65px;
  line-height: 60px;
}

.route-chips {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.route-chips li {
  font-weight: 300;
  font-size: 16px;
  line-height: 20px;
  background: var(--navy);
  padding: 10px;
  border-radius: 10px;
}
.route-chips li + li { position: relative; margin-left: 24px; }
.route-chips li + li::after {
  content: "→";
  position: absolute;
  left: -24px;
  width: 24px;
  text-align: center;
  font-weight: 400;
}

.hero__stats {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 56px;
}
.hero__stats dt {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.33;
}
.hero__stats dd { font-size: 14px; opacity: .8; }

/* ---------- НАБИРАЕМ КОМАНДУ ---------- */

.crew { position: relative; z-index: 2; margin-top: -60px; }
.crew__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  background: var(--navy);
  border-radius: 28px;
  overflow: hidden;
  color: #fff;
}
.crew__text { padding: 64px; }
.crew__title {
  margin-top: 16px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 46px;
  line-height: 1.1;
}
.crew__lead {
  margin-top: 20px;
  max-width: 560px;
  font-size: 18px;
  line-height: 1.6;
  opacity: .85;
}
.tags { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.tags li {
  background: rgba(255,255,255,.1);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  line-height: 17px;
}
.crew__actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; }
.crew__photo { position: relative; min-height: 100%; }
.crew__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- КАПИТАН ---------- */

.captain {
  display: flex;
  align-items: center;
  gap: 80px;
  padding-top: 100px;
  padding-bottom: 120px;
}
.captain__photo {
  flex: 0 0 480px;
  height: 580px;
  background: var(--sand);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.captain__avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--sand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 52px;
  color: #fff;
}
.captain__caption { font-size: 15px; color: var(--sand-text); }
.captain__text { flex: 1 1 720px; max-width: 720px; }
.captain__lead { margin-top: 28px; font-size: 19px; line-height: 1.7; }

.facts {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
}
.facts dt {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.33;
  color: var(--navy);
}
.facts dd { font-size: 14px; color: var(--muted); }

.read-more {
  margin-top: 36px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 4px;
  background: none;
  border: 0;
  border-bottom: 2px solid var(--accent);
  font-weight: 600;
  font-size: 17px;
  color: var(--navy);
}
.read-more span { color: var(--accent); transition: transform .2s; }
.read-more:hover span { transform: translateY(3px); }

/* ---------- МАРШРУТ ---------- */

.route {
  background: var(--navy);
  color: #fff;
  padding: 120px 0;
}
.tabs {
  margin-top: 36px;
  display: inline-flex;
  flex-wrap: wrap;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.tab {
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
  opacity: .7;
}
.tab.is-active { background: #fff; color: var(--navy); font-weight: 600; opacity: 1; }
.route__note {
  margin-top: 20px;
  max-width: 820px;
  font-size: 16px;
  line-height: 1.6;
  opacity: .7;
}

.stages {
  margin-top: 48px;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.stages th {
  padding: 0 20px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .6;
}
.stages td {
  padding: 24px 20px;
  vertical-align: top;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 16px;
  line-height: 24px;
}
.stages__n {
  font-family: var(--serif);
  font-size: 28px !important;
  line-height: 42px !important;
  color: var(--accent-light);
}
.stages__leg b { display: block; font-weight: 600; font-size: 19px; line-height: 28.5px; }
.stages__leg span { display: block; margin-top: 4px; font-size: 14px; line-height: 21px; opacity: .6; }
.stages__mi { white-space: nowrap; font-family: var(--serif); font-size: 24px !important; line-height: 36px !important; }
.stages__how { opacity: .8; }

.stages tfoot td {
  border-top: 2px solid rgba(255,255,255,.4);
  padding-top: 26px;
  padding-bottom: 40px;
  font-weight: 600;
  font-size: 18px;
  line-height: 27px;
}
.stages tfoot .stages__mi { font-weight: 600; }

/* ---------- ЯХТА ---------- */

.yacht { padding-top: 120px; padding-bottom: 120px; }
.specs {
  margin-top: 48px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px 32px;
}
.specs dt {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.33;
  color: var(--navy);
}
.specs dd { font-size: 14px; color: var(--muted); }

.gallery {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 260px;
  gap: 16px;
}
.g {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--sand);
}
.g--big { grid-column: span 2; grid-row: span 2; }
.g--wide { grid-column: span 2; }
.g img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.g:hover img { transform: scale(1.04); }
.g::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 70px;
  background: linear-gradient(180deg, transparent, rgba(8,26,38,.45));
  pointer-events: none;
}
.g figcaption {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 1;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

/* ---------- FOOTER ---------- */

.footer { background: var(--navy-deep); color: #fff; }
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 64px;
  padding-bottom: 64px;
}
.footer__tag { margin-top: 8px; font-size: 14px; opacity: .6; }

/* ---------- МОДАЛКИ ---------- */

dialog { border: 0; padding: 0; }
dialog::backdrop { background: rgba(8,26,38,.6); backdrop-filter: blur(2px); }
body.is-locked { overflow: hidden; }

.modal {
  position: fixed;
  width: min(880px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  overflow: auto;
  padding: 56px 64px;
  border-radius: 24px;
  background: var(--cream);
  color: var(--text);
}
.modal[open] { animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.33;
  color: var(--navy);
  padding-right: 56px;
}
.modal__sub { margin-top: 8px; font-weight: 600; font-size: 15px; color: var(--accent); }
.modal p:not(.modal__sub) { margin-top: 18px; font-size: 17px; line-height: 1.7; }
.modal__quote {
  margin-top: 26px;
  padding: 20px 24px;
  background: var(--quote-bg);
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.33;
  color: var(--navy);
}
.modal__close {
  position: absolute;
  top: 28px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--close-bg);
  color: var(--navy);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s;
}
.modal__close:hover { background: var(--line); }

.lightbox {
  position: fixed;
  max-width: min(1200px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  background: transparent;
  overflow: visible;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 100px);
  border-radius: 16px;
  object-fit: contain;
}
.lightbox__cap { margin-top: 12px; text-align: center; color: #fff; font-weight: 600; font-size: 15px; }
.lightbox .modal__close { top: 12px; right: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 10px 30px rgba(8,26,38,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 10;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- АДАПТИВ ---------- */

@media (max-width: 1200px) {
  :root { --pad: 48px; }
  .crew__card { grid-template-columns: minmax(0, 1fr) 40%; }
  .captain { gap: 48px; }
  .captain__photo { flex-basis: 380px; height: 480px; }
}

@media (max-width: 1024px) {
  .nav__links { gap: 24px; }
  .hero__title { font-size: 54px; line-height: 1.05; }
  .crew__card { grid-template-columns: 1fr; }
  .crew__photo { height: 360px; min-height: 0; order: -1; }
  .captain { flex-direction: column; align-items: stretch; }
  .captain__photo { flex-basis: auto; height: 360px; }
  .captain__text { max-width: none; }

  /* таблица этапов → карточки */
  .stages, .stages tbody, .stages tfoot, .stages tr, .stages td { display: block; width: 100%; }
  .stages colgroup, .stages thead { display: none; }
  .stages tr {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 4px 16px;
    padding: 24px 0;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .stages td { padding: 0; border: 0; }
  .stages__n { grid-row: span 3; }
  .stages__leg { grid-column: 2; }
  .stages__date { grid-column: 2; opacity: .9; }
  .stages__mi { grid-column: 3; grid-row: 1; text-align: right; white-space: nowrap; }
  .stages__mi::after { content: " миль"; font-family: var(--sans); font-size: 14px; opacity: .6; }
  .stages__how { grid-column: 2 / -1; margin-top: 6px; }
  .stages tfoot tr { border-top: 2px solid rgba(255,255,255,.4); padding-bottom: 0; }
  .stages tfoot td { padding: 0; border: 0; }
  .stages tfoot .stages__n { display: none; }

  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 220px; }
}

@media (max-width: 720px) {
  :root { --pad: 20px; }
  .nav { padding-top: 20px; padding-bottom: 20px; }
  .nav__links a:not(.btn) { display: none; }
  .logo { font-size: 19px; }
  .btn--light { padding: 10px 18px; font-size: 14px; }

  .hero { min-height: max(100svh, 640px); }
  .hero__body { padding-bottom: 110px; }
  .hero__kicker { font-size: 13px; letter-spacing: 2px; }
  .hero__title { font-size: 40px; }
  .route-chips { margin-top: 20px; gap: 8px; }
  .route-chips li { font-size: 14px; padding: 7px 9px; }
  .route-chips li + li { margin-left: 18px; }
  .route-chips li + li::after { left: -20px; width: 18px; }
  .hero__stats { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
  .hero__stats dt { font-size: 28px; }

  .crew__text { padding: 32px 24px; }
  .crew__photo { height: 240px; }
  .crew__title { font-size: 32px; }
  .crew__lead { font-size: 16px; }
  .crew__actions .btn { flex: 1 1 100%; }

  .h2 { font-size: 34px; }
  .captain { padding-top: 64px; padding-bottom: 72px; gap: 32px; }
  .captain__photo { height: 280px; }
  .captain__lead { font-size: 17px; }
  .facts dt { font-size: 24px; }

  .route, .yacht { padding-top: 72px; padding-bottom: 72px; }
  .tabs { border-radius: 22px; }
  .tab { padding: 10px 16px; font-size: 14px; }
  .stages tr { grid-template-columns: 36px 1fr auto; gap: 4px 12px; }
  .stages__n { font-size: 24px !important; line-height: 32px !important; }
  .stages__leg b { font-size: 17px; line-height: 24px; }
  .stages__mi { font-size: 20px !important; line-height: 28px !important; }

  .specs { display: grid; grid-template-columns: repeat(2, 1fr); }
  .specs dt { font-size: 22px; }

  .gallery { grid-auto-rows: 150px; gap: 10px; }
  .g { border-radius: 12px; }
  .g figcaption { font-size: 12px; left: 10px; bottom: 9px; }

  .footer__inner { flex-direction: column; align-items: flex-start; padding-top: 48px; padding-bottom: 48px; }

  .modal { padding: 32px 22px; border-radius: 18px; }
  .modal__title { font-size: 30px; }
  .modal__close { top: 18px; right: 18px; width: 40px; height: 40px; }
  .modal p:not(.modal__sub) { font-size: 16px; }
  .modal__quote { font-size: 17px; }
}

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