/* ============================================================
   learndesign.tech — one stylesheet, light theme, typography first
   ============================================================ */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c1b19;
  --ink-2: #55524c;
  --ink-3: #8a867e;
  --line: #e7e3db;
  --line-2: #d9d4ca;
  --accent: #b8441c;
  --accent-ink: #8f3313;
  --accent-soft: #fbeee7;
  --chip: #f1eee8;
  --chip-on: #1c1b19;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 66ch;
  --wide: 1120px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 27, 25, .04), 0 8px 24px -12px rgba(28, 27, 25, .12);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: clamp(16px, 0.95rem + 0.25vw, 18px); -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "kern";
}
h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }
img, svg, video { max-width: 100%; height: auto; display: block; }
code, pre, kbd { font-family: var(--mono); font-size: 0.92em; }
.wrap { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.main { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(3rem, 8vw, 6rem); }
.muted { color: var(--ink-3); }
.meta { color: var(--ink-3); font-size: 0.9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: var(--measure); text-wrap: pretty; }
.kicker { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: #fff; padding: 0.5rem 0.8rem; border-radius: 6px; z-index: 100; }
.skip:focus { top: 0.5rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__in { display: flex; align-items: center; gap: 1rem; min-height: 3.25rem; padding-block: 0.4rem; flex-wrap: wrap; }
.topbar__brand { font-weight: 700; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; font-size: 1.02rem; }
.topbar__brand span { color: var(--ink-3); font-weight: 500; }
.crumbs { flex: 1 1 12rem; min-width: 0; display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; color: var(--ink-2); }
.crumbs a { text-decoration: none; white-space: nowrap; }
.crumbs a:hover { text-decoration: underline; }
.crumbs__sep { color: var(--line-2); }
.crumbs__here { color: var(--ink); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__search {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-left: auto;
  padding: 0.35rem 0.7rem; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 0.88rem; font-weight: 500; text-decoration: none; background: var(--surface);
}
.topbar__search:hover { border-color: var(--ink-3); }
@media (max-width: 640px) {
  .topbar__in { gap: 0.25rem 0.75rem; padding-block: 0.5rem 0.45rem; }
  .crumbs { order: 3; flex-basis: 100%; font-size: 0.85rem; }
  .crumbs:empty { display: none; }
  .topbar__search span { display: none; }
  .topbar__search { padding: 0.45rem; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 1.5rem 2.5rem; color: var(--ink-3); font-size: 0.88rem; }
.footer__in { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- Chips ---------- */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.28rem 0.7rem; border-radius: 999px; background: var(--chip);
  font-size: 0.82rem; font-weight: 500; text-decoration: none; color: var(--ink-2);
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { color: var(--ink); border-color: var(--line-2); }
.chip[aria-pressed="true"] { background: var(--chip-on); color: #fff; }
.chip__count { font-size: 0.72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .chip__count { color: rgba(255,255,255,.7); }
.chips--small .chip { font-size: 0.75rem; padding: 0.2rem 0.55rem; }
.chips--toggle .chip { padding: 0.45rem 0.9rem; font-size: 0.9rem; }
.pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.8rem; font-weight: 600; }
.pill--quiet { background: var(--chip); color: var(--ink-2); font-weight: 500; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1.25rem; }
.card { display: flex; flex-direction: column; gap: 0.75rem; }
.card__link { display: block; text-decoration: none; border-radius: var(--radius); }
.card__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); background: var(--chip); border: 1px solid var(--line); }
.card__img--empty { background: linear-gradient(135deg, var(--chip), var(--surface)); }
.card__body { padding-top: 0.8rem; display: grid; gap: 0.35rem; }
.card__kicker { font-size: 0.78rem; color: var(--ink-3); }
.card__title { font-size: 1.12rem; line-height: 1.25; }
.card__link:hover .card__title { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 0.18em; }
.card__summary { color: var(--ink-2); font-size: 0.95rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Front page ---------- */
.intro { padding-block: clamp(1rem, 4vw, 3rem) clamp(2rem, 5vw, 4rem); display: grid; gap: 1rem; }
.intro__title { max-width: 16ch; }
.intro__text { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-head__links { display: flex; gap: 1.25rem; font-size: 0.9rem; }
.section-head__links a { color: var(--ink-2); text-decoration: none; }
.section-head__links a:hover { text-decoration: underline; }
.recent { padding-bottom: clamp(2.5rem, 6vw, 5rem); }
.search { padding-top: clamp(2rem, 5vw, 3.5rem); border-top: 1px solid var(--line); }
.search__form { margin-bottom: 1rem; }
.search__input {
  width: 100%; max-width: 40rem; padding: 0.8rem 1rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
}
.search__input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.search__status { margin-block: 1.25rem 1rem; font-size: 0.92rem; }

/* ---------- Listings ---------- */
.listing__head { display: grid; gap: 0.75rem; margin-bottom: 2rem; max-width: var(--measure); }
.taglist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.taglist__item { display: grid; grid-template-columns: 1fr auto; column-gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.taglist__name { font-weight: 600; font-size: 1.1rem; text-decoration: none; }
.taglist__name:hover { text-decoration: underline; }
.taglist__count { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.taglist__blurb { grid-column: 1 / -1; color: var(--ink-2); font-size: 0.95rem; margin-top: 0.2rem; max-width: var(--measure); }

/* ---------- Article (post) ---------- */
.post, .dp, .page { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.post__head, .dp__head { display: grid; gap: 1rem; max-width: var(--measure); margin-bottom: 2.5rem; }
.post--wide .post__head { max-width: none; }
.post__title, .dp__title { max-width: 22ch; }
.hero { margin: 0.5rem 0 0; }
.hero img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.post__head .hero, .dp__head .hero { max-width: none; }
.prose { max-width: var(--measure); }
.post--wide .prose, .page--wide { max-width: none; }
.post__foot { margin-top: 3.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.92rem; max-width: var(--measure); }

/* ---------- Prose ---------- */
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.4em; }
.prose h3 { margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose p, .prose li { text-wrap: pretty; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose li > ul, .prose li > ol { margin-top: 0.35em; }
.prose a { text-decoration-color: var(--line-2); }
.prose a:hover { text-decoration-color: var(--accent); color: var(--accent-ink); }
.prose blockquote { margin: 1.5em 0; padding: 0.2em 0 0.2em 1.2em; border-left: 3px solid var(--line-2); color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose code { background: var(--chip); padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre { background: #1c1b19; color: #f3efe8; padding: 1rem 1.2rem; border-radius: var(--radius); overflow-x: auto; line-height: 1.5; }
.prose pre code { background: none; padding: 0; }
.prose figure { margin: 1.8em 0; }
.prose figure img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose figcaption { margin-top: 0.6em; font-size: 0.88rem; color: var(--ink-3); }
.prose .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; min-width: 36rem; border-collapse: collapse; font-size: 0.93rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.6em 0.8em; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; border-bottom-color: var(--line-2); }
.prose img { border-radius: var(--radius); }
.video { position: relative; aspect-ratio: 16 / 9; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.callout { padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--chip); border-left: 3px solid var(--line-2); }
.callout--warning { background: var(--accent-soft); border-left-color: var(--accent); }
.callout--tip { background: #eef4ec; border-left-color: #5c8a52; }
.callout__title { display: block; margin-bottom: 0.3em; }
.callout > p + p { margin-top: 0.6em; }

/* ---------- About ---------- */
.about { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.about__head { display: grid; gap: 0.75rem; max-width: var(--measure); margin-bottom: 2rem; }
.about__hero { margin: 0 0 2.5rem; }
.about__hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.about__body { max-width: var(--measure); }
.about__sandy { margin: 1.8em 0; }
.about__sandy img { width: 100%; max-width: 22rem; border-radius: var(--radius); border: 1px solid var(--line); }
@media (min-width: 900px) {
  .about__body { max-width: none; display: grid; grid-template-columns: minmax(0, var(--measure)) 18rem; column-gap: 3rem; }
  .about__body > * { grid-column: 1; }
  .about__body .about__sandy { grid-column: 2; grid-row: 1 / span 6; margin: 0.3em 0 0; align-self: start; }
}
.about__quote { margin: 3rem 0 1rem; padding: 0; border: 0; color: var(--ink); font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; max-width: 30ch; text-wrap: balance; }
.about__quote p::before { content: "\201C"; } .about__quote p::after { content: "\201D"; }

/* ---------- Design Projects ---------- */
.dp__sections { display: grid; gap: 2.5rem; }
.dp__sec, .dp__body > *, .card, .prose { min-width: 0; }
.dp__sec h2 { margin: 0 0 0.8rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.dp__sec--side { align-self: start; }
.dp__sec--side h2 { font-size: 1.05rem; border-bottom: 0; padding-bottom: 0; margin-bottom: 0.6rem; letter-spacing: 0; }
.dp__sec--side ul { list-style: none; margin: 0; padding: 0; }
.skills .skill { display: grid; gap: 0.15rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.skills .skill:last-child { border-bottom: 1px solid var(--line); }
.skill__name { font-weight: 500; }
.skill__ext { margin-left: 0.3em; color: var(--ink-3); font-size: 0.85em; }
.skill__soon { font-size: 0.78rem; color: var(--ink-3); font-style: italic; }
.skill__note { font-size: 0.88rem; color: var(--ink-2); }
.checklist li { position: relative; padding: 0.35rem 0 0.35rem 1.7rem; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 0.65rem; width: 0.95rem; height: 0.95rem; border: 1.5px solid var(--line-2); border-radius: 4px; background: var(--surface); }
.plain li { padding: 0.35rem 0; border-top: 1px solid var(--line); }
.plain li:last-child { border-bottom: 1px solid var(--line); }
/* Steps: ordered lists get large numerals; ### sub-headings become numbered phases */
.dp__steps { counter-reset: phase; }
.dp__steps > ol { list-style: none; padding: 0; counter-reset: step; }
.dp__steps > ol > li { position: relative; padding-left: 3rem; margin-top: 1.1em; min-height: 2.2rem; }
.dp__steps > ol > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -0.1rem; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 600; font-size: 0.9rem;
}
.dp__steps h3 { display: flex; align-items: center; gap: 0.7rem; margin-top: 2.2em; }
.dp__steps h3::before {
  counter-increment: phase; content: counter(phase);
  flex: none; width: 1.9rem; height: 1.9rem; border-radius: 6px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 0.85rem; font-weight: 700; letter-spacing: 0;
}
/* Small: a compact two-column layout on wide screens, canonical order kept in the DOM */
@media (min-width: 900px) {
  .dp--small .dp__sections { grid-template-columns: minmax(0, 1fr) 17rem; column-gap: 3.5rem; grid-auto-flow: row dense; }
  .dp--small .dp__sec--main { grid-column: 1; }
  .dp--small .dp__sec--side { grid-column: 2; }
}
/* Large: sticky section nav in a left gutter */
.dp__nav { display: none; }
@media (min-width: 1000px) {
  .dp--large .dp__body { display: grid; grid-template-columns: 13rem minmax(0, 1fr); column-gap: 3rem; align-items: start; }
  .dp--large .dp__nav { display: grid; gap: 0.2rem; position: sticky; top: 4.5rem; font-size: 0.9rem; }
  .dp--large .dp__nav a { text-decoration: none; color: var(--ink-2); padding: 0.25rem 0; }
  .dp--large .dp__nav a:hover { color: var(--ink); }
  .dp__navtitle { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.4rem; }
  .dp--large .dp__sections { max-width: var(--measure); }
  .dp--large .dp__sec--side { max-width: none; }
}
.dp--large .dp__sections { gap: 3rem; }
.dp--large .dp__sec--side h2 { font-size: inherit; border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; margin-bottom: 0.8rem; letter-spacing: -0.02em; }
.dp--large .skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 2rem; }
.dp--large .skills .skill:last-child { border-bottom: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .footer, .dp__nav, .post__foot { display: none; } }
