/* Modern apps on old systems · BertoProject
   Tokens follow bertoproject.com (Apple-like light grey + near-black, system type). One accent: --accent. */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --accent: #0a66c2;
  --accent-ink: #ffffff;
  --ok: #1f7a3d;
  --warn: #9a5b00;
  --bad: #b3261e;
  --code-bg: #1d1d1f;
  --code-ink: #f5f5f7;
  --code-dim: #a1a1a6;
  --radius: 14px;
  --radius-lg: 22px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --surface: #1c1c1e;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --line: #3a3a3c;
    --accent: #4d9bff;
    --accent-ink: #0b1220;
    --ok: #57c27a;
    --warn: #e0a73a;
    --bad: #ff7a70;
    --code-bg: #000000;
  }
}

html, body { background: var(--bg); color: var(--ink); }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; font: 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
code, pre, kbd { font-family: var(--mono); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; z-index: 30; }
.skip:focus { left: 12px; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.bar__in { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { border-radius: 7px; }
.bar nav { display: flex; gap: 22px; font-size: 15px; }
.bar nav a { color: var(--ink); text-decoration: none; opacity: .82; white-space: nowrap; }
.bar nav a:hover { opacity: 1; }
.bar nav .lang { font-weight: 600; }
@media (max-width: 720px) {
  .brand span { display: none; }
  .bar nav { gap: 16px; font-size: 14px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 8px 0 22px; border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap; transition: transform .25s var(--ease), background-color .25s var(--ease); }
.btn:active { transform: scale(0.98); }
.btn__ico { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; transition: transform .35s var(--ease); }
.btn:hover .btn__ico { transform: translate(2px, -1px); }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary .btn__ico { background: color-mix(in srgb, var(--bg) 18%, transparent); }
.btn--ghost { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); padding-right: 22px; }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }

/* Landing */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.hero { min-height: calc(100dvh - 60px); display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; padding: 56px 0 72px; }
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.25rem); line-height: 1.03; letter-spacing: -0.035em; margin: 0 0 22px; font-weight: 700; text-wrap: balance; }
.hero__sub { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 34ch; margin: 0 0 34px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* Signature: the real error turning into the working version */
.shell { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius-lg); padding: 6px; box-shadow: 0 30px 80px -30px rgba(29, 29, 31, .45); }
.shell__in { border-radius: calc(var(--radius-lg) - 6px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); padding: 22px 22px 26px; font: 13.5px/1.65 var(--mono); overflow: hidden; }
.shell__head { display: flex; justify-content: space-between; color: var(--code-dim); font-size: 12px; margin-bottom: 16px; }
.shell p { margin: 0; }
.shell .cmd { color: #f5f5f7; }
.shell .cmd::before { content: "$ "; color: var(--code-dim); }
.shell .err { color: #ff8f86; word-break: break-all; }
.shell .dim { color: var(--code-dim); word-break: break-all; }
.shell .okline { color: #7ee0a1; }
.shell .gap { height: 14px; }
.shell .fix { margin-top: 18px; padding-top: 16px; border-top: 1px dashed rgba(255,255,255,.16); }
.shell .err-block { position: relative; }
.shell .strike { position: absolute; left: 0; top: 50%; height: 2px; width: 100%; background: #ff8f86; transform-origin: left; transform: scaleX(0); }

/* Sections */
.sec { padding: 104px 0; border-top: 1px solid var(--line); }
.sec h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 14px; max-width: 22ch; text-wrap: balance; }
.sec__lead { color: var(--muted); font-size: 1.15rem; max-width: 60ch; margin: 0 0 48px; }

/* Apps: two groups, real rows */
.apps { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; align-items: start; }
.group { background: var(--surface); border-radius: var(--radius-lg); padding: 8px; box-shadow: 0 1px 0 var(--line); }
.group__title { font-size: 15px; font-weight: 600; color: var(--muted); margin: 14px 18px 6px; }
.app { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: background-color .25s var(--ease); }
.app:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.app i { font-size: 24px; color: var(--muted); }
.app strong { display: block; font-size: 17px; letter-spacing: -0.01em; }
.app span { display: block; color: var(--muted); font-size: 14.5px; }
.app em { font-style: normal; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.st-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.st-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.st-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.apps__grid { display: grid; grid-template-columns: 1fr 1fr; }
.side { display: grid; gap: 28px; }

/* Errors people search for */
.errs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.errs a { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 18px 22px; border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: 0 1px 0 var(--line); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.errs a:hover { transform: translateX(4px); box-shadow: inset 3px 0 0 var(--accent), 0 1px 0 var(--line); }
.errs code { font-size: 14px; color: var(--bad); word-break: break-word; }
.errs span { font-size: 14.5px; color: var(--muted); white-space: nowrap; }

/* Method: a real sequence */
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.steps li { list-style: none; padding: 0 22px 0 0; position: relative; }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; margin-bottom: 18px; }
.steps h3 { font-size: 18px; margin: 0 0 8px; letter-spacing: -0.01em; }
.steps p { margin: 0; color: var(--muted); font-size: 15.5px; }
.steps code { font-size: 13.5px; }

/* Bands */
.band { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.band > div { border-radius: var(--radius-lg); padding: 40px; }
.band__ai { background: var(--code-bg); color: var(--code-ink); }
.band__ai p { color: var(--code-dim); }
.band__ai a { color: #8ec5ff; }
.band__edu { background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.band h3 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 12px; line-height: 1.15; }
.band p { margin: 0 0 22px; max-width: 46ch; }

/* Footer */
.foot { border-top: 1px solid var(--line); margin-top: 40px; }
.foot__in { max-width: 1180px; margin: 0 auto; padding: 48px 24px 56px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px 48px; }
.foot__name { font-weight: 700; font-size: 18px; margin: 0 0 6px; }
.foot__who p { color: var(--muted); margin: 0; max-width: 40ch; }
.foot__social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-content: start; }
.foot__social a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 0 var(--line); color: var(--ink); text-decoration: none; font-size: 15px; }
.foot__social a:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.foot__legal { grid-column: 1 / -1; color: var(--muted); font-size: 14px; margin: 8px 0 0; }

/* Guide pages (rendered Markdown) */
.doc { max-width: 860px; margin: 0 auto; padding: 32px 24px 40px; }
.doc__src { font-size: 14.5px; margin: 0 0 8px; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.08; letter-spacing: -0.03em; margin: 18px 0 20px; text-wrap: balance; }
.doc h2 { font-size: 1.65rem; letter-spacing: -0.02em; margin: 56px 0 14px; padding-top: 8px; }
.doc h3 { font-size: 1.25rem; margin: 36px 0 10px; }
.doc h4, .doc h5 { font-size: 1.05rem; margin: 28px 0 8px; }
.doc p, .doc li { max-width: 72ch; }
.doc li + li { margin-top: 6px; }
.doc blockquote { margin: 24px 0; padding: 16px 22px; background: var(--surface); border-radius: var(--radius); box-shadow: inset 3px 0 0 var(--accent); }
.doc blockquote p { margin: 0; }
.doc :not(pre) > code { font-size: .86em; background: color-mix(in srgb, var(--ink) 7%, transparent); padding: .12em .4em; border-radius: 6px; word-break: break-word; }
.doc pre { background: var(--code-bg); color: var(--code-ink); padding: 18px 20px; border-radius: var(--radius); overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.doc pre code { background: none; padding: 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0 28px; font-size: 15px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; color: var(--muted); }
.doc img[src*="shields.io"] { display: inline; margin: 2px 2px 0 0; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 40px 0 64px; gap: 40px; }
  .apps, .band { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .foot__in { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sec { padding: 72px 0; }
  .apps__grid { grid-template-columns: 1fr; }
  .errs a { grid-template-columns: 1fr; gap: 6px; }
  .band > div { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
