:root {
  --bg: #080a0e;
  --bg-raise: #10161d;
  --ink: #f4f7fb;
  --soft: #d5dee8;
  --muted: #a9b6c6;
  --faint: #7f8da0;
  --line: rgba(255, 255, 255, 0.08);
  --cyan: #2ec8ea;
  --cyan-deep: #0c86a4;
  --cyan-hi: #9aefff;
  --rose: #ff4b88;
  --violet: #8b7cff;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Outfit", system-ui, sans-serif;
  --wrap: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--soft);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(46, 200, 234, 0.16), transparent 55%),
    radial-gradient(ellipse 40% 30% at 100% 0%, rgba(139, 124, 255, 0.08), transparent 50%),
    var(--bg);
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--cyan);
  color: #041016;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

a {
  color: var(--cyan-hi);
  text-underline-offset: 0.18em;
}

a:hover {
  color: white;
}

/* —— Masthead —— */

.mast {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 10, 14, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.agebar {
  margin: 0;
  height: 1.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #06303a 0%, #0e7f99 50%, #12304a 100%);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.top {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin: 0 auto;
  min-height: 4.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem 1.5rem;
}

.top__logo {
  display: block;
  line-height: 0;
}

.top__logo img {
  display: block;
  height: 40px;
  width: auto;
  mix-blend-mode: screen;
}

.top__nav {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
}

.top__nav a {
  color: var(--soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 550;
}

.top__nav a:hover,
.top__nav a[aria-current="page"] {
  color: var(--cyan-hi);
}

.top__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.35rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  background: var(--cyan);
  color: #042028;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.top__cta:hover {
  color: #042028;
  filter: brightness(1.08);
}

.wrap {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin-inline: auto;
}

/* —— Hero —— */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(2.2rem, 5vw, 4.2rem) 0 1.5rem;
}

.hero__logo {
  display: block;
  width: min(100%, 340px);
  margin: 0 0 1.1rem;
  mix-blend-mode: screen;
}

.kicker {
  margin: 0 0 0.7rem;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.page__title,
.band h2,
.section h2,
.article h1 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.7rem, 5.6vw, 4.5rem);
  line-height: 0.96;
}

.hero h1 em {
  font-style: italic;
  font-weight: 560;
  color: var(--cyan-hi);
}

.lede {
  max-width: 38rem;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.lede strong,
.prose strong,
.content strong {
  color: var(--ink);
  font-weight: 650;
}

.fine {
  margin: 0.85rem 0 0;
  color: var(--faint);
  font-size: 0.82rem;
}

/* —— Buttons (same three entry points) —— */

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: min(100%, 26.5rem);
  margin-top: 1.35rem;
}

.btn {
  --accent: #0c7f99;
  --accent-hi: #18b0d4;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.45rem;
  padding: 0.8rem 1.05rem 0.8rem 0.9rem;
  border-radius: 0.7rem;
  background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 100%);
  color: white;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s var(--ease), filter 0.25s var(--ease);
}

.btn--private {
  --accent: #c21862;
  --accent-hi: #ff4d8d;
}

.btn--telegram {
  --accent: #4d3fd0;
  --accent-hi: #7d6cff;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.06);
  color: white;
}

.btn:active {
  transform: translateY(0);
}

.btn__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
}

.btn__icon svg {
  width: 100%;
  height: 100%;
}

.btn__label {
  flex: 1;
  text-align: center;
  padding-right: 1.45rem;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  line-height: 1.25;
}

.hero__panel {
  padding: 1.15rem 1.15rem 0.45rem;
  border-radius: 1.2rem;
  background:
    linear-gradient(180deg, rgba(18, 28, 36, 0.96), rgba(12, 18, 24, 0.96));
  border: 1px solid rgba(46, 200, 234, 0.22);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
}

.lead-story {
  display: block;
  padding: 0.35rem 0.35rem 1rem;
  color: inherit;
  text-decoration: none;
}

.lead-story h2 {
  margin: 0.75rem 0 0.45rem;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.lead-story p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.more {
  display: inline-block;
  margin-top: 0.85rem;
  color: var(--cyan-hi);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.lead-list a {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.8rem 0.35rem;
  border-top: 1px solid var(--line);
  color: var(--soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.lead-list li:first-child a {
  border-top: 0;
}

.lead-list a span {
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lead-list a:hover {
  color: white;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: rgba(46, 200, 234, 0.12);
  color: var(--cyan-hi);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pill--rose {
  background: rgba(255, 75, 136, 0.14);
  color: #ffc0d4;
}

.pill--violet {
  background: rgba(139, 124, 255, 0.16);
  color: #ddd6ff;
}

.pill--ink {
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
}

/* —— Stats —— */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin: 0.4rem 0 0.5rem;
  padding: 0;
  list-style: none;
}

.stats li {
  padding: 1rem 1.1rem 0.95rem;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.15;
}

.stats span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.86rem;
}

/* —— Sections & posts —— */

.section {
  padding: 3.4rem 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.section h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.55rem);
  line-height: 1.05;
}

.section__head p.dek,
.dek {
  margin: 0.45rem 0 0;
  max-width: 38rem;
  color: var(--muted);
}

.textlink {
  color: var(--cyan-hi);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.textlink:hover {
  color: white;
}

.posts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.post {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.2rem 1.2rem 1.1rem;
  border-radius: 1rem;
  background: rgba(16, 22, 29, 0.86);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.25s var(--ease);
}

.post:hover {
  border-color: rgba(46, 200, 234, 0.45);
  transform: translateY(-2px);
  color: inherit;
}

.post__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.post time,
.byline,
.rowpost time {
  color: var(--faint);
  font-size: 0.8rem;
}

.post h3 {
  margin: 0.85rem 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 560;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.post p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.post .more {
  margin-top: auto;
  padding-top: 1rem;
}

.caves {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.cave {
  padding: 1.15rem 1.1rem 1.2rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.cave h3 {
  margin: 0.75rem 0 0.35rem;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 650;
}

.cave p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.section__note {
  margin: 1.1rem 0 0;
  color: var(--muted);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding: 1.1rem 1rem 1.15rem;
  border-top: 2px solid rgba(46, 200, 234, 0.45);
  background: rgba(255, 255, 255, 0.025);
}

.steps span {
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--cyan);
}

.steps h3 {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-size: 1.02rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.qa {
  border-top: 1px solid var(--line);
}

.qa:last-of-type {
  border-bottom: 1px solid var(--line);
}

.qa summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  cursor: pointer;
  color: var(--ink);
  font-weight: 650;
  list-style: none;
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary::after {
  content: "+";
  color: var(--cyan);
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1;
}

.qa[open] summary::after {
  content: "–";
}

.qa p {
  margin: 0 0 1rem;
  max-width: 44rem;
  color: var(--muted);
}

/* —— Closing band —— */

.band {
  margin-top: 0.5rem;
  padding: 3.5rem 0 4rem;
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(46, 200, 234, 0.16), transparent 60%),
    #0b1016;
  border-top: 1px solid var(--line);
  text-align: center;
}

.band h2 {
  margin: 0 auto;
  max-width: 16ch;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.02;
}

.band .dek {
  margin: 0.8rem auto 0;
  max-width: 34rem;
}

.band .actions {
  margin-inline: auto;
  text-align: left;
}

/* —— Footer —— */

.foot {
  padding: 1.35rem 1rem 1.6rem;
  border-top: 1px solid var(--line);
  background: #07090c;
  text-align: center;
}

.foot__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 1.15rem;
  max-width: 70rem;
  margin: 0 auto;
}

.foot__nav a {
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
}

.foot__nav a:hover {
  color: white;
}

.foot__copyright {
  margin: 0.7rem 0 0;
  color: var(--faint);
  font-size: 0.72rem;
}

/* —— Internal pages —— */

.page {
  width: min(760px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.6rem 0 4.2rem;
}

.page--wide {
  width: min(860px, calc(100% - 2.5rem));
}

.page__header {
  margin-bottom: 2rem;
}

.page__title {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 0.98;
}

.page__intro {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.content section {
  margin: 0 0 2.2rem;
}

.content h2 {
  margin: 0 0 0.85rem;
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.content h3 {
  margin: 0 0 0.4rem;
  color: var(--ink);
  font-size: 1.02rem;
}

.content p,
.content li {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

.content p {
  margin: 0 0 0.85rem;
}

.content p:last-child {
  margin-bottom: 0;
}

.content a:not(.btn) {
  color: var(--cyan-hi);
}

.content__card {
  margin-bottom: 0.75rem;
  padding: 1.15rem 1.2rem;
  border-radius: 0.9rem;
  background: rgba(16, 22, 29, 0.86);
  border: 1px solid var(--line);
}

.page .content__card > .btn {
  width: min(100%, 26.5rem);
  margin-top: 1rem;
}

.back-home {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.back-home:hover {
  color: white;
}

/* —— Journal index & articles —— */

.rowpost {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.4rem 1.25rem;
  align-items: start;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.rowpost:last-child {
  border-bottom: 1px solid var(--line);
}

.rowpost:hover strong {
  color: var(--cyan-hi);
}

.rowpost strong {
  display: block;
  margin-top: 0.45rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.rowpost em {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-style: normal;
  font-size: 0.95rem;
}

.article {
  width: min(740px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.crumbs {
  margin: 0 0 0.9rem;
  color: var(--faint);
  font-size: 0.82rem;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: white;
}

.article h1 {
  margin: 0.8rem 0 0;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1.02;
}

.byline {
  margin: 0.9rem 0 0;
}

.prose {
  margin-top: 1.8rem;
}

.prose p,
.prose li {
  color: var(--soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

.prose p {
  margin: 0 0 1rem;
}

.prose h2 {
  margin: 1.8rem 0 0.6rem;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.article__end {
  margin-top: 2.2rem;
  padding: 1.3rem 1.2rem 1.4rem;
  border-radius: 1rem;
  background: rgba(16, 22, 29, 0.9);
  border: 1px solid rgba(46, 200, 234, 0.2);
}

.article__end h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 560;
  color: var(--ink);
}

.article__end .actions {
  margin-top: 0.9rem;
}

.related {
  margin-top: 2rem;
}

.related h2 {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 560;
  color: var(--ink);
}

.related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related a {
  display: block;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  color: var(--soft);
  text-decoration: none;
  font-weight: 600;
}

.related li:last-child a {
  border-bottom: 1px solid var(--line);
}

.related a:hover {
  color: var(--cyan-hi);
}

@media (max-width: 980px) {
  .caves,
  .steps {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .hero,
  .posts,
  .stats {
    grid-template-columns: 1fr;
  }

  .hero__logo {
    display: none;
  }

  .top {
    grid-template-columns: 1fr auto;
    min-height: 0;
    padding: 0.75rem 0 0.85rem;
  }

  .top__logo {
    grid-column: 1;
    grid-row: 1;
  }

  .top__cta {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .top__nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .top__nav a {
    white-space: nowrap;
  }

  .section__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .agebar {
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    padding-inline: 0.5rem;
    text-align: center;
  }

  .caves,
  .steps,
  .rowpost {
    grid-template-columns: 1fr;
  }

  .wrap,
  .top {
    width: min(var(--wrap), calc(100% - 1.5rem));
  }

  .actions {
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 11vw, 3.1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .post {
    transition: none;
  }

  .btn:hover,
  .post:hover {
    transform: none;
  }
}
