:root {
  --paper: #1e1e1e;
  --paper-deep: #181818;
  --ink: #d4d4d4;
  --mute: #9d9d9d;
  --line: #3c3c3c;
  --line-soft: #2b2b2b;
  --card: #252526;
  --card-raised: #2d2d2d;
  --soft: #2a2d2e;
  --add: #89d185;
  --add-bg: rgba(46, 160, 67, 0.15);
  --add-gutter: #2ea043;
  --del: #f48771;
  --del-bg: rgba(248, 81, 73, 0.15);
  --del-gutter: #f85149;
  --meta: #569cd6;
  --editor: #1e1e1e;
  --editor-header: #252526;
  --stamp: #ce9178;
  --stamp-bg: #3b2e26;
  --warn: #dcdcaa;
  --warn-bg: #3b3a1d;
  --focus: #007fd4;
  --accent: #007acc;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 12px 32px -16px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.15), 0 6px 16px -10px rgba(0, 0, 0, 0.45);

  --sans: "DM Sans", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --max: 720px;
  --wide: 960px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(0, 122, 204, 0.08), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(86, 156, 214, 0.06), transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  background-attachment: fixed;
  color-scheme: dark;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
}

a {
  color: var(--ink);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
}

/* header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.85rem max(1.25rem, calc((100% - var(--wide)) / 2));
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.25);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1rem;
}

.brand img {
  display: block;
  border-radius: 7px;
  background: var(--card-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.top nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.top nav a {
  color: var(--mute);
  text-decoration: none;
  transition: color 0.15s ease;
}
.top nav a:hover {
  color: var(--ink);
}
.top nav a.primary {
  color: #fff;
  font-weight: 650;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-sm);
}
.top nav a.primary:hover {
  background: #1c8ad6;
  border-color: #1c8ad6;
}

/* main */
main {
  position: relative;
  z-index: 1;
  max-width: calc(var(--wide) + 2.5rem);
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
}

/* hero */
.hero {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: var(--wide);
  padding: 3.25rem 0 2.25rem;
}

.hero-top {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 2rem;
  align-items: end;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--mute);
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--add);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--add) 22%, transparent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6.5vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  font-optical-sizing: auto;
}

.hero h1 em {
  font-style: italic;
  font-weight: 600;
  color: var(--meta);
}

.lede {
  margin: 0 0 1.5rem;
  color: var(--mute);
  font-size: 1.12rem;
  max-width: 34rem;
  line-height: 1.55;
}

.lede strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-figure {
  margin: 0;
  justify-self: end;
  position: relative;
  width: min(220px, 100%);
}

.hero-nit {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--card-raised);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0.85rem;
  box-shadow: var(--shadow);
  transform: rotate(2.5deg);
}

.stamp {
  position: absolute;
  right: -0.35rem;
  bottom: -0.55rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stamp);
  background: var(--stamp-bg);
  border: 1.5px solid color-mix(in srgb, var(--stamp) 55%, transparent);
  border-radius: 4px;
  transform: rotate(-6deg);
  box-shadow: var(--shadow-sm);
}

/* actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.95rem;
  padding: 0.72rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
  background: #1c8ad6;
  border-color: #1c8ad6;
  transform: translateY(-1px);
}
.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.btn.ghost {
  background: color-mix(in srgb, var(--card-raised) 70%, transparent);
  color: var(--ink);
  border-color: var(--line);
}
.btn.ghost:hover {
  background: var(--card-raised);
  border-color: var(--ink);
}

/* feed */
.feed {
  max-width: var(--wide);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 3.5rem;
}

.feed-head {
  margin-bottom: 0.25rem;
}

.feed-head .eyebrow {
  margin-bottom: 0.55rem;
}

.feed-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
  font-weight: 700;
}

.review {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 1rem 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.review:hover {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.review.featured {
  padding: 1.15rem 1.15rem 1.25rem;
  background: var(--card-raised);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.review-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--mute);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-label .pr {
  color: var(--ink);
  font-weight: 600;
  margin-right: 0.35rem;
}

.badge {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.badge.bad {
  color: var(--del);
  background: var(--del-bg);
  border-color: color-mix(in srgb, var(--del) 22%, transparent);
}
.badge.warn {
  color: var(--warn);
  background: var(--warn-bg);
  border-color: color-mix(in srgb, var(--warn) 22%, transparent);
}

.diff,
.install {
  background: var(--editor);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.diff-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0.75rem;
  background: var(--editor-header);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--mute);
}

.diff-bar .file {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-bar .file::before {
  content: "";
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 2px;
  background: linear-gradient(135deg, #519aba 0 50%, #c5c5c5 50%);
  opacity: 0.85;
}

.diff-bar .stat {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--mute);
}

.copy-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #3c3c3c;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.copy-btn:hover {
  color: #fff;
  background: #505050;
  border-color: #6e6e6e;
}

.copy-btn.copied {
  color: var(--add);
  border-color: var(--add-gutter);
  background: var(--add-bg);
}

.hero .install pre {
  padding: 1.1rem 1.15rem;
}

.hero .install code {
  white-space: nowrap;
}

.diff pre,
.install pre {
  margin: 0;
  padding: 0.35rem 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  tab-size: 2;
  background: var(--editor);
}

.diff code,
.install code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  display: block;
}

.diff .meta,
.install .c {
  display: block;
  padding: 0.05rem 0.75rem 0.05rem 2.4rem;
  color: var(--meta);
  background: rgba(86, 156, 214, 0.08);
}

.install .c {
  color: var(--mute);
  background: none;
  padding: 0 0.95rem;
}

.diff .add,
.diff .del,
.diff .ctx {
  display: block;
  position: relative;
  padding: 0 0.75rem 0 2.4rem;
  white-space: pre;
  color: var(--ink);
}

.diff .add::before,
.diff .del::before,
.diff .ctx::before {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  user-select: none;
  border-right: 1px solid var(--line-soft);
}

.diff .ctx::before {
  content: " ";
  color: transparent;
  background: #1e1e1e;
}

.diff .add {
  background: var(--add-bg);
}

.diff .add::before {
  content: "+";
  color: var(--add);
  background: rgba(46, 160, 67, 0.22);
  border-right-color: rgba(46, 160, 67, 0.35);
  box-shadow: inset 3px 0 0 var(--add-gutter);
}

.diff .del {
  background: var(--del-bg);
}

.diff .del::before {
  content: "−";
  color: var(--del);
  background: rgba(248, 81, 73, 0.22);
  border-right-color: rgba(248, 81, 73, 0.35);
  box-shadow: inset 3px 0 0 var(--del-gutter);
}

.diff .meta {
  position: relative;
}

.diff .meta::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1.85rem;
  border-right: 1px solid var(--line-soft);
  background: rgba(86, 156, 214, 0.08);
}

/* comments */
.comment {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.7rem;
  margin-top: 0.85rem;
  align-items: start;
}

.comment .face {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--card-raised);
  border: 1px solid var(--line);
  padding: 3px;
  box-shadow: var(--shadow-sm);
}

.bubble {
  background: var(--card-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem 0.85rem;
  position: relative;
}

.bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 14px;
  width: 10px;
  height: 10px;
  background: var(--card-raised);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.who {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--mute);
}

.who strong {
  color: var(--ink);
  font-weight: 650;
}

.who span {
  font-weight: 400;
}

.bubble p {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
  line-height: 1.5;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble code {
  background: #264f78;
  color: #9cdcfe;
  padding: 0.08em 0.32em;
  border-radius: 4px;
  font-size: 0.86em;
  border: 1px solid color-mix(in srgb, #569cd6 35%, transparent);
}

.verdict {
  display: inline-block;
  margin-top: 0.55rem !important;
  padding: 0.22rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  color: var(--stamp);
  background: var(--stamp-bg);
  border: 1px dashed color-mix(in srgb, var(--stamp) 45%, transparent);
  border-radius: 4px;
}

/* split how-it-works */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.review.compact {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.review.compact .diff {
  flex: 0 0 auto;
}

.review.compact .comment {
  margin-top: auto;
  padding-top: 0.85rem;
}

.hero .install {
  margin: 0;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.install pre {
  padding: 1rem 1.05rem 1.1rem;
  color: var(--ink);
  background: var(--editor);
}

.install .ok {
  display: block;
  color: var(--add);
  font-weight: 500;
}

/* meet */
.meet {
  max-width: var(--wide);
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  border: 1px dashed var(--line);
  border-radius: 18px;
}

.meet img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  background: var(--card-raised);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.55rem;
  box-shadow: var(--shadow-sm);
}

.meet h2 {
  margin: 0 0 0.45rem;
  font-family: var(--serif);
  font-size: 1.65rem;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.meet p {
  margin: 0;
  color: var(--mute);
  max-width: 36rem;
}

.meet code {
  background: #264f78;
  color: #9cdcfe;
  padding: 0.05em 0.3em;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, #569cd6 35%, transparent);
}

/* footer */
footer {
  max-width: var(--wide);
  margin-top: 2.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--mute);
}

footer img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 5px;
  background: var(--card-raised);
  border: 1px solid var(--line);
}

footer strong {
  color: var(--ink);
}

@media (max-width: 820px) {
  .hero {
    gap: 1.75rem;
    padding-top: 2.25rem;
  }

  .hero-top {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero-figure {
    justify-self: start;
    width: 160px;
  }

  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .top nav a:not(.primary) {
    display: none;
  }

  .hero h1 {
    font-size: clamp(2.15rem, 10vw, 2.6rem);
  }

  .review-head {
    flex-wrap: wrap;
  }

  .meet {
    grid-template-columns: 1fr;
    padding: 1.15rem;
  }

  .meet img {
    width: 112px;
    height: 112px;
  }

  .comment {
    grid-template-columns: 36px 1fr;
  }

  .comment .face {
    width: 36px;
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn {
    transition: none;
  }
  .btn:hover {
    transform: none;
  }
}
