:root {
  color-scheme: dark;
  --page: #0c1020;
  --panel: #171c32;
  --ink: #f5f5fe;
  --muted: #b9bfd9;
  --mint: #8af9cb;
  --lavender: #ccbbff;
  --line: #333958;
  font-family: Inter, "Instrument Sans", system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 90% 36%, #272055 0, transparent 40%),
    radial-gradient(ellipse at 0 48%, #1b1b40 0, transparent 28%),
    var(--page);
}
a { color: inherit; text-underline-offset: .22em; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 5px; }
p { line-height: 1.65; }
h1, h2, p { margin-block-start: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
.shell { width: min(1320px, calc(100% - 72px)); margin-inline: auto; }

.top, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 24px;
}
.top { border-bottom: 1px solid var(--line); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark { display: flex; align-items: end; gap: 3px; direction: ltr; }
.brand-mark i { width: .22em; height: .4em; background: var(--mint); border-radius: 4px; }
.brand-mark i:nth-child(2) { height: .64em; }
.brand-mark i:nth-child(3) { height: .88em; }
.top nav { display: flex; align-items: center; gap: clamp(14px, 4vw, 44px); }
.top nav > a { text-decoration: none; }
.top nav > a:hover, .footer a:hover, .blog-preview h2 a:hover { color: var(--mint); }
.languages { position: relative; }
.languages summary { cursor: pointer; }
.language-list {
  position: absolute;
  inset-block-start: 100%;
  inset-inline-end: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  width: min(32rem, calc(100vw - 32px));
  max-height: min(32rem, 70dvh);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  margin: 12px 0 0;
  padding: 8px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px #070914b3;
}
.language-list a {
  display: flex;
  align-items: center;
  min-height: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.language-list a:focus-visible { outline-offset: -2px; }
.language-list a:hover, .language-list a[aria-current] { background: var(--mint); color: var(--page); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 62px);
  padding-block: clamp(45px, 7vw, 100px);
}
.eyebrow { color: var(--lavender); font-size: .83rem; font-weight: 720; letter-spacing: .035em; }
h1 {
  margin-bottom: 24px;
  font-size: clamp(2.65rem, 5vw, 5.2rem);
  line-height: 1.02;
  text-wrap: balance;
}
.hero h1 span { display: block; color: var(--mint); }
html[dir=rtl] h1 { line-height: 1.2; }
.lead { max-width: 46ch; color: var(--muted); font-size: clamp(1rem, 1.65vw, 1.19rem); }
.button {
  display: inline-block;
  padding: 14px 23px;
  border-radius: 14px;
  background: var(--mint);
  color: #071b19;
  font-weight: 800;
  text-decoration: none;
}
.button:hover { background: #b5ffdf; }
.button span { margin-inline-start: .4em; }
.note { margin-block: 13px 0; color: var(--muted); font-size: .82rem; }

.visual { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 14px; }
.preview {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(13px, 1.6vw, 23px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(155deg, #20253e, #151a30 78%);
  box-shadow: 0 26px 48px #080a1d70;
  font-variant-numeric: tabular-nums;
}
.panel-title { margin-bottom: 10px; color: var(--muted); font-size: .85rem; font-weight: 750; overflow-wrap: anywhere; }
.ring {
  display: grid;
  place-items: center;
  width: min(100%, 166px);
  aspect-ratio: 1;
  margin: 10px auto 18px;
  padding: 8px;
  border-radius: 50%;
  background: conic-gradient(var(--mint) 78%, #39395d 0);
}
.ring > div {
  display: grid;
  width: 100%;
  height: 100%;
  place-content: center;
  border-radius: 50%;
  text-align: center;
  background: #191e35;
}
.ring strong, .weight-value strong { font-size: clamp(1.7rem, 3.5vw, 2.7rem); line-height: 1.1; }
.ring small, .weight-value small { color: var(--muted); font-size: .74rem; }
.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: auto; font-size: clamp(.58rem, 1.25vw, .86rem); }
.macros span { white-space: nowrap; }
.macros i { display: block; height: 5px; margin-top: 7px; border-radius: 4px; background: #383d5f; }
.macros i::before { content: ""; display: block; width: var(--fill); height: 100%; border-radius: inherit; background: var(--mint); }
.macros div:nth-child(2) i::before { background: var(--lavender); }
.macros div:nth-child(3) i::before { background: #a9b7ff; }
.weight-value { align-self: start; }
.chart {
  position: relative;
  height: clamp(78px, 11vw, 148px);
  margin: auto 0 8px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, transparent 0 calc(25% - 1px), #383957 0 25%);
}
.chart::before, .chart::after { content: ""; position: absolute; inset: 0; }
.chart::before {
  background: linear-gradient(#aa8aff73, #aa8aff13);
  clip-path: polygon(0 21%, 17% 34%, 34% 31%, 50% 50%, 67% 58%, 83% 56%, 100% 74%, 100% 100%, 0 100%);
}
.chart::after {
  background: var(--lavender);
  clip-path: polygon(0 20%, 17% 33%, 34% 30%, 50% 49%, 67% 57%, 83% 55%, 100% 73%, 100% 76%, 83% 58%, 67% 60%, 50% 52%, 34% 33%, 17% 36%, 0 23%);
}

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 5vw, 76px);
  padding-block: 28px;
  border-block: 1px solid var(--line);
}
.features > div { padding-inline-start: 16px; border-inline-start: 3px solid var(--mint); }
.features > div:nth-child(2) { border-color: var(--lavender); }
.features h2, .reading h2 { font-size: clamp(1.25rem, 2.55vw, 1.85rem); line-height: 1.18; }
.features h2 { margin-bottom: 7px; }
.features p, .footer { color: var(--muted); }
.features p { margin-bottom: 0; }
.blog-preview { margin-block: clamp(38px, 5vw, 72px); }
.blog-preview > h2 a { text-decoration: none; }
.blog-preview > h2 span, .post-arrow { color: var(--lavender); }
.post-card {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(13px, 2.5vw, 30px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--panel);
  text-decoration: none;
}
.post-card:hover { border-color: var(--lavender); }
.post-card img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; object-fit: cover; border-radius: 12px; }
.post-card p { margin-bottom: 0; color: var(--muted); }
.post-card h2 { margin-block: 4px 6px; font-size: clamp(1.23rem, 2.7vw, 1.85rem); line-height: 1.14; }
.post-arrow { padding-inline-end: 7px; font-size: 1.3rem; }
.blog-index { max-width: 1040px; min-height: 48vh; }
.footer { border-top: 1px solid var(--line); font-size: .9rem; }

.reading { width: min(760px, 100%); margin: clamp(42px, 7vw, 85px) auto; }
.reading h1 { font-size: clamp(2.25rem, 6vw, 4.25rem); }
.reading h2 { margin-block: 42px 14px; }
.reading h3 { margin-block: 28px 8px; }
.reading p, .reading li { color: #dce0f4; line-height: 1.7; }
.reading li { margin-block: 10px; }
.reading a:not(.button) { color: var(--lavender); }
.article-cover { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 18px; margin-bottom: 24px; }
.contents, .callout { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.contents a { display: block; padding-block: 5px; }
.callout { margin-top: 36px; }
.callout h2 { margin-top: 0; }

@media (max-width: 930px) {
  .shell { width: calc(100% - 40px); }
  .hero { grid-template-columns: 1fr; }
  .visual { max-width: 620px; }
}
@media (max-width: 540px) {
  .shell { width: calc(100% - 32px); }
  .top, .footer { gap: 10px; padding-block: 18px; }
  .hero { padding-block: 38px; }
  .features { grid-template-columns: 1fr; gap: 22px; }
  .post-card { grid-template-columns: minmax(0, 1fr) auto; }
  .post-card img { grid-column: 1 / -1; }
}
@media (max-width: 360px) {
  .visual { gap: 8px; }
  .preview { padding: 10px; }
  .macros { gap: 3px; }
  .macros span { white-space: normal; }
}
