/* ==========================================================================
   Craft Poker — site theme
   --------------------------------------------------------------------------
   A single, hand-written stylesheet (no build step). Everything is driven by
   the custom properties in :root below, so restyling the whole site is mostly
   a matter of editing those values.

   Design direction: clean, modern, friendly, trustworthy — a polished software
   product with the warmth of a home game. Muted "felt" green primary, a warm
   amber accent used sparingly, neutral grays, generous type.

   Sections:
     1. Design tokens (:root) + dark mode
     2. Base / reset
     3. Layout helpers
     4. Buttons
     5. Header + navigation
     6. Footer
     7. Hero (home)
     8. Feature cards (home)
     9. Prose (pages + blog posts)
    10. Post lists + tag pills
    11. Motion / accessibility
   ========================================================================== */

/* 1. ----------------------------------------------------------------- TOKENS */
:root {
  /* Brand greens (decorative constants — do not change with color scheme). */
  --green-900: #0f3d2e;
  --green-700: #1a6b4f;
  --green-500: #2f9d72;
  --green-300: #7fd3ad;

  /* Warm accent (used sparingly: highlights, focus, small marks). */
  --amber-500: #d98a3c;
  --amber-600: #b46f24;

  /* Semantic tokens — these are what the components below actually use.
     They are re-declared in the dark-mode block so the whole UI flips. */
  --paper: #ffffff;          /* page background */
  --surface: #f5f8f6;        /* cards / raised panels */
  --surface-2: #eef3f0;      /* subtle fills */
  --line: #dbe5e0;           /* borders / rules */

  --ink: #14201c;            /* primary text */
  --ink-soft: #414d48;       /* secondary text */
  --ink-mute: #5c6a64;       /* muted / meta text (AA on paper & surface) */

  --brand: #15654a;          /* links + brand text on light backgrounds */
  --brand-strong: #0f4f39;   /* link hover */

  --btn-primary-bg: #1a6b4f;
  --btn-primary-bg-hover: #12523c;
  --btn-primary-ink: #ffffff;

  --focus: #d98a3c;          /* focus ring */

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --fs-xs: 0.78rem;
  --fs-sm: 0.9rem;
  --fs-base: 1.0625rem;      /* ~17px body */
  --fs-md: 1.2rem;
  --fs-lg: 1.45rem;
  --fs-xl: 1.85rem;
  --fs-2xl: 2.35rem;
  --fs-3xl: 3rem;

  --lh-tight: 1.15;
  --lh: 1.6;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* Shape */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Structure */
  --wrap: 72rem;             /* max content width */
  --measure: 65ch;          /* readable prose line length */

  --shadow-sm: 0 1px 2px rgba(15, 61, 46, 0.06),
    0 2px 6px rgba(15, 61, 46, 0.06);
  --shadow: 0 6px 24px rgba(15, 61, 46, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1512;
    --surface: #161f1b;
    --surface-2: #1c2723;
    --line: #2a3833;

    --ink: #e7efea;
    --ink-soft: #c2cfc8;
    --ink-mute: #93a39b;

    --brand: #6fd3a6;
    --brand-strong: #8ee0bd;

    --btn-primary-bg: #35b083;
    --btn-primary-bg-hover: #46c091;
    --btn-primary-ink: #06130d;

    --focus: #f0b872;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  }
}

/* 2. ------------------------------------------------------------------- BASE */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  line-height: var(--lh-tight);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-2xl);
}
h2 {
  font-size: var(--fs-xl);
}
h3 {
  font-size: var(--fs-lg);
}

p {
  margin: 0 0 var(--sp-4);
}

a {
  color: var(--brand);
  text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent);
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--brand-strong);
  text-decoration-color: currentColor;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
code {
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip link — visible only when focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-ink);
  padding: var(--sp-2) var(--sp-4);
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

/* 3. ----------------------------------------------------------------- LAYOUT */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
}

.section {
  padding-block: var(--sp-8);
}

.eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 var(--sp-3);
}

/* 4. ---------------------------------------------------------------- BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font: inherit;
  font-weight: 700;
  line-height: 1;
  padding: 0.7em 1.25em;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease,
    border-color 120ms ease, color 120ms ease;
}
.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-ink);
}
.btn--primary:hover {
  background: var(--btn-primary-bg-hover);
  color: var(--btn-primary-ink);
}

.btn--secondary {
  background: transparent;
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
}
.btn--secondary:hover {
  color: var(--brand-strong);
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.btn--lg {
  font-size: var(--fs-md);
  padding: 0.8em 1.5em;
}

/* 5. ----------------------------------------------------------------- HEADER */
.site-header {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding-block: var(--sp-3);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 800;
  font-size: var(--fs-md);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto; /* pushes nav + CTA to the right on wide screens */
}
.wordmark__mark {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

/* AI placeholder disclosure banner (home page only). Remove with its HTML block. */
.ai-notice {
  background: var(--amber-500);
  color: #241a10;
}
.ai-notice__inner {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding-block: 0.7rem;
}
.ai-notice__icon {
  flex: none;
  width: 22px;
  height: 22px;
}
.ai-notice p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
}
.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.site-nav a[aria-current="page"] {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}

/* 6. ----------------------------------------------------------------- FOOTER */
.site-footer {
  margin-top: var(--sp-9);
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  padding-block: var(--sp-7);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.footer-nav a {
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: none;
}
.footer-nav a:hover {
  color: var(--brand);
}
.site-footer__note {
  max-width: var(--measure);
  color: var(--ink-mute);
  margin-bottom: var(--sp-2);
}
.site-footer__legal {
  color: var(--ink-mute);
  font-size: var(--fs-sm);
  margin: 0;
}

/* 7. ------------------------------------------------------------------- HERO */
.hero {
  padding-block: var(--sp-8) var(--sp-7);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-7);
  align-items: center;
}
@media (min-width: 56rem) {
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--sp-8);
  }
}
.hero__title {
  font-size: var(--fs-3xl);
  margin-bottom: var(--sp-4);
}
.hero__subtitle {
  font-size: var(--fs-md);
  color: var(--ink-soft);
  max-width: 40ch;
  margin-bottom: var(--sp-6);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.hero__media {
  margin: 0;
}
.hero__media img {
  display: block;
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

/* 8. --------------------------------------------------------------- FEATURES */
.features {
  padding-block: var(--sp-7);
  border-top: 1px solid var(--line);
}
.features__grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: var(--sp-6);
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--green-700) 12%, transparent);
  color: var(--brand);
  margin-bottom: var(--sp-4);
}
.feature__icon svg {
  width: 24px;
  height: 24px;
}
.feature__title {
  font-size: var(--fs-md);
  margin-bottom: var(--sp-2);
}
.feature__body {
  color: var(--ink-soft);
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.55;
}

/* 9. ------------------------------------------------------------------ PROSE */
.page {
  padding-block: var(--sp-8);
}
.prose {
  max-width: var(--measure);
}
.prose > :first-child {
  margin-top: 0;
}
.prose h2 {
  margin-top: var(--sp-6);
}
.prose h3 {
  margin-top: var(--sp-5);
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
  margin: 0 0 var(--sp-4);
}
.prose li {
  margin-bottom: var(--sp-2);
}
.prose blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-2) var(--sp-5);
  border-left: 4px solid var(--green-500);
  color: var(--ink-soft);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose a {
  font-weight: 600;
}

.page-header {
  margin-bottom: var(--sp-6);
}
.page-title {
  margin-bottom: var(--sp-3);
}

/* 10. -------------------------------------------------- POST LISTS + PILLS */
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  color: var(--ink-mute);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
}
.meta time {
  font-variant-numeric: tabular-nums;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  list-style: none;
  padding: 0;
  margin: 0;
}
.pill {
  display: inline-block;
  padding: 0.25em 0.75em;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-decoration: none;
}
a.pill:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 40%, transparent);
}
.pill--count {
  color: var(--ink-mute);
}

.post-list {
  list-style: none;
  padding: 0;
  margin: var(--sp-6) 0 0;
  display: grid;
  gap: var(--sp-4);
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.post-card__title {
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-2);
}
.post-card__title a {
  color: var(--ink);
  text-decoration: none;
}
.post-card__title a:hover {
  color: var(--brand);
}
.post-card__excerpt {
  color: var(--ink-soft);
  margin: var(--sp-3) 0 0;
}

.subscribe {
  margin-top: var(--sp-6);
  font-size: var(--fs-sm);
}
.backlink {
  display: inline-block;
  margin-bottom: var(--sp-4);
  font-weight: 600;
  font-size: var(--fs-sm);
}
.post-footer {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
}

/* 11. --------------------------------------------------- MOTION / A11Y */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .btn:hover {
    transform: none;
  }
}
