:root {
  --bg: #f2ecdf;
  --surface: #fff8ec;
  --surface2: #ece2d1;
  --surface3: #dfd1bc;
  --text: #151b1d;
  --muted: #657176;
  --line: #d5c8b5;
  --accent: #2f7478;
  --accent2: #91c6be;
  --warm: #c88743;
  --shadow: 0 24px 80px rgba(42, 35, 24, .12);
  --max: 1180px;
}

html[data-theme="dark"] {
  --bg: #151d20;
  --surface: #202b30;
  --surface2: #2a363c;
  --surface3: #344248;
  --text: #f4f1ea;
  --muted: #b7c2c3;
  --line: #3a484e;
  --accent: #9ed2cb;
  --accent2: #78aaa4;
  --warm: #e1b170;
  --shadow: 0 24px 80px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(159,199,190,.20), transparent 34rem),
    radial-gradient(circle at 88% 12%, rgba(201,137,69,.13), transparent 32rem),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
.container { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.nav {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  font-weight: 850;
  letter-spacing: -.04em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-weight: 560;
  letter-spacing: 0;
  margin-top: 1px;
}

.mark {
  width: 40px;
  height: 40px;
  border-radius: 15px;
  overflow: hidden;
  background: var(--surface2);
  flex: 0 0 auto;
}

.mark img { width: 100%; height: 100%; display: block; }

.menu {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.menu a:hover { color: var(--text); }

.nav-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.lang-link {
  min-width: 42px;
  height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.lang-link:hover {
  color: var(--text);
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.theme-toggle {
  height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0 17px;
  cursor: pointer;
  font-weight: 650;
}

.hero { padding: 74px 0 48px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 64px;
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 14px;
  margin-bottom: 26px;
}

h1 {
  margin: 0;
  font-size: clamp(50px, 7vw, 88px);
  line-height: .92;
  letter-spacing: -.075em;
}

.lead {
  max-width: 700px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.hero-card {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-radius: 32px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.screen {
  min-height: 280px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  background: var(--surface2);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.45)),
    url('/posters/paris-walking-travel-tour.jpg');
  background-size: cover;
  background-position: center;
  opacity: .86;
}

.play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: #163439;
  display: grid;
  place-items: center;
  font-size: 34px;
}

.screen-title {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  color: #fff;
}

.screen-title strong { display: block; font-size: 25px; letter-spacing: -.04em; }
.screen-title span { color: rgba(255,255,255,.80); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.stat strong { display: block; font-size: 26px; letter-spacing: -.04em; }
.stat span { color: var(--muted); font-size: 13px; }

.section { padding: 46px 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 22px;
}

.section h2 {
  margin: 0;
  font-size: clamp(32px, 4.2vw, 52px);
  letter-spacing: -.065em;
}

.muted { color: var(--muted); }

.collections {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.collection {
  min-height: 150px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.collection strong { font-size: 19px; letter-spacing: -.03em; }
.collection span { color: var(--muted); font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 12px 50px rgba(0,0,0,.08);
}

.card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: var(--surface2);
}

.card-body { padding: 16px; }

.card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -.035em;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--muted);
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.pill.accent { color: var(--accent); }

.filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-radius: 24px;
  margin-bottom: 20px;
}

.filters input, .filters select {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 13px;
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

table { width: 100%; border-collapse: collapse; min-width: 920px; }

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 11px;
}

td a { color: var(--accent); font-weight: 750; }

.video-shell {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 22px;
  align-items: start;
}

video {
  width: 100%;
  border-radius: 26px;
  background: #000;
  border: 1px solid var(--line);
}

.panel {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-radius: 26px;
  padding: 18px;
}

.kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.kv span:first-child { color: var(--muted); }

.archive-note {
  border: 1px dashed var(--line);
  color: var(--muted);
  border-radius: 24px;
  padding: 18px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.footer {
  margin-top: 54px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 960px) {
  .nav { grid-template-columns: 1fr auto; }
  .menu { display: none; }
  .nav-actions { gap: 10px; }
  .hero-grid, .video-shell { grid-template-columns: 1fr; }
  .hero-grid { gap: 34px; }
  .collections { grid-template-columns: repeat(2,1fr); }
  .grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 28px, var(--max)); }
  h1 { font-size: clamp(42px, 15vw, 64px); }
  .collections { grid-template-columns: 1fr; }
  .theme-toggle { padding: 0 12px; }
  .lang-link { min-width: 36px; padding: 0 10px; }
}

/* SecondX polish: cleaner header spacing and more natural hero layout */
.nav {
  min-height: 78px !important;
  display: grid !important;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr) !important;
  align-items: center !important;
  column-gap: 34px !important;
}

.menu {
  justify-self: center !important;
  gap: 28px !important;
}

.nav-actions {
  justify-self: end !important;
  display: flex !important;
  align-items: center !important;
  gap: 18px !important;
}

.lang-link {
  min-width: 44px !important;
  height: 40px !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--muted) !important;
  font-weight: 750 !important;
  border-radius: 999px !important;
}

.theme-toggle {
  min-width: 116px !important;
  height: 42px !important;
  padding: 0 18px !important;
}

.hero {
  padding-top: 72px !important;
}

.hero-grid {
  gap: 72px !important;
}

h1 {
  max-width: 640px;
}

.lead {
  max-width: 620px;
}

.hero-card {
  max-width: 520px;
  justify-self: center;
}

.screen-title strong {
  max-width: 390px;
}

.collections {
  margin-top: 26px;
}

.collection {
  min-height: 132px !important;
}

.collection span {
  max-width: 220px;
}

@media (max-width: 960px) {
  .nav {
    grid-template-columns: 1fr auto !important;
    column-gap: 16px !important;
  }

  .menu {
    display: none !important;
  }

  .nav-actions {
    gap: 10px !important;
  }

  .hero-grid {
    gap: 38px !important;
  }

  .hero-card {
    justify-self: stretch;
    max-width: none;
  }
}

/* Large screen polish: use more space on wide desktop screens without breaking normal zoom */
@media (min-width: 1440px) {
  :root {
    --max: 1320px;
  }

  .hero-grid {
    grid-template-columns: minmax(560px, 1.05fr) minmax(440px, .85fr);
    gap: 86px !important;
  }

  .hero-card {
    max-width: 560px;
  }

  .screen {
    min-height: 310px;
  }

  .lead {
    max-width: 690px;
  }

  .collections {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1800px) {
  :root {
    --max: 1480px;
  }

  .hero {
    padding-top: 88px !important;
  }

  .hero-grid {
    grid-template-columns: minmax(650px, 1.08fr) minmax(520px, .92fr);
    gap: 110px !important;
  }

  h1 {
    max-width: 760px;
  }

  .lead {
    max-width: 760px;
    font-size: 21px;
  }

  .hero-card {
    max-width: 620px;
  }

  .screen {
    min-height: 350px;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  .section {
    padding-top: 58px;
    padding-bottom: 58px;
  }
}

@media (min-width: 2300px) {
  :root {
    --max: 1640px;
  }

  .hero-grid {
    grid-template-columns: minmax(720px, 1.08fr) minmax(580px, .92fr);
  }

  .hero-card {
    max-width: 680px;
  }

  .screen {
    min-height: 390px;
  }

  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* SecondX hero/UI fix */
:root {
  --text: #20282b;
  --heading: #172023;
  --muted: #5f6e73;
  --accent: #2f7478;
}

html[data-theme="light"] {
  --bg: #f2ecdf;
  --surface: #fff8ec;
  --surface2: #ece2d1;
  --text: #283236;
  --heading: #1c2528;
  --muted: #65757a;
  --line: #d5c8b5;
  --accent: #2f7478;
}

html[data-theme="dark"] {
  --heading: #f4f1ea;
}

body {
  color: var(--text);
}

h1, h2, h3, .brand {
  color: var(--heading);
}

.hero-grid {
  align-items: center !important;
}

.hero-copy {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title {
  min-height: 2.85em;
  display: flex;
  align-items: flex-end;
}

html[lang="en"] .hero-title {
  max-width: 720px;
}

html[lang="ru"] .hero-title {
  max-width: 760px;
}

.hero-copy .lead {
  min-height: 150px;
}

.hero-card {
  width: 100%;
  max-width: 560px;
}

.hero-screen-link {
  display: block;
  color: inherit;
  border-radius: 24px;
  cursor: pointer;
}

.hero-screen-link .screen {
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.hero-screen-link:hover .screen {
  transform: translateY(-2px);
  filter: saturate(1.04);
}

.hero-screen-link:hover .play {
  transform: translate(-50%, -50%) scale(1.04);
}

.play {
  transition: transform .18s ease, background .18s ease;
}

html[data-theme="light"] .play {
  background: rgba(255,255,255,.92);
}

html[data-theme="light"] .btn {
  color: #1c2528;
}

html[data-theme="light"] .btn.primary {
  color: #fff;
  background: #2f7478;
  border-color: #2f7478;
}

html[data-theme="light"] .lead,
html[data-theme="light"] .muted,
html[data-theme="light"] .meta,
html[data-theme="light"] .collection span,
html[data-theme="light"] .stat span {
  color: #647379;
}

.screen-title strong {
  max-width: 360px;
}

.stat-row {
  min-height: 92px;
  align-items: center;
}

@media (min-width: 1440px) {
  .hero-copy {
    min-height: 560px;
  }

  .hero-copy .lead {
    min-height: 160px;
  }

  .hero-card {
    max-width: 600px;
  }
}

@media (max-width: 960px) {
  .hero-copy {
    min-height: auto;
  }

  .hero-title,
  .hero-copy .lead {
    min-height: auto;
  }
}
