/* ===========================================================
   Baskets — warm, woven, editorial blog
   Palette: oat/cream surfaces, clay terracotta accent,
   sage + stone secondaries, deep coffee text
   =========================================================== */

:root,
[data-theme='light'] {
  /* Type scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  /* 4px spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem; --space-20: 5rem; --space-24: 6rem;
  /* Surfaces — warm oat */
  --color-bg: #f6f1e8;
  --color-surface: #fbf8f1;
  --color-surface-2: #fffdf8;
  --color-surface-offset: #efe9dd;
  --color-divider: #e3dccc;
  --color-border: #d8d0bd;

  /* Text — deep coffee */
  --color-text: #2b2620;
  --color-text-muted: #7a6f60;
  --color-text-faint: #b3a992;

  /* Primary — clay terracotta */
  --color-accent: #b85538;
  --color-accent-hover: #9c4528;
  --color-accent-soft: #f1d9cf;

  /* Secondary — sage */
  --color-sage: #5f6b3f;
  --color-sage-soft: #dde2cf;

  /* Tertiary — stone */
  --color-stone: #6b6358;
  --color-stone-soft: #e4ded3;

  /* Tag variants */
  --color-clay-soft: #f1d9cf;

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 70 / 0.06);
  --shadow-md: 0 6px 20px oklch(0.2 0.02 70 / 0.08);
  --shadow-lg: 0 18px 48px oklch(0.2 0.02 70 / 0.14);

  --font-display: 'Fraunces', 'Gowun Batang', Georgia, serif;
  --font-body: 'Pretendard', 'Pretendard Variable', system-ui, sans-serif;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --content-narrow: 680px;
  --content-default: 1080px;
  --content-wide: 1240px;

  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme='dark'] {
  --color-bg: #18130f;
  --color-surface: #1f1915;
  --color-surface-2: #241d18;
  --color-surface-offset: #1c1612;
  --color-divider: #2e2620;
  --color-border: #3a2f28;

  --color-text: #e8e0d2;
  --color-text-muted: #a89b86;
  --color-text-faint: #6f6557;

  --color-accent: #d9774f;
  --color-accent-hover: #e88a5d;
  --color-accent-soft: #3a221b;

  --color-sage: #93a06a;
  --color-sage-soft: #2a2f1e;

  --color-stone: #a89b86;
  --color-stone-soft: #2a2520;

  --color-clay-soft: #3a221b;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 18px 48px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { color-scheme: dark; }
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) { color-scheme: light; }
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  font-feature-settings: 'ss03';
  word-break: keep-all;
  overflow-wrap: anywhere;
}

img, picture, svg, canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
ul { list-style: none; }

h1, h2, h3 { text-wrap: balance; line-height: 1.15; font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; word-break: keep-all; }
p, li, figcaption { text-wrap: pretty; max-width: 72ch; word-break: keep-all; overflow-wrap: anywhere; }

::selection { background: oklch(from var(--color-accent) l c h / 0.25); }

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

a, button, [role='button'], input { transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition); }

.sr-only {
  position: absolute; 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: -9999px; top: 0; z-index: 100;
  background: var(--color-accent); color: #fff; padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--content-default); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: transform 320ms cubic-bezier(0.16,1,0.3,1), border-color var(--transition), box-shadow var(--transition);
}
.header--scrolled { border-color: var(--color-divider); box-shadow: var(--shadow-sm); }
.header--hidden { transform: translateY(-100%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4.25rem; }

.logo { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--color-text); }
.logo-mark { width: 1.9rem; height: 1.9rem; color: var(--color-accent); }
.logo-text { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.02em; }

.nav { display: flex; gap: 2rem; }
.nav a { font-size: 0.95rem; color: var(--color-text-muted); font-weight: 500; }
.nav a:hover { color: var(--color-text); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: var(--radius-full);
  color: var(--color-text-muted); border: 1px solid var(--color-border);
}
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface-offset); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-full);
  font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { border: 1px solid var(--color-border); color: var(--color-text); }
.btn-ghost:hover { border-color: var(--color-text-muted); background: var(--color-surface-offset); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(4rem, 12vw, 8rem) clamp(3rem, 8vw, 5rem);
  overflow: hidden;
}
.hero-inner { max-width: var(--content-narrow); text-align: center; position: relative; z-index: 1; }

.eyebrow {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--color-accent); margin-bottom: 1.25rem;
}
.hero-title {
  font-size: var(--text-3xl);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
}
.hero-title em { font-style: italic; color: var(--color-accent); font-weight: 400; }
.hero-lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 46ch;
  margin-inline: auto;
  margin-bottom: 2.5rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

.hero-weave { position: absolute; inset: auto 0 0 0; height: 6rem; color: var(--color-accent); opacity: 0.35; z-index: 0; }
.hero-weave svg { width: 100%; height: 100%; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 2.5rem; }
.section-title { font-size: var(--text-xl); }
.section-link { font-size: 0.9rem; color: var(--color-accent); font-weight: 600; }
.section-link:hover { color: var(--color-accent-hover); }

/* ---------- Feature card ---------- */
.feature-card {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 3rem;
}
.feature-media { min-height: 280px; }
.feature-media svg { width: 100%; height: 100%; }
.feature-body { padding: clamp(1.5rem, 4vw, 2.75rem); display: flex; flex-direction: column; justify-content: center; }
.feature-title { font-size: var(--text-xl); margin: 0.5rem 0 0.75rem; }
.feature-excerpt { color: var(--color-text-muted); margin-bottom: 1.25rem; }
.read-more { color: var(--color-accent); font-weight: 600; font-size: 0.95rem; }
.read-more:hover { color: var(--color-accent-hover); }

/* ---------- Meta / tags ---------- */
.meta { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.tag {
  display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.2rem 0.6rem; border-radius: var(--radius-full);
  background: var(--color-accent-soft); color: var(--color-accent);
}
.tag-sage { background: var(--color-sage-soft); color: var(--color-sage); }
.tag-clay { background: var(--color-clay-soft); color: var(--color-accent); }
.tag-stone { background: var(--color-stone-soft); color: var(--color-stone); }

/* ---------- Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-media { aspect-ratio: 4 / 3; }
.card-media svg { width: 100%; height: 100%; }
.card-body { padding: 1.5rem; }
.card-title { font-size: var(--text-lg); margin-bottom: 0.5rem; }
.card-excerpt { font-size: 0.95rem; color: var(--color-text-muted); }

/* ---------- About ---------- */
.section-about { background: var(--color-surface); border-block: 1px solid var(--color-divider); }
.about-inner { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(2rem, 6vw, 4rem); align-items: center; }
.about-title { font-size: var(--text-2xl); margin: 0.75rem 0 1.25rem; }
.about-body { color: var(--color-text-muted); margin-bottom: 1rem; }
.about-stats { display: flex; flex-direction: column; gap: 1.5rem; }
.stat { display: flex; flex-direction: column; gap: 0.25rem; padding-left: 1.25rem; border-left: 3px solid var(--color-accent); }
.stat-num { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; color: var(--color-text); }
.stat-label { font-size: 0.85rem; color: var(--color-text-muted); }

/* ---------- Subscribe ---------- */
.section-subscribe { text-align: center; }
.subscribe-inner { max-width: var(--content-narrow); }
.subscribe-title { font-size: var(--text-2xl); margin-bottom: 0.75rem; }
.subscribe-lede { color: var(--color-text-muted); margin-bottom: 2rem; }
.subscribe-form { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; align-items: center; }
.subscribe-form input {
  flex: 1 1 280px; max-width: 360px;
  padding: 0.8rem 1.25rem; border-radius: var(--radius-full);
  background: var(--color-surface); border: 1px solid var(--color-border);
  color: var(--color-text); font-size: 0.95rem;
}
.subscribe-form input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.form-note { width: 100%; margin-top: 0.75rem; font-size: 0.9rem; color: var(--color-sage); min-height: 1.2rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--color-divider); padding-block: 3rem; background: var(--color-surface); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem 2rem; align-items: center; justify-content: space-between; }
.logo-footer { color: var(--color-text); }
.footer-tag { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a { font-size: 0.9rem; color: var(--color-text-muted); }
.footer-nav a:hover { color: var(--color-text); }
.footer-copy { width: 100%; font-size: 0.8rem; color: var(--color-text-faint); border-top: 1px solid var(--color-divider); padding-top: 1.5rem; margin-top: 0.5rem; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .nav { display: none; }
  .feature-card { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; }
  .about-inner { grid-template-columns: 1fr; }
  .about-stats { flex-direction: row; flex-wrap: wrap; gap: 1.5rem 2rem; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-nav { flex-wrap: wrap; }
}
