:root {
  --bg: #fcfcfa;
  --surface: #ffffff;
  --text: #111111;
  --muted: #71717a;
  --border: #e5e5e5;
  --accent: #0ea5a4;
  --accent-dark: #0b7f7e;
  --radius: 16px;
  --shell: 1120px;
  --article: 720px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --shadow-border:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 1px 2px -1px rgba(0, 0, 0, 0.06),
    0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-border-hover:
    0 0 0 1px rgba(14, 165, 164, 0.36),
    0 1px 2px -1px rgba(0, 0, 0, 0.08),
    0 8px 18px -12px rgba(0, 0, 0, 0.22);
  --shadow-popover:
    0 0 0 1px rgba(0, 0, 0, 0.07),
    0 18px 50px rgba(17, 17, 17, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(14, 165, 164, 0.035), transparent 320px),
    var(--bg);
  color: var(--text);
}

body.is-share-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(14, 165, 164, 0.72);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li,
.language-option,
.button,
.nav-link {
  text-wrap: pretty;
}

.shell {
  width: min(calc(100% - 32px), var(--shell));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(252, 252, 250, 0.88);
  border-bottom: 1px solid rgba(229, 229, 229, 0.72);
  backdrop-filter: blur(18px);
}

.header-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 20px;
}

.brand {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand span {
  color: var(--muted);
  margin-inline: 6px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link,
.language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 560;
  line-height: 1;
  transition-property: background-color, border-color, color, scale;
  transition-duration: 150ms;
  transition-timing-function: var(--ease);
}

.nav-link:active,
.language-button:active {
  scale: 0.96;
}

.nav-link {
  padding: 0 13px;
}

.language-button {
  min-width: 46px;
  cursor: pointer;
}

.nav-link:hover,
.language-button:hover,
.language.is-open .language-button {
  border-color: var(--border);
  background: var(--surface);
}

.language {
  position: relative;
}

.language-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition-property: opacity, transform;
  transition-duration: 160ms;
  transition-timing-function: var(--ease);
}

.language.is-open .language-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.language-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  min-height: 42px;
  padding: 11px 12px;
  text-align: left;
  transition-property: background-color, color, scale;
  transition-duration: 150ms;
  transition-timing-function: var(--ease);
}

.language-option:hover {
  background: #f6f6f3;
}

.language-option:active {
  scale: 0.96;
}

.language-option.is-active {
  color: var(--accent-dark);
  font-weight: 680;
}

.language-option.is-active::after {
  content: "таңдалды";
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

.language-message {
  min-height: 0;
  margin: 0;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-4px);
  transition-property: opacity, transform, margin, padding;
  transition-duration: 180ms;
  transition-timing-function: var(--ease);
}

.language-message.is-visible {
  margin-top: 6px;
  padding-block: 10px 8px;
  border-top: 1px solid var(--border);
  opacity: 1;
  transform: translateY(0);
}

.hero {
  padding: clamp(78px, 13vw, 150px) 0 clamp(58px, 9vw, 96px);
}

.section-kicker {
  margin: 0 0 18px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(64px, 14vw, 168px);
  font-weight: 720;
  letter-spacing: 0;
  line-height: 0.9;
}

.hero p:not(.section-kicker) {
  max-width: 640px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: clamp(20px, 3vw, 31px);
  line-height: 1.25;
}

.article-index {
  padding: clamp(78px, 12vw, 140px) 0 clamp(72px, 11vw, 130px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  border-top: 1px solid var(--border);
  padding-top: 26px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.section-heading p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.article-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  padding: clamp(24px, 4vw, 42px);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-border);
  transition-property: box-shadow, transform;
  transition-duration: 160ms;
  transition-timing-function: var(--ease);
}

.article-card:hover {
  box-shadow: var(--shadow-border-hover);
  transform: translateY(-2px);
}

.article-card:active {
  transform: translateY(0) scale(0.996);
}

.article-meta {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.article-card h3 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(31px, 5vw, 58px);
  font-weight: 690;
  letter-spacing: 0;
  line-height: 1;
}

.article-card p:last-child {
  max-width: 610px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.card-arrow {
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
  transition-property: transform;
  transition-duration: 160ms;
  transition-timing-function: var(--ease);
}

.article-card:hover .card-arrow {
  transform: translate(2px, -2px);
}

.quiet-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 15px;
}

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

.site-footer p {
  margin: 0;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
}

.article {
  padding: 42px 0 92px;
}

.back-link {
  display: inline-flex;
  margin-bottom: clamp(44px, 8vw, 80px);
  color: var(--muted);
  font-size: 15px;
}

.back-link:hover {
  color: var(--text);
}

.article-hero {
  display: grid;
  grid-template-columns: minmax(0, var(--article)) auto;
  align-items: end;
  gap: 28px;
}

.article-hero h1 {
  grid-column: 1 / -1;
  max-width: 900px;
  margin: 0;
  font-size: clamp(42px, 8vw, 94px);
  font-weight: 720;
  letter-spacing: 0;
  line-height: 0.98;
}

.share-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 680;
  transition-property: background-color, color, box-shadow, scale;
  transition-duration: 150ms;
  transition-timing-function: var(--ease);
}

.share-button:active,
.button:active {
  scale: 0.96;
}

.share-button {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: end;
  border: 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 0 18px;
  box-shadow: var(--shadow-border);
}

.share-button:hover {
  box-shadow: var(--shadow-border-hover);
}

.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition-property: opacity;
  transition-duration: 180ms;
  transition-timing-function: var(--ease);
}

.share-sheet.is-open {
  opacity: 1;
  pointer-events: auto;
}

.share-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 17, 17, 0.48);
  cursor: default;
}

.share-panel {
  position: relative;
  width: min(528px, calc(100vw - 32px));
  border-radius: 18px;
  background: var(--surface);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 24px 70px rgba(17, 17, 17, 0.24);
  padding: 24px;
  transform: translateY(10px) scale(0.985);
  transition-property: transform;
  transition-duration: 180ms;
  transition-timing-function: var(--ease);
}

.share-panel:focus {
  outline: none;
}

.share-sheet.is-open .share-panel {
  transform: translateY(0) scale(1);
}

.share-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.share-panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.share-close {
  position: relative;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition-property: background-color, scale;
  transition-duration: 150ms;
  transition-timing-function: var(--ease);
}

.share-close:hover {
  background: #f6f6f3;
}

.share-close:active {
  scale: 0.96;
}

.share-close span::before,
.share-close span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 1.5px;
  border-radius: 999px;
  background: var(--text);
}

.share-close span::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.share-close span::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.share-options {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.share-option {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 790;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
  transition-property: filter, scale, transform;
  transition-duration: 150ms;
  transition-timing-function: var(--ease);
}

.share-option:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

.share-option:active {
  scale: 0.96;
  transform: translateY(0);
}

.share-option-threads {
  background: #111111;
}

.share-option-telegram {
  background: #29a8df;
}

.share-option-whatsapp {
  background: #54d66b;
}

.share-option-x {
  background: #000000;
}

.share-option-facebook {
  background: #3f5f9e;
}

.share-option-email {
  background: #a3a3a3;
}

.share-option-copy {
  background: var(--accent);
}

.share-feedback {
  min-height: 18px;
  margin: 16px 0 0;
  color: var(--accent-dark);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(-4px);
  transition-property: opacity, transform;
  transition-duration: 160ms;
  transition-timing-function: var(--ease);
}

.share-feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cover-placeholder {
  height: clamp(280px, 47vw, 540px);
  margin: clamp(44px, 8vw, 80px) 0 clamp(42px, 7vw, 76px);
  border-radius: 18px;
  background:
    linear-gradient(130deg, rgba(14, 165, 164, 0.18), transparent 38%),
    linear-gradient(180deg, #ffffff, #f2f2ee);
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}

.article-body {
  max-width: var(--article);
  margin-inline: auto;
}

.article-body p {
  margin: 0 0 28px;
  color: #27272a;
  font-size: clamp(19px, 2.2vw, 22px);
  line-height: 1.72;
}

.article-body p:first-child::first-letter {
  float: left;
  margin: 10px 12px 0 0;
  color: var(--accent-dark);
  font-size: 74px;
  font-weight: 720;
  line-height: 0.75;
}

.end-block,
.author-block {
  max-width: var(--article);
  margin-inline: auto;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-border);
}

.end-block {
  margin-top: 68px;
  padding: clamp(26px, 5vw, 44px);
}

.end-block h2,
.author-block h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.end-block p,
.author-block p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.button {
  border: 0;
  cursor: pointer;
  padding: 0 18px;
}

.button-primary {
  background: var(--text);
  color: var(--surface);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-border);
}

.button-secondary:hover {
  box-shadow: var(--shadow-border-hover);
}

.author-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 24px;
}

.author-block h2 {
  font-size: 19px;
}

.author-block a {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 680;
  white-space: nowrap;
  transition-property: color, scale;
  transition-duration: 150ms;
  transition-timing-function: var(--ease);
}

.author-block a:active {
  scale: 0.96;
}

.not-found {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 72px);
  padding-block: 70px;
}

.not-found h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(46px, 8vw, 96px);
  line-height: 0.98;
}

.not-found p:not(.section-kicker) {
  max-width: 520px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .shell {
    width: min(calc(100% - 24px), var(--shell));
  }

  .header-shell {
    min-height: 64px;
  }

  .brand {
    font-size: 14px;
  }

  .nav-link,
  .language-button {
    min-height: 40px;
    font-size: 13px;
  }

  .nav-link {
    padding-inline: 10px;
  }

  .language-popover {
    right: -4px;
    width: min(230px, calc(100vw - 24px));
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 12px;
  }

  .article-card {
    grid-template-columns: 1fr;
  }

  .card-arrow {
    font-size: 24px;
  }

  .article-hero {
    display: block;
  }

  .share-button {
    width: max-content;
    margin-top: 24px;
  }

  .share-sheet {
    align-items: end;
    padding: 12px;
  }

  .share-panel {
    width: 100%;
    padding: 22px;
  }

  .share-options {
    gap: 14px;
  }

  .article-body p:first-child::first-letter {
    font-size: inherit;
    float: none;
    margin: 0;
    color: inherit;
    font-weight: inherit;
    line-height: inherit;
  }

  .author-block {
    display: block;
  }

  .author-block a {
    display: inline-flex;
    margin-top: 18px;
  }
}
