/* =========================================================
   Polar Picnic Cleverp — The Productivity Edit
   Contemporary Minimalist Productivity Editorial
   Vanilla CSS. No external dependencies.
   ========================================================= */

:root {
  --primary: #A76E4E;
  --secondary: #62483B;
  --accent: #D6AC62;
  --bg: #F5F0E7;
  --surface: #FFFCF7;
  --text: #302A25;
  --muted: #8B8177;
  --highlight: #E8DFD0;
  --border: #DED4C5;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Century Gothic", Futura, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --shadow-soft: 0 14px 34px -22px rgba(48, 42, 37, .45);
  --shadow-lift: 0 26px 50px -26px rgba(48, 42, 37, .55);
  --radius: 6px;
  --wrap: 1240px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(214, 172, 98, .10), transparent 40%),
    radial-gradient(circle at 88% 30%, rgba(167, 110, 78, .07), transparent 45%);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--secondary); text-decoration-color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .25s; }
a:hover { color: var(--primary); }

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

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.08; color: var(--text); margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.6rem, 7vw, 6.4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 3.1rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
p { margin: 0 0 1.1em; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--secondary); color: var(--surface); padding: .7rem 1.1rem; border-radius: var(--radius); z-index: 200; transition: top .2s; }
.skip-link:focus { top: 1rem; color: var(--surface); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.eyebrow { font-family: var(--sans); font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--primary); font-weight: 700; margin-bottom: 1rem; }

.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--secondary); max-width: 46ch; }

.note {
  font-family: var(--serif);
  font-style: italic;
  color: var(--primary);
  font-size: 1rem;
  display: inline-block;
  transform: rotate(-2deg);
  border-bottom: 1px dashed var(--accent);
}

/* ---------- Header (non-sticky) ---------- */
.site-header {
  position: relative;
  z-index: 20;
  background: rgba(255, 252, 247, .7);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.1rem 0; }

.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--primary); color: var(--surface);
  font-family: var(--serif); font-size: 1.45rem; border-radius: 10px;
  box-shadow: 4px 4px 0 var(--highlight);
  transition: transform .4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-6deg); }
.brand-text { display: flex; flex-direction: column; font-family: var(--serif); font-size: 1.2rem; line-height: 1.1; }
.brand-text small { font-family: var(--sans); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: .25rem; }

.site-nav ul { list-style: none; display: flex; gap: .4rem; margin: 0; padding: 0; }
.site-nav a {
  display: inline-block; padding: .55rem 1rem; border-radius: 999px;
  text-decoration: none; color: var(--secondary); font-weight: 600; font-size: .95rem;
  transition: background .25s, color .25s;
}
.site-nav a:hover { background: var(--highlight); color: var(--text); }
.site-nav a[aria-current="page"] { background: var(--secondary); color: var(--surface); }

.nav-toggle {
  display: none; font: inherit; font-weight: 700; font-size: .9rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--surface); color: var(--secondary); border: 1px solid var(--border);
  border-radius: 999px; padding: .55rem 1.1rem; cursor: pointer;
}

/* ---------- Buttons, chips, tags ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-family: var(--sans); font-weight: 700; font-size: .9rem; letter-spacing: .02em;
  padding: .78rem 1.25rem; border-radius: 999px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .25s var(--ease), background .25s, color .25s, box-shadow .25s;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--secondary); color: var(--surface); }
.btn-primary:hover { background: var(--text); color: var(--surface); box-shadow: 0 8px 18px -10px rgba(48, 42, 37, .7); }
.btn-ghost { background: transparent; color: var(--secondary); border-color: var(--secondary); }
.btn-ghost:hover { background: var(--highlight); color: var(--text); }
.btn-accent { background: var(--accent); color: var(--text); }
.btn-accent:hover { background: var(--primary); color: var(--surface); }

.chip {
  font: inherit; font-size: .88rem; font-weight: 600;
  background: var(--surface); color: var(--secondary);
  border: 1px solid var(--border); border-radius: 999px;
  padding: .5rem 1.05rem; cursor: pointer;
  transition: background .3s, color .3s, border-color .3s, transform .25s var(--ease);
}
.chip:hover { border-color: var(--primary); transform: translateY(-2px); }
.chip[aria-pressed="true"] { background: var(--secondary); color: var(--surface); border-color: var(--secondary); }

.tag {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  padding: .3rem .65rem; border-radius: 3px; background: var(--primary); color: var(--surface);
}
.tag-soft { background: var(--highlight); color: var(--secondary); }

/* ---------- Media + image fallback ---------- */
.media {
  position: relative; overflow: hidden;
  background-color: var(--highlight);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(167, 110, 78, .14) 27px 28px),
    linear-gradient(135deg, var(--highlight), var(--border));
}
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease), opacity .4s; }
.media img.is-broken { opacity: 0; }
.media.media-fallback::before {
  content: "Polar Picnic Cleverp · image unavailable";
  position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; text-align: center;
  font-family: var(--serif); font-style: italic; color: var(--secondary); font-size: .95rem; z-index: 1;
}

/* ---------- Reveal & wipes ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal .media::after, .js .reveal.media::after {
  content: ""; position: absolute; inset: 0; background: var(--highlight); z-index: 2;
  transform-origin: right center; transform: scaleX(1);
  transition: transform 1.1s var(--ease); transition-delay: calc(var(--d, 0ms) + 150ms);
}
.js .reveal.is-in .media::after, .js .reveal.is-in.media::after { transform: scaleX(0); }

/* ---------- Hero: Quiet Momentum Drift ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(94vh, 900px);
  display: grid; place-items: center;
  padding: 5rem 0 6rem;
  border-bottom: 1px solid var(--border);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 55% 50% at 50% 50%, rgba(245, 240, 231, .96) 35%, rgba(245, 240, 231, .55) 70%, rgba(245, 240, 231, 0) 100%);
}
.drift-stage { position: absolute; inset: 0; z-index: 0; }
.float { position: absolute; will-change: transform; }
.float-inner {
  --r: 0deg;
  background: var(--surface); padding: 10px 10px 34px; border-radius: 4px;
  box-shadow: var(--shadow-lift);
  transform: rotate(var(--r));
  animation: drift 20s ease-in-out infinite alternate;
}
.float-inner .media { aspect-ratio: 4 / 5; border-radius: 2px; }
.float-inner figcaption { font-family: var(--serif); font-style: italic; font-size: .8rem; color: var(--muted); padding-top: .5rem; text-align: center; }
.f1 { top: 7%; left: 3%; width: clamp(140px, 15vw, 230px); }
.f1 .float-inner { --r: -7deg; animation-duration: 22s; }
.f2 { top: 54%; left: 8%; width: clamp(130px, 13vw, 200px); }
.f2 .float-inner { --r: 5deg; animation-duration: 18s; animation-delay: -6s; }
.f3 { top: 6%; right: 5%; width: clamp(150px, 16vw, 250px); }
.f3 .float-inner { --r: 6deg; animation-duration: 24s; animation-delay: -3s; }
.f4 { top: 58%; right: 4%; width: clamp(140px, 14vw, 220px); }
.f4 .float-inner { --r: -5deg; animation-duration: 19s; animation-delay: -9s; }
.f5 { top: 2%; left: 34%; width: clamp(100px, 9vw, 140px); opacity: .85; }
.f5 .float-inner { --r: 3deg; animation-duration: 26s; animation-delay: -12s; }
.f6 { bottom: 3%; left: 42%; width: clamp(100px, 10vw, 150px); opacity: .85; }
.f6 .float-inner { --r: -3deg; animation-duration: 21s; animation-delay: -4s; }

@keyframes drift {
  0% { transform: translate(0, 0) rotate(var(--r)); }
  50% { transform: translate(12px, -16px) rotate(calc(var(--r) + 1.6deg)); }
  100% { transform: translate(-10px, 10px) rotate(calc(var(--r) - 1.2deg)); }
}

/* CSS stationery shapes */
.shape { position: absolute; z-index: 0; pointer-events: none; }
.shape-notebook {
  width: 120px; height: 160px; left: 22%; bottom: 12%;
  background: var(--primary); border-radius: 4px 10px 10px 4px; opacity: .18;
  box-shadow: inset 12px 0 0 rgba(48, 42, 37, .25);
  animation: floaty 14s ease-in-out infinite alternate;
}
.shape-clock {
  width: 110px; height: 110px; right: 24%; top: 14%; border-radius: 50%;
  border: 2px solid var(--accent); opacity: .5;
  background:
    linear-gradient(var(--secondary), var(--secondary)) 50% 30% / 2px 36% no-repeat,
    linear-gradient(90deg, var(--secondary), var(--secondary)) 62% 50% / 26% 2px no-repeat;
  animation: floaty 17s ease-in-out infinite alternate-reverse;
}
@keyframes floaty { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-22px) rotate(5deg); } }

.hero-copy { position: relative; z-index: 3; text-align: center; max-width: 900px; padding: 0 1rem; }
.hero-title { font-size: clamp(2.8rem, 8.2vw, 7.6rem); line-height: .98; margin-bottom: .35em; }
.hero-title em { font-style: italic; color: var(--primary); }
.mask-line { display: block; overflow: hidden; padding-bottom: .06em; }
.mask-line > span { display: inline-block; transform: translateY(108%); animation: rise 1.2s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { transform: translateY(0); } }
.hero-sub { font-size: clamp(1.05rem, 1.6vw, 1.28rem); color: var(--secondary); max-width: 58ch; margin: 0 auto 2rem; opacity: 0; animation: fadeUp 1s var(--ease) .9s forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hero-badge { position: absolute; z-index: 3; right: 9%; bottom: 10%; width: 128px; height: 128px; }
.hero-badge svg { width: 100%; height: 100%; animation: spin 26s linear infinite; }
.hero-badge text { font-family: var(--sans); font-size: 9.6px; letter-spacing: 3px; fill: var(--secondary); text-transform: uppercase; font-weight: 700; }
.hero-badge .badge-core { position: absolute; inset: 34px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-family: var(--serif); font-size: 1.6rem; color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Search panel */
.search-panel {
  position: relative; z-index: 3;
  margin: 0 auto; max-width: 640px; text-align: left;
  background: rgba(255, 252, 247, .82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 1rem; box-shadow: var(--shadow-soft);
  opacity: 0; animation: fadeUp 1s var(--ease) 1.1s forwards;
}
.search-panel label { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--primary); margin: 0 0 .5rem .3rem; }
.search-row { display: flex; gap: .6rem; }
.search-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: .8rem 1.2rem;
}
.search-row input::placeholder { color: var(--muted); }
.search-row input:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--primary); }
.search-results { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .25rem; }
.search-results a { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .9rem; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .95rem; }
.search-results a:hover, .search-results a:focus-visible { background: var(--highlight); }
.search-results span { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; }
.search-count { font-size: .85rem; color: var(--secondary); margin: .6rem .3rem 0; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: 1.6rem; opacity: 0; animation: fadeUp 1s var(--ease) 1.25s forwards; }

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 9vw, 7.5rem) 0; position: relative; }
.section-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: end; margin-bottom: 3.2rem; }
.section-head p { color: var(--secondary); margin: 0; }
.section-alt { background: rgba(232, 223, 208, .45); border-block: 1px solid var(--border); }
.ruled {
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(167, 110, 78, .10) 31px 32px);
}

/* ---------- Cards ---------- */
.tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 2.2rem 2rem; transition: opacity .35s var(--ease); }
.tips-grid.is-switching { opacity: 0; }
@media (min-width: 1000px) {
  .tips-grid.editorial { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tips-grid.editorial > .card:nth-child(3n+2) { margin-top: 3.5rem; }
  .tips-grid.editorial > .card:nth-child(3n) { margin-top: 1.5rem; }
}

.card {
  position: relative; display: flex; flex-direction: column;
  background: rgba(255, 252, 247, .9);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 7px 7px 0 -1px var(--highlight), 7px 7px 0 0 var(--border);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.card[hidden] { display: none; }
.card:hover { transform: translateY(-7px) rotate(-.25deg); box-shadow: 12px 14px 0 -1px var(--highlight), 12px 14px 0 0 var(--border), var(--shadow-lift); }
.card .media { aspect-ratio: 4 / 3; border-radius: var(--radius) var(--radius) 0 0; }
.card:hover .media img { transform: scale(1.07); }
.card-num {
  position: absolute; z-index: 3; top: .8rem; left: .8rem;
  background: var(--surface); color: var(--primary);
  font-family: var(--serif); font-size: 1.25rem; padding: .15rem .65rem; border-radius: 3px;
  box-shadow: 0 4px 10px -6px rgba(48, 42, 37, .5);
}
.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.4rem 1.4rem 1.5rem; border-left: 2px solid rgba(167, 110, 78, .25); margin-left: 1rem; }
.card-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.card h3 { margin-bottom: .5rem; }
.card p { font-size: .97rem; color: var(--secondary); }
.card-meta { font-size: .86rem; color: var(--secondary); border-top: 1px dashed var(--border); padding-top: .8rem; margin-top: auto; }
.card-meta strong { color: var(--text); }
.card-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.card-actions .btn { flex: 1 1 auto; }

.dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: .35rem; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); display: inline-block; }
.dots i.on { background: var(--primary); }

/* Featured layout */
.featured-grid { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; gap: 2.2rem; }
.featured-grid > .card:first-child { grid-row: span 2; }
.featured-grid > .card:first-child .media { aspect-ratio: 5 / 4; }
.featured-grid > .card:first-child h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }

/* Tip index strip */
.tip-index { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 1px solid var(--border); }
.tip-index li { border-bottom: 1px solid var(--border); }
.tip-index a { display: flex; gap: 1rem; align-items: baseline; padding: 1rem .5rem; text-decoration: none; color: var(--text); transition: background .3s, padding .3s; }
.tip-index a:hover { background: var(--highlight); padding-left: 1rem; }
.tip-index b { font-family: var(--serif); color: var(--primary); font-weight: 500; font-size: 1.3rem; min-width: 2ch; }

/* Habit columns */
.habit-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.habit-col {
  background: rgba(255, 252, 247, .85); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem 1.4rem; position: relative; min-height: 100%;
  background-image: linear-gradient(90deg, transparent 22px, rgba(167, 110, 78, .22) 22px 23px, transparent 23px);
  padding-left: 2.6rem;
}
.habit-col h3 { font-size: 1.35rem; }
.habit-col .time { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--primary); }
.habit-col ul { list-style: none; padding: 0; margin: 1rem 0 1.4rem; font-size: .95rem; }
.habit-col li { padding: .45rem 0; border-bottom: 1px dashed var(--border); }
.habit-col li a { text-decoration: none; }
.habit-col li a:hover { text-decoration: underline; }
.progress { height: 6px; background: var(--highlight); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: inherit; transition: width 1.6s var(--ease) .3s; }
.is-in .progress span { width: var(--p, 50%); }
.progress-label { font-size: .78rem; color: var(--secondary); margin-top: .4rem; }

/* Guide highlights */
.guide-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 4rem; align-items: center; }
.guide-split .media { aspect-ratio: 4 / 5; border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.guide-links { list-style: none; padding: 0; margin: 0; counter-reset: g; }
.guide-links li { counter-increment: g; border-bottom: 1px solid var(--border); }
.guide-links a { display: grid; grid-template-columns: 3rem 1fr; gap: .5rem; padding: 1.1rem 0; text-decoration: none; color: var(--text); }
.guide-links a::before { content: counter(g, decimal-leading-zero); font-family: var(--serif); color: var(--primary); font-size: 1.1rem; }
.guide-links strong { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; display: block; transition: color .25s; }
.guide-links span { color: var(--secondary); font-size: .93rem; }
.guide-links a:hover strong { color: var(--primary); }

.callout {
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  background: rgba(255, 252, 247, .9); border-radius: var(--radius);
  padding: 1.6rem 1.8rem; color: var(--secondary); font-size: .97rem;
}
.callout h2, .callout h3 { font-size: 1.35rem; margin-bottom: .4rem; color: var(--text); }

/* ---------- Page hero (subpages) ---------- */
.page-hero { padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(2.5rem, 5vw, 4rem); border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 3rem; align-items: end; }
.page-hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.6rem); }
.page-hero .media { aspect-ratio: 4 / 3; border-radius: var(--radius); box-shadow: var(--shadow-lift); transform: rotate(2deg); }
.page-hero .note { margin-top: .8rem; }

/* ---------- Listings controls ---------- */
.controls {
  display: grid; gap: 1.2rem; margin-bottom: 2.5rem;
  background: rgba(255, 252, 247, .85); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.4rem; box-shadow: var(--shadow-soft);
}
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.control-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: .9rem; align-items: end; }
.field label { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--primary); margin-bottom: .35rem; }
.field input, .field select {
  width: 100%; font: inherit; font-size: .96rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: .7rem .9rem; appearance: none; -webkit-appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--secondary) 50%), linear-gradient(135deg, var(--secondary) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem;
}
.field input:focus, .field select:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--primary); }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; color: var(--secondary); font-size: .95rem; }
.empty-state { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--secondary); }
.empty-state[hidden] { display: none; }

/* ---------- Detail page ---------- */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); z-index: 60; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 2rem 0 0; font-size: .85rem; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: var(--border); }
.breadcrumb a { color: var(--secondary); }
.detail-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; padding: 2.5rem 0 4rem; border-bottom: 1px solid var(--border); }
.detail-title { font-size: clamp(2.4rem, 5.6vw, 4.8rem); }
.detail-hero-media { aspect-ratio: 4 / 5; border-radius: var(--radius); box-shadow: var(--shadow-lift); margin: 0; }
.detail-hero-media figcaption { position: absolute; z-index: 3; bottom: 1rem; left: 1rem; right: 1rem; background: rgba(255, 252, 247, .9); padding: .6rem .9rem; border-radius: 4px; font-family: var(--serif); font-style: italic; font-size: .9rem; color: var(--secondary); }
.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 2rem 0 0; border-top: 1px solid var(--border); }
.spec-grid div { padding: .9rem .2rem; border-bottom: 1px solid var(--border); }
.spec-grid .span-2 { grid-column: span 2; }
.spec-grid dt { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--primary); font-weight: 700; }
.spec-grid dd { margin: .2rem 0 0; font-family: var(--serif); font-size: 1.15rem; }
.spec-grid dd .tag { font-family: var(--sans); margin: .2rem .3rem 0 0; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 4rem; padding: 4rem 0; }
.detail-body section { padding-bottom: 2.6rem; margin-bottom: 2.6rem; border-bottom: 1px solid var(--border); scroll-margin-top: 1.5rem; }
.detail-body section:last-child { border-bottom: 0; }
.detail-body h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.fit-note { background: var(--highlight); border-radius: var(--radius); padding: 1rem 1.2rem; font-size: .95rem; color: var(--secondary); }

.step-list { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.step-list li { counter-increment: s; display: grid; grid-template-columns: 3.2rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px dashed var(--border); }
.step-list li::before {
  content: counter(s); display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 1px solid var(--primary); color: var(--primary); font-family: var(--serif); font-size: 1.2rem;
}

.example-card {
  margin: 0; position: relative; padding: 2rem 2rem 1.6rem 2.6rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(167, 110, 78, .12) 31px 32px), linear-gradient(90deg, transparent 1.6rem, rgba(167, 110, 78, .3) 1.6rem 1.7rem, transparent 1.7rem);
  font-family: var(--serif); font-size: 1.15rem; line-height: 1.75;
  box-shadow: var(--shadow-soft);
}
.example-card footer { font-family: var(--sans); font-size: .8rem; color: var(--muted); font-style: normal; }

.tool-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .8rem; }
.tool-list li { padding: 1rem 1.2rem; background: rgba(255, 252, 247, .9); border: 1px solid var(--border); border-radius: var(--radius); }
.tool-list strong { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; display: block; }
.tool-list span { font-size: .93rem; color: var(--secondary); }
.small-note { font-size: .85rem; color: var(--secondary); }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.checklist label {
  display: flex; gap: .9rem; align-items: center; cursor: pointer;
  padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: background .3s, border-color .3s;
}
.checklist input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; flex: 0 0 22px; border: 2px solid var(--primary); border-radius: 5px; display: grid; place-items: center; margin: 0; cursor: pointer; background: var(--surface); }
.checklist input::after { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--surface); border-bottom: 2px solid var(--surface); transform: rotate(-45deg) scale(0); transition: transform .25s var(--ease); margin-top: -2px; }
.checklist input:checked { background: var(--primary); }
.checklist input:checked::after { transform: rotate(-45deg) scale(1); }
.checklist input:checked + span { text-decoration: line-through; text-decoration-color: var(--accent); color: var(--secondary); }
.checklist label:has(input:checked) { background: var(--highlight); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.plus-list, .minus-list, .mistake-list { list-style: none; padding: 0; margin: 0; }
.plus-list li, .minus-list li, .mistake-list li { position: relative; padding: .55rem 0 .55rem 1.8rem; border-bottom: 1px dashed var(--border); }
.plus-list li::before { content: "+"; position: absolute; left: 0; color: var(--primary); font-weight: 700; font-size: 1.2rem; line-height: 1.4; }
.minus-list li::before { content: "–"; position: absolute; left: 0; color: var(--secondary); font-weight: 700; font-size: 1.2rem; line-height: 1.4; }
.mistake-list li::before { content: "×"; position: absolute; left: 0; color: var(--primary); font-weight: 700; font-size: 1.2rem; line-height: 1.4; }

.detail-aside { position: relative; }
.float-panel {
  position: sticky; top: 1.5rem;
  background: rgba(255, 252, 247, .92); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.6rem; box-shadow: var(--shadow-soft);
}
.float-panel h2 { font-size: 1.35rem; }
.ring-wrap { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.ring { width: 76px; height: 76px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .ring-bg { stroke: var(--highlight); }
.ring .ring-fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.ring-text { font-size: .9rem; color: var(--secondary); }
.ring-text strong { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--text); font-weight: 500; }
.toc { list-style: none; padding: 0; margin: 0 0 1.2rem; font-size: .93rem; }
.toc a { display: block; padding: .35rem 0; text-decoration: none; border-bottom: 1px dashed var(--border); }
.toc a:hover { color: var(--primary); }
.panel-actions { display: grid; gap: .6rem; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding-bottom: 3rem; }
.pager a { display: block; padding: 1.3rem 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; background: rgba(255, 252, 247, .8); transition: transform .35s var(--ease), box-shadow .35s; }
.pager a:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.pager small { display: block; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--primary); font-weight: 700; }
.pager strong { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; color: var(--text); }
.pager .next { text-align: right; }

/* ---------- Guide page ---------- */
.guide-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 4rem; padding: 4rem 0; }
.guide-toc { position: sticky; top: 1.5rem; align-self: start; background: rgba(255, 252, 247, .9); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem; }
.guide-toc h2 { font-size: 1.2rem; }
.guide-toc ol { margin: 0; padding-left: 1.2rem; font-size: .92rem; }
.guide-toc li { padding: .25rem 0; }
.guide-toc a { text-decoration: none; }
.guide-section { padding-bottom: 3rem; margin-bottom: 3rem; border-bottom: 1px solid var(--border); scroll-margin-top: 1.5rem; }
.guide-section:last-child { border-bottom: 0; }
.guide-section .eyebrow { margin-bottom: .5rem; }
.guide-section ul { padding-left: 1.2rem; }
.guide-section li { margin-bottom: .4rem; }
.guide-feature { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 2rem; align-items: start; }
.guide-feature .media { aspect-ratio: 3 / 4; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.related-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* ---------- Legal / About ---------- */
.prose { max-width: 780px; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-top: 2.4rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .45rem; }
.placeholder { background: var(--highlight); border: 1px dashed var(--primary); padding: .05rem .4rem; border-radius: 3px; font-size: .95em; }
.data-table { width: 100%; border-collapse: collapse; font-size: .93rem; margin: 1rem 0 1.5rem; background: var(--surface); }
.data-table th, .data-table td { border: 1px solid var(--border); padding: .7rem .8rem; text-align: left; vertical-align: top; }
.data-table th { background: var(--highlight); font-weight: 700; color: var(--secondary); }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
.principle { background: rgba(255, 252, 247, .9); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }
.principle b { font-family: var(--serif); font-weight: 500; color: var(--primary); font-size: 1.6rem; display: block; }

/* ---------- Footer ---------- */
.site-footer { background: var(--secondary); color: var(--surface); padding: 4.5rem 0 2rem; margin-top: 2rem; }
.site-footer a { color: var(--highlight); text-decoration-color: var(--accent); }
.site-footer a:hover { color: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); gap: 2.5rem; }
.site-footer h2 { font-family: var(--sans); font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; font-size: .93rem; }
.site-footer li { padding: .25rem 0; }
.footer-brand p { color: var(--highlight); font-size: .93rem; max-width: 34ch; }
.footer-brand .brand { color: var(--surface); margin-bottom: 1rem; }
.footer-brand .brand-text small { color: var(--highlight); }
.footer-brand .brand-mark { box-shadow: 4px 4px 0 rgba(255, 252, 247, .15); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--highlight); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--accent); }
.footer-contact { font-size: .9rem; color: var(--highlight); }
.footer-contact address { font-style: normal; }
.footer-notices { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255, 252, 247, .2); display: grid; gap: 1rem; font-size: .84rem; color: var(--highlight); line-height: 1.65; }
.footer-notices p { margin: 0; }
.footer-notices strong { color: var(--accent); }
.footer-base { margin-top: 2rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .82rem; color: var(--highlight); }

/* ---------- Cookie banner & modal ---------- */
.cookie-banner {
  position: fixed; z-index: 120; left: 1rem; right: 1rem; bottom: 1rem;
  max-width: 980px; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--primary);
  border-radius: 14px; box-shadow: var(--shadow-lift);
  padding: 1.3rem 1.5rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.2rem; align-items: center;
  animation: fadeUp .6s var(--ease);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; font-size: .92rem; color: var(--secondary); }
.cookie-banner strong { color: var(--text); font-family: var(--serif); font-weight: 500; font-size: 1.1rem; display: block; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.modal-overlay { position: fixed; inset: 0; z-index: 130; background: rgba(48, 42, 37, .55); display: grid; place-items: center; padding: 1rem; }
.modal-overlay[hidden] { display: none; }
.modal {
  width: min(560px, 100%); max-height: 90vh; overflow: auto;
  background: var(--surface); border-radius: 14px; border: 1px solid var(--border);
  padding: 2rem; box-shadow: var(--shadow-lift); animation: fadeUp .4s var(--ease);
}
.modal h2 { font-size: 1.8rem; }
.pref { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px dashed var(--border); }
.pref p { margin: .2rem 0 0; font-size: .88rem; color: var(--secondary); }
.switch { position: relative; width: 52px; height: 30px; flex: 0 0 52px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background .3s; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); transition: transform .3s var(--ease); box-shadow: 0 2px 4px rgba(48, 42, 37, .3); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:disabled + span { opacity: .6; }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; margin-top: 1.4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .habit-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .control-row { grid-template-columns: 1fr 1fr; }
  .control-row .field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .section-head, .guide-split, .page-hero-grid, .detail-hero, .detail-grid, .guide-layout, .about-grid, .guide-feature { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-grid > .card:first-child { grid-row: auto; }
  .detail-hero-media { aspect-ratio: 16 / 10; }
  .float-panel, .guide-toc { position: static; }
  .guide-feature .media { aspect-ratio: 16 / 9; }
  .f5, .f6 { display: none; }
  .hero-badge { right: 4%; bottom: 3%; width: 100px; height: 100px; }
  .hero-badge .badge-core { inset: 27px; font-size: 1.2rem; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--border); display: none; padding: .8rem 1.25rem 1.2rem; box-shadow: var(--shadow-soft); }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { display: block; }
  .f2, .f4 { display: none; }
  .f1 { top: 2%; left: -4%; opacity: .55; }
  .f3 { top: auto; bottom: 2%; right: -6%; opacity: .55; }
  .shape { display: none; }
  .search-row { flex-direction: column; }
  .cookie-banner { grid-template-columns: 1fr; }
  .two-col, .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .spec-grid { grid-template-columns: 1fr; }
  .spec-grid .span-2 { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .habit-cols { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .control-row, .footer-grid { grid-template-columns: 1fr; }
  .card-body { margin-left: .5rem; padding: 1.2rem 1rem 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .mask-line > span { transform: none; }
  .hero-sub, .search-panel, .hero-actions { opacity: 1; }
}