/* Site chrome only. Episode content lives under .tuto-<slug> with its own scoped CSS:
   never style bare elements inside .episode here. */
:root {
  --sage: #7A9E77;
  --sage-dark: #55744f;
  --yellow: #FFD43B;
  --ink: #141414;
  --box: rgba(18, 18, 18, .62);
  --paper: #fbfaf6;
  --stroke: rgba(20, 20, 20, .55);
}

:where(.site-header, .site-footer, .home, .page, .others, .skip-link), :where(.site-header, .site-footer, .home, .page, .others) *, :where(.site-header, .site-footer, .home, .page, .others) *::before, :where(.site-header, .site-footer, .home, .page, .others) *::after { box-sizing: border-box; }

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

body.site {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sage);
  color: #fff;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.site > main { flex: 1; width: 100%; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--yellow); color: var(--ink); font-weight: 800;
  padding: 8px 14px; border-radius: 99px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

:where(.site-header, .site-footer, .home, .page, .others, .skip-link):focus-visible, :where(.site-header, .site-footer, .home, .page, .others) :focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* Header */
.site-header {
  background: var(--box);
  padding: 14px 20px;
}
.site-logo {
  color: #fff; text-decoration: none;
  font-weight: 900; font-size: 20px; letter-spacing: -.5px;
}
.site-logo b { color: var(--yellow); font-weight: 900; }

/* Shared bits */
:where(.home, .page, .others) .chip {
  display: inline-block;
  background: var(--yellow); color: var(--ink);
  font-weight: 800; font-size: 12px; letter-spacing: 2px;
  padding: 5px 12px; border-radius: 99px;
}
:where(.home, .page, .others) .tip {
  display: inline-block;
  background: var(--box); border-radius: 14px;
  padding: 8px 14px; margin: 0;
  font-weight: 700; font-size: 15px;
}
.home h1, .page h1 {
  font-weight: 900; letter-spacing: -1.5px; line-height: 1.04;
  font-size: clamp(34px, 8vw, 56px);
  margin: 12px 0 14px;
  -webkit-text-stroke: 1.5px var(--stroke);
  paint-order: stroke fill;
  text-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}
.home h1 em, .page h1 em { font-style: normal; color: var(--yellow); }
:where(.home, .page, .others) .button {
  display: inline-block;
  background: var(--yellow); color: var(--ink);
  font-weight: 800; text-decoration: none;
  padding: 12px 20px; border-radius: 99px;
}

/* Home */
.home, .page, .others {
  max-width: 1200px; margin: 0 auto;
  padding: 24px 16px 32px;
}
:where(.home, .page, .others) .hero { margin-bottom: 22px; }

:where(.home, .page, .others) .grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { :where(.home, .page, .others) .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 1024px) { :where(.home, .page, .others) .grid { grid-template-columns: repeat(4, 1fr); } }

:where(.home, .page, .others) .card {
  position: relative; display: block;
  aspect-ratio: 9 / 16;
  border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, #8fb18c, var(--sage-dark));
  color: #fff; text-decoration: none;
  transition: transform .15s ease;
}
:where(.home, .page, .others) .card:hover { transform: translateY(-3px); }
:where(.home, .page, .others) .card-media, :where(.home, .page, .others) .card-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
:where(.home, .page, .others) .card-media img { object-fit: cover; }
:where(.home, .page, .others) .card-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .65));
}
:where(.home, .page, .others) .card-play {
  position: absolute; inset: 0; margin: auto; z-index: 1;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(18, 18, 18, .55);
}
:where(.home, .page, .others) .card-play::after {
  content: ""; position: absolute; left: 17px; top: 13px;
  border-style: solid; border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent #fff;
}
:where(.home, .page, .others) .card-badges {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 4px;
}
:where(.home, .page, .others) .card-badge, :where(.home, .page, .others) .card-draft {
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 99px;
}
:where(.home, .page, .others) .card-badge { background: var(--box); color: #fff; }
:where(.home, .page, .others) .card-draft { background: #e8590c; color: #fff; }
:where(.home, .page, .others) .card-title {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1;
  font-weight: 900; font-size: 16px; line-height: 1.12; letter-spacing: -.3px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
:where(.home, .page, .others) .card-title em { font-style: normal; color: var(--yellow); }

:where(.home, .page, .others) .empty {
  background: var(--box); border-radius: 18px;
  padding: 28px 22px; max-width: 560px;
}
:where(.home, .page, .others) .empty p { margin: 0; }
:where(.home, .page, .others) .empty-title { font-weight: 900; font-size: 22px; letter-spacing: -.5px; margin-bottom: 6px !important; }
:where(.home, .page, .others) .empty a, .page.legal a { color: var(--yellow); }

/* Episode frame: a light sheet so long-form content stays readable. */
.episode {
  max-width: 900px; margin: 16px auto 0;
  background: var(--paper); color: var(--ink);
  border-radius: 18px; overflow: hidden;
}
@media (max-width: 640px) { .episode { margin-top: 0; border-radius: 0; } }

.others h2 {
  font-weight: 900; letter-spacing: -.8px; font-size: 28px; margin: 8px 0 14px;
}

/* Calculators index */
:where(.home, .page, .others) .lead { font-weight: 600; max-width: 640px; }
:where(.home, .page, .others) .calc-list {
  list-style: none; padding: 0; margin: 20px 0 0;
  display: grid; gap: 12px;
}
@media (min-width: 760px) { :where(.home, .page, .others) .calc-list { grid-template-columns: repeat(2, 1fr); } }
:where(.home, .page, .others) .calc-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--box); border-radius: 16px; padding: 10px;
  color: #fff; text-decoration: none;
}
:where(.home, .page, .others) .calc-card img {
  width: 64px; height: auto; aspect-ratio: 9 / 16; object-fit: cover;
  border-radius: 8px; flex: none;
}
:where(.home, .page, .others) .calc-text strong { display: block; font-weight: 800; font-size: 17px; line-height: 1.2; }
:where(.home, .page, .others) .calc-text span { display: block; opacity: .85; font-size: 14px; margin-top: 4px; }

/* Legal pages */
:where(.home, .page, .others) .legal { max-width: 760px; }
.page.legal h2 { font-weight: 800; font-size: 20px; margin: 28px 0 8px; }
.page.legal p, .page.legal ul { margin: 0 0 10px; }
:where(.home, .page, .others) .legal-note {
  margin-top: 28px !important;
  background: var(--box); border-radius: 12px; padding: 10px 14px;
  font-weight: 700;
}

/* 404 */
:where(.home, .page, .others) .notfound { text-align: left; max-width: 760px; }
.page.notfound .button { margin-top: 18px; }

/* Footer */
.site-footer {
  background: rgba(18, 18, 18, .75);
  padding: 18px 20px 22px; margin-top: 24px;
  font-size: 13px;
}
.site-footer p { margin: 0 auto 6px; max-width: 1200px; opacity: .9; }
.site-footer nav {
  max-width: 1200px; margin: 10px auto 0;
  display: flex; flex-wrap: wrap; gap: 6px 18px;
}
.site-footer a { color: #fff; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  :where(.home, .page, .others) .card { transition: none; }
  :where(.home, .page, .others) .card:hover { transform: none; }
}
