/* DNS for Developers — the one stylesheet (D3). Hand-written, no build.
   Why it looks like this: DESIGN.md. Every value is lifted from the marketing
   site's tailwind.config.js; keep the two in step. */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cabinet Grotesk"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/static/fonts/cabinet-grotesk-700.woff2) format("woff2");
}
@font-face {
  font-family: "Cabinet Grotesk"; font-style: normal; font-weight: 800; font-display: swap;
  src: url(/static/fonts/cabinet-grotesk-800.woff2) format("woff2");
}

:root {
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --blue-800: #1e40af;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-300: #93c5fd;
  --blue-50: #eff6ff;
  --green-700: #15803d;
  --green-50: #f0fdf4;
  --red-700: #b91c1c;
  --red-50: #fef2f2;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Cabinet Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-3xl: 24px;
  --text-4xl: 32px;
  --text-5xl: 56px;
  --leading-sm: 24px;    /* text-sm and text-xs */
  --leading-base: 28px;  /* text-base and text-xl */
  --leading-lg: 32px;    /* text-lg and text-3xl */
  --leading-4xl: 40px;
  --tracking-tight: -0.025em;

  --radius: 6px;
  --radius-2xl: 16px;
  --shadow-sm: 0 2px 6px rgb(15 23 42 / 0.08);
  --measure: 42rem;
  --sidebar: 288px;
  --topbar: 64px;
}

/* ---------- base ---------- */

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

html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--slate-900);
  background: #fff;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.75;
}

h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: var(--tracking-tight); margin: 0; }
h1 { font-size: var(--text-4xl); line-height: var(--leading-4xl); margin-bottom: 16px; }
h2 { font-size: var(--text-3xl); line-height: var(--leading-lg); margin: 1.5em 0 .5em; }
h3 { font-size: var(--text-xl); line-height: var(--leading-base); font-weight: 600; margin: 1.5em 0 .4em; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li { margin: .25em 0; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-800); text-decoration: underline; }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; border-radius: var(--radius); }
hr { border: 0; border-top: 1px solid var(--slate-200); margin: 32px 0; }
code { font-family: var(--font-mono); font-size: .875em; background: var(--slate-50); border: 1px solid var(--slate-200); padding: .1em .35em; border-radius: 4px; }
pre { overflow-x: auto; background: var(--slate-50); border: 1px solid var(--slate-200); padding: 16px 24px; border-radius: var(--radius); line-height: 1.6; }
pre code { background: none; border: 0; padding: 0; font-size: var(--text-sm); }
table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: var(--text-sm); line-height: var(--leading-sm); }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--slate-200); vertical-align: top; }
th { font-weight: 600; }
blockquote { margin: 0 0 1em; padding-left: 16px; border-left: 2px solid var(--slate-300); color: var(--slate-700); }

:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }

.muted { color: var(--slate-500); }
.meta { color: var(--slate-500); font-size: var(--text-sm); line-height: var(--leading-sm); margin: 0 0 8px; }
.lead { font-size: var(--text-lg); line-height: var(--leading-lg); letter-spacing: var(--tracking-tight); color: var(--slate-700); }
.icon { width: 16px; height: 16px; vertical-align: -3px; flex: none; }
.mono { font-family: var(--font-mono); }

/* Pill: the marketing site's SectionHeading. One per page, above the h1. */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 16px; border-radius: 9999px;
  font-family: var(--font-mono); font-size: var(--text-sm); line-height: var(--leading-sm);
  color: var(--blue-600); box-shadow: inset 0 0 0 1px var(--blue-600);
}
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 24px; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--slate-500); }

/* ---------- top bar ---------- */

.topbar {
  height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--slate-200);
  background: #fff;
  font-size: var(--text-sm); line-height: var(--leading-sm);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--slate-900); font-weight: 600; font-size: var(--text-base); letter-spacing: var(--tracking-tight); white-space: nowrap; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.brand:hover { color: var(--slate-900); text-decoration: none; }
.topbar-left, .topbar nav { display: flex; align-items: center; gap: 24px; }
.topbar-left { gap: 8px; }
.topbar nav a { color: var(--slate-700); font-weight: 500; }
.topbar nav a:hover { color: var(--slate-900); text-decoration: none; }
.topbar nav form { margin: 0; }
.toc-toggle { position: absolute; opacity: 0; pointer-events: none; }
.toc-button { display: none; width: 40px; height: 40px; margin-left: -8px; align-items: center; justify-content: center; border-radius: var(--radius); cursor: pointer; color: var(--slate-700); }
.toc-button:hover { background: var(--slate-100); }
.toc-button .icon { width: 20px; height: 20px; }

/* Account menu: a <details> behind the avatar circle; no script. */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; border-radius: 9999px; }
.menu summary::-webkit-details-marker { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 9999px; background: var(--slate-100); border: 1px solid var(--slate-200); color: var(--slate-500); display: inline-flex; align-items: center; justify-content: center; }
.avatar .icon { width: 18px; height: 18px; }
.menu[open] .avatar, .menu summary:hover .avatar { border-color: var(--slate-300); color: var(--slate-700); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; min-width: 12rem;
  padding: 8px; background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.menu-panel .who { padding: 4px 8px 8px; margin: 0 0 4px; border-bottom: 1px solid var(--slate-200); color: var(--slate-500); font-size: var(--text-xs); line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.menu-panel .who strong { display: block; color: var(--slate-900); font-size: var(--text-sm); font-weight: 500; }
.menu-panel a, .menu-panel button.link { display: block; width: 100%; text-align: left; padding: 4px 8px; border-radius: 4px; color: var(--slate-700); font-weight: 400; font-size: var(--text-sm); }
.menu-panel a:hover, .menu-panel button.link:hover { background: var(--slate-100); color: var(--slate-900); text-decoration: none; }

/* ---------- shells ---------- */

.shell { flex: 1; display: flex; align-items: flex-start; }
main { flex: 1; min-width: 0; max-width: calc(var(--measure) + 64px); margin: 0 auto; padding: 40px 32px 64px; }
.plain main { padding-top: 64px; }

footer.site {
  padding: 24px; border-top: 1px solid var(--slate-200);
  font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--slate-600);
}
footer.site a { color: var(--slate-600); }

/* ---------- sidebar ---------- */

.sidebar {
  width: var(--sidebar); flex: none;
  position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
  padding: 24px 16px 40px;
  background: var(--slate-50); border-right: 1px solid var(--slate-200);
  font-size: var(--text-sm); line-height: var(--leading-sm);
}
.sidebar .progress { margin: 0 8px 24px; }
.toc, .toc ol { list-style: none; margin: 0; padding: 0; }
.toc > li { margin: 0 0 20px; }
.toc-label {
  display: flex; align-items: baseline; gap: 12px;
  padding: 0 8px; margin-bottom: 4px;
  font-weight: 500; color: var(--slate-900);
}
.toc-label .num { font-family: var(--font-mono); color: var(--blue-600); }
.toc ol li { margin: 0; }
.toc ol a {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 4px 8px; border-radius: var(--radius);
  color: var(--slate-700);
}
.toc ol a:hover { background: var(--slate-200); color: var(--slate-900); text-decoration: none; }
.toc .mark { width: 16px; height: 16px; flex: none; margin-top: 4px; color: var(--slate-300); display: inline-flex; }
.toc .mark svg { width: 16px; height: 16px; }
.toc .done .mark { color: var(--green-700); }
.toc .locked .mark, .toc .locked a { color: var(--slate-500); }
.toc .current a { background: var(--blue-50); color: var(--blue-600); font-weight: 500; }
.toc .current .mark { color: var(--blue-600); }
.toc .current.done .mark { color: var(--green-700); }

/* ---------- progress ---------- */

.progress { display: flex; align-items: center; gap: 12px; color: var(--slate-500); font-size: var(--text-sm); line-height: var(--leading-sm); }
.progress .track { flex: 1; height: 6px; border-radius: 3px; background: var(--slate-200); overflow: hidden; }
.progress .fill { height: 100%; background: var(--blue-600); border-radius: 3px; }
.progress .count { white-space: nowrap; font-family: var(--font-mono); }

/* ---------- controls ---------- */

.stack { display: flex; flex-direction: column; gap: 16px; max-width: 28rem; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
label .muted, label .hint { font-weight: 400; font-size: var(--text-sm); color: var(--slate-500); }
input[type="text"], input[type="email"] {
  font: inherit; height: 40px; padding: 0 12px;
  border: 1px solid var(--slate-300); border-radius: var(--radius); background: #fff; color: var(--slate-900);
}
input:disabled { color: var(--slate-500); background: var(--slate-50); }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; letter-spacing: var(--tracking-tight); line-height: var(--leading-base);
  cursor: pointer; text-decoration: none; text-align: center;
  padding: 4px 16px; border-radius: var(--radius);
  border: 1px solid var(--blue-600); background: var(--blue-600); color: #fff;
  box-shadow: var(--shadow-sm);
  transition: background-color 120ms, border-color 120ms, color 120ms;
}
button:hover, .button:hover { background: var(--blue-500); border-color: var(--blue-500); color: #fff; text-decoration: none; }
button:active, .button:active { background: var(--blue-700); border-color: var(--blue-700); }
button.secondary, .button.secondary { background: #fff; border-color: var(--slate-200); color: var(--slate-900); box-shadow: none; }
button.secondary:hover, .button.secondary:hover { background: var(--slate-50); border-color: var(--slate-300); color: var(--slate-900); }
button.link { padding: 0; border: 0; background: none; box-shadow: none; color: var(--slate-700); font-weight: 500; letter-spacing: 0; line-height: var(--leading-sm); font-size: var(--text-sm); }
button.link:hover { background: none; color: var(--slate-900); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0 0; }
.actions form { margin: 0; }

.notice {
  padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--slate-200);
  background: var(--slate-50); color: var(--slate-700); font-size: var(--text-sm); line-height: var(--leading-sm); margin: 0 0 16px;
}
.notice.error { color: var(--red-700); border-color: var(--red-700); background: var(--red-50); }
.notice.info { color: var(--blue-600); border-color: var(--blue-300); background: var(--blue-50); }
.notice.ok { color: var(--green-700); border-color: var(--green-700); background: var(--green-50); }
.notice a { color: inherit; text-decoration: underline; }

/* ---------- course home ---------- */

.continue {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px;
  padding: 24px; border-radius: var(--radius-2xl); background: var(--slate-50); margin: 0 0 32px;
}
.continue .progress { flex: 1; min-width: 12rem; }
.listbox { list-style: none; margin: 0 0 24px; padding: 12px 24px; border-radius: var(--radius-2xl); background: var(--slate-50); }
.listbox li { display: flex; align-items: center; gap: 16px; margin: 0; padding: 12px 0; border-top: 1px solid var(--slate-200); }
.listbox li:first-child { border-top: 0; }
.listbox .num { font-family: var(--font-mono); color: var(--slate-400); font-size: var(--text-sm); width: 2ch; }
.listbox .title { flex: 1; font-weight: 500; color: var(--slate-900); }
.listbox .title:hover { color: var(--blue-600); text-decoration: none; }
.listbox .count { font-family: var(--font-mono); color: var(--slate-400); font-size: var(--text-sm); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.listbox .count.done { color: var(--green-700); }
.paywall { padding: 24px; border-radius: var(--radius-2xl); background: var(--slate-50); margin: 0 0 32px; }
.paywall h1 { margin-bottom: 8px; }
.paywall .button { margin: 8px 0 16px; }
.paywall p:last-child { margin-bottom: 0; }

/* ---------- lesson ---------- */

.player { position: relative; padding-top: 56.25%; margin: 0 0 32px; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.content { overflow-wrap: anywhere; }
.content img { display: block; margin: 24px 0; box-shadow: var(--shadow-sm); border: 1px solid var(--slate-200); }
.completion { display: inline-flex; align-items: center; gap: 6px; color: var(--green-700); }
.lesson-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--slate-200);
}
.lesson-nav .prev { color: var(--slate-700); font-weight: 500; }
.lesson-nav .prev:hover { color: var(--slate-900); }
.lesson-nav form { margin: 0; margin-left: auto; }

/* ---------- quiz / exam ---------- */

.question { margin: 0 0 16px; padding: 16px 24px; border: 0; border-radius: var(--radius-2xl); background: var(--slate-50); }
.question legend, .question h3 { font-weight: 600; margin: 0 0 8px; padding: 0; font-size: var(--text-base); line-height: var(--leading-base); float: left; width: 100%; }
.question legend + label, .question h3 + ul { clear: both; }
.question label {
  flex-direction: row; align-items: center; gap: 12px; font-weight: 400;
  min-height: 44px; padding: 0 12px; margin: 0 -12px; border-radius: var(--radius); cursor: pointer;
}
.question label:hover { background: var(--slate-200); }
.question input { margin: 0; width: 16px; height: 16px; accent-color: var(--blue-600); }
.answers { list-style: none; padding: 0; margin: 0; }
.answers li { display: flex; align-items: center; gap: 12px; min-height: 40px; margin: 0; padding: 4px 12px; border-radius: var(--radius); }
.answers .tag { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-sm); white-space: nowrap; }
.answers .correct { color: var(--green-700); background: var(--green-50); }
.answers .incorrect { color: var(--red-700); background: var(--red-50); }
.answers .icon { color: var(--slate-300); }
.answers .correct .icon { color: var(--green-700); }
.answers .incorrect .icon { color: var(--red-700); }
.score { font-family: var(--font-display); font-size: var(--text-3xl); line-height: var(--leading-lg); font-weight: 700; letter-spacing: var(--tracking-tight); margin: 0 0 16px; }
.score.pass { color: var(--green-700); }
.score.fail { color: var(--red-700); }

/* ---------- certificate ---------- */

.certificate {
  position: relative; overflow: hidden;
  padding: 64px 40px; text-align: center; margin: 0 0 24px;
  border-radius: var(--radius-2xl); background: var(--slate-50);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cpath d='M0 128V.5H128' fill='none' stroke='rgb(15 23 42 / 0.1)'/%3E%3C/svg%3E");
}
.certificate p { margin: 0 0 8px; }
.certificate .pill { margin-bottom: 32px; background: #fff; }
.certificate .course { font-family: var(--font-display); font-size: var(--text-3xl); line-height: var(--leading-lg); font-weight: 700; letter-spacing: var(--tracking-tight); }
.certificate .name { font-family: var(--font-display); font-size: var(--text-5xl); font-weight: 800; line-height: 1; letter-spacing: var(--tracking-tight); margin: 24px 0; }
.certificate .lead { margin-bottom: 0; }
.certificate .id { color: var(--slate-500); font-size: var(--text-xs); line-height: 16px; margin-top: 40px; }
.certificate .id a { color: var(--slate-500); }

/* ---------- responsive ---------- */

/* Large screens (DESIGN.md §3): bigger type, wider measure, roomier sidebar. */
@media (min-width: 90rem) {
  :root {
    --text-xs: 13px; --text-sm: 15px; --text-base: 18px; --text-lg: 20px; --text-xl: 22px;
    --text-3xl: 27px; --text-4xl: 36px; --text-5xl: 64px;
    --leading-sm: 26px; --leading-base: 31px; --leading-lg: 36px; --leading-4xl: 44px;
    --measure: 47rem; --sidebar: 344px; --topbar: 72px;
  }
  .sidebar { padding: 32px 20px 48px; }
  main { padding: 48px 40px 80px; }
}

@media (max-width: 40rem) {
  .brand span { display: none; }
}

@media (max-width: 60rem) {
  .topbar { padding: 0 16px; }
  .topbar nav { gap: 16px; }
  .toc-button { display: inline-flex; }
  .shell { flex-direction: column; }
  .sidebar { display: none; width: 100%; position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--slate-200); }
  .toc-toggle:checked ~ .shell .sidebar { display: block; }
  main { max-width: none; padding: 24px 16px 48px; }
  .plain main { padding-top: 32px; }
  h1 { font-size: 28px; line-height: 36px; }
  .lesson-nav { flex-direction: column; align-items: stretch; }
  .lesson-nav form { margin-left: 0; }
  .lesson-nav form button { width: 100%; }
  .certificate { padding: 40px 16px; }
  .certificate .name { font-size: var(--text-4xl); }
}

/* ---------- print ---------- */

@media print {
  .topbar, footer.site, .sidebar, nav, .no-print { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .certificate { margin: 0; page-break-inside: avoid; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
