/* Tartine Studio - publisher website. Colours sampled from the Tartine Studio banner. */
@font-face { font-family: "Fredoka"; src: url("fonts/fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --brown: #221714;        /* banner background */
  --brown-2: #33241e;
  --cream: #fdeac9;        /* wordmark */
  --crust: #bd6c26;        /* toast crust */
  --toast: #e3923f;        /* toasted orange, buttons */
  --toast-2: #efa75a;
  --page: #fff8ee;
  --paper: #fffdf9;
  --ink: #2a201b;
  --muted: #6b5a4f;
  --line: #ecdcc5;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(34, 23, 20, .06), 0 8px 24px rgba(34, 23, 20, .08);
  --wrap: 1120px;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--crust); text-underline-offset: 3px; }
a:hover { color: #8f4e19; }
:focus-visible { outline: 3px solid var(--toast); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; color: var(--brown); letter-spacing: .2px; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.3rem); margin: .2em 0 .3em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin: 1.6em 0 .6em; }
h3 { font-size: 1.3rem; margin: 0 0 .35em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow > * { max-width: 760px; }
.center { text-align: center; } .center > * { margin-left: auto; margin-right: auto; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 12px; top: 12px; z-index: 9; background: var(--cream); padding: 8px 12px; border-radius: 8px; }

/* ---------------------------------------------------------------- header / footer */
.site-header { background: var(--brown); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid rgba(253, 234, 201, .08); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand img { height: 46px; width: auto; }
.main-nav { display: flex; gap: 6px; }
.main-nav a { color: var(--cream); text-decoration: none; font-family: var(--display); font-weight: 500; font-size: 1.05rem; padding: 8px 14px; border-radius: 999px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: rgba(253, 234, 201, .1); color: #fff; }

.site-footer { background: var(--brown); color: var(--cream); margin-top: 64px; padding: 36px 0 22px; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { height: 52px; width: auto; }
.footer-brand span { opacity: .75; font-size: .92rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-nav a { color: var(--cream); text-decoration: none; opacity: .85; }
.footer-nav a:hover { opacity: 1; text-decoration: underline; color: var(--cream); }
.copyright { margin-top: 22px; font-size: .82rem; opacity: .55; }

/* ---------------------------------------------------------------- hero */
.hero { background: radial-gradient(900px 380px at 78% 0%, rgba(227, 146, 63, .22), transparent 70%), var(--brown); color: var(--cream); padding: 64px 0 72px; }
.hero h1, .hero h2 { color: var(--cream); }
.hero-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 40px; }
.eyebrow { font-family: var(--display); color: var(--toast-2); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; margin: 0; }
.lead { font-size: 1.2rem; max-width: 640px; opacity: .92; margin: 0 0 1.4em; }
.hero-mascot { width: clamp(120px, 18vw, 210px); filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); animation: bob 4.5s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .hero-mascot { animation: none; } html { scroll-behavior: auto; } }
.hero-asset { padding: 40px 0 44px; }
.crumbs { font-size: .92rem; opacity: .8; }
.crumbs a { color: var(--cream); }
.hero .tags li { background: rgba(253, 234, 201, .12); color: var(--cream); }

/* ---------------------------------------------------------------- buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--display); font-weight: 600; font-size: 1rem; line-height: 1; padding: 13px 20px; border-radius: 999px; text-decoration: none; border: 2px solid transparent; transition: transform .12s ease, background-color .12s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-lg { font-size: 1.08rem; padding: 15px 24px; }
.btn-primary { background: var(--toast); color: var(--brown); }
.btn-primary:hover { background: var(--toast-2); color: var(--brown); }
.btn-secondary { background: var(--cream); color: var(--brown); }
.btn-secondary:hover { background: #fff3dc; color: var(--brown); }
.btn-ghost { border-color: rgba(253, 234, 201, .5); color: var(--cream); }
.btn-ghost:hover { border-color: var(--cream); color: #fff; }
.btn-link { color: var(--cream); padding-left: 6px; padding-right: 6px; text-decoration: underline; }
.btn-link:hover { color: #fff; }
.btn.is-disabled { background: transparent; border-color: rgba(253, 234, 201, .35); color: rgba(253, 234, 201, .75); cursor: default; transform: none; }
.section .btn.is-disabled { border-color: var(--line); color: var(--muted); }

/* ---------------------------------------------------------------- sections, cards */
.section { padding: 28px 0 8px; }
.section-alt { background: var(--paper); border-top: 1px solid var(--line); margin-top: 48px; padding-bottom: 40px; }
.section-alt + .site-footer, main:has(> .section-alt:last-child) + .site-footer { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(34, 23, 20, .08), 0 16px 36px rgba(34, 23, 20, .14); }
.card-link { color: inherit; text-decoration: none; display: block; height: 100%; }
.card-link:hover { color: inherit; }
.card-media { position: relative; aspect-ratio: 16 / 9; background: var(--brown); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 12px; left: 12px; background: var(--brown); color: var(--cream); font-family: var(--display); font-size: .8rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; }
.card-body { padding: 18px 20px 20px; }
.card-body p { margin: 0 0 12px; color: var(--muted); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.tags li { background: #f7e6cc; color: #7a4414; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }

/* ---------------------------------------------------------------- asset page */
.cover { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 8px; aspect-ratio: 16 / 9; object-fit: cover; }
.columns { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 40px; }
.col-side { padding-top: 26px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 22px 18px; margin-bottom: 20px; }
.panel h2 { font-size: 1.25rem; margin: 18px 0 10px; }
.features { padding-left: 1.2em; }
.features li { margin: .35em 0; }
.features li::marker { color: var(--crust); }
.specs { width: 100%; border-collapse: collapse; font-size: .95rem; }
.specs th, .specs td { text-align: left; vertical-align: top; padding: 8px 0; border-bottom: 1px solid var(--line); }
.specs th { width: 38%; padding-right: 12px; color: var(--muted); font-weight: 700; }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gallery figure { margin: 0; }
.gallery img { border-radius: 12px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- documentation */
.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }
.docs-toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; font-size: .92rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.toc-title { font-family: var(--display); font-weight: 600; color: var(--brown); margin: 0 0 6px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; }
.docs-toc li { margin: 2px 0; }
.docs-toc a { color: var(--ink); text-decoration: none; display: block; padding: 3px 8px; border-radius: 8px; }
.docs-toc a:hover { background: #f7e6cc; }
.doc { min-width: 0; }
.doc > h2:first-child { margin-top: .3em; }
.doc h2 { border-bottom: 3px solid var(--toast); padding-bottom: 6px; scroll-margin-top: 90px; }
.doc h3 { margin-top: 1.4em; color: #7a4414; }
.doc table { width: 100%; border-collapse: collapse; margin: 14px 0 22px; font-size: .94rem; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: #f7e6cc; color: var(--brown); }
.doc tr:nth-child(even) td { background: var(--paper); }
.doc :not(pre) > code { overflow-wrap: anywhere; }
.doc code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; background: #f5e8d6; padding: 1px 5px; border-radius: 5px; }
.doc pre { background: var(--brown); color: var(--cream); padding: 16px 18px; border-radius: 12px; overflow-x: auto; }
.doc pre code { background: none; padding: 0; color: inherit; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .columns, .docs-layout { grid-template-columns: 1fr; }
  .col-side { padding-top: 0; }
  .docs-toc { position: static; max-height: none; }
  .hero { padding: 44px 0 52px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero-row { grid-template-columns: 1fr; }
  .hero-mascot { order: -1; width: 110px; }
  .brand img { height: 38px; }
  .main-nav a { padding: 6px 10px; }
  .btn-lg { width: 100%; }
}
