/* ===== Emerald Thinker — shared styles ===== */
:root {
  /* Tweakable accent — overridden by tweaks panel */
  --accent-h: 155;
  --accent-c: 0.07;
  --accent-l: 0.30;

  --emerald: oklch(var(--accent-l) var(--accent-c) var(--accent-h));
  --emerald-deep: oklch(calc(var(--accent-l) - 0.08) var(--accent-c) var(--accent-h));
  --emerald-soft: oklch(calc(var(--accent-l) + 0.08) calc(var(--accent-c) * 0.9) var(--accent-h));
  --emerald-tint: oklch(0.96 0.012 var(--accent-h));
  --emerald-line: oklch(0.88 0.018 var(--accent-h));

  /* Light theme */
  --bg: oklch(0.975 0.004 var(--accent-h));
  --surface: #ffffff;
  --surface-2: oklch(0.97 0.006 var(--accent-h));
  --ink: oklch(0.18 0.012 var(--accent-h));
  --ink-2: oklch(0.32 0.010 var(--accent-h));
  --ink-3: oklch(0.50 0.008 var(--accent-h));
  --line: oklch(0.90 0.008 var(--accent-h));

  /* Dark theme */
  --d-bg: oklch(0.16 0.012 var(--accent-h));
  --d-surface: oklch(0.20 0.014 var(--accent-h));
  --d-surface-2: oklch(0.23 0.013 var(--accent-h));
  --d-ink: oklch(0.96 0.005 var(--accent-h));
  --d-ink-2: oklch(0.78 0.012 var(--accent-h));
  --d-ink-3: oklch(0.60 0.012 var(--accent-h));
  --d-line: oklch(0.30 0.014 var(--accent-h));

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(20,30,28,0.04), 0 0 0 1px rgba(20,30,28,0.04);
  --shadow: 0 4px 16px -6px rgba(20,30,28,0.10), 0 0 0 1px rgba(20,30,28,0.05);
  --shadow-lg: 0 24px 48px -16px rgba(20,30,28,0.18), 0 0 0 1px rgba(20,30,28,0.05);

  --container: 1200px;
  --container-tight: 1040px;

  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
}
body.dark {
  color: var(--d-ink);
  background: var(--d-bg);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: inherit;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 4.5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.2rem); line-height: 1.15; }
h3 { font-size: 1.25rem; line-height: 1.25; }
h4 { font-size: 1rem; line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.container-tight { max-width: var(--container-tight); margin: 0 auto; padding: 0 28px; }

/* ===== Top nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.dark .nav {
  background: color-mix(in oklab, var(--d-bg) 88%, transparent);
  border-bottom-color: var(--d-line);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.25rem;
  color: var(--emerald);
  display: flex; align-items: center; gap: 10px;
}
.dark .brand { color: var(--emerald-soft); }
.brand-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--emerald);
  display: grid; place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.nav-links {
  display: flex; gap: 28px; align-items: center;
  margin-left: auto;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.dark .nav-links { color: var(--d-ink-2); }
.nav-links a { padding: 6px 2px; position: relative; transition: color .15s; }
.nav-links a:hover { color: var(--emerald); }
.dark .nav-links a:hover { color: var(--emerald-soft); }
.nav-links a.active { color: var(--ink); }
.dark .nav-links a.active { color: var(--d-ink); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 2px; background: var(--emerald);
}
.dark .nav-links a.active::after { background: var(--emerald-soft); }
.nav-icons {
  display: flex; gap: 18px; align-items: center;
  color: var(--ink-2);
}
.dark .nav-icons { color: var(--d-ink-2); }
.nav-icons button {
  background: none; border: 0; padding: 6px;
  color: inherit; display: grid; place-items: center;
  border-radius: 8px; transition: background .15s;
  position: relative;
}
.nav-icons button:hover { background: var(--surface-2); }
.dark .nav-icons button:hover { background: var(--d-surface-2); }
.cart-badge {
  position: absolute; top: 0; right: 0;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--emerald);
  color: #fff;
  font-size: 10px; font-weight: 600;
  display: grid; place-items: center;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 64px 0 28px;
  margin-top: 80px;
}
.dark .footer { background: var(--d-surface); border-top-color: var(--d-line); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-col h5 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.dark .footer-col h5 { color: var(--d-ink-3); }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--ink-2); font-size: 0.9rem; transition: color .15s; }
.footer-col a:hover { color: var(--emerald); }
.dark .footer-col a { color: var(--d-ink-2); }
.dark .footer-col a:hover { color: var(--emerald-soft); }
.footer-tag { color: var(--ink-3); font-size: 0.9rem; max-width: 280px; margin-top: 12px; }
.dark .footer-tag { color: var(--d-ink-3); }
.footer-socials { display: flex; gap: 8px; margin-top: 20px; }
.footer-socials a {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--emerald);
  color: #fff;
}
.footer-help {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.dark .footer-help { background: var(--d-surface-2); border-color: var(--d-line); }
.footer-help h5 {
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 4px;
}
.dark .footer-help h5 { color: var(--d-ink); }
.footer-help p { font-size: 0.85rem; color: var(--ink-3); margin-bottom: 14px; }
.dark .footer-help p { color: var(--d-ink-3); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-size: 0.82rem; color: var(--ink-3);
}
.dark .footer-bottom { border-top-color: var(--d-line); color: var(--d-ink-3); }

/* ===== Newsletter strip (used in journal/gallery) ===== */
.newsletter-strip {
  background: var(--emerald-deep);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px 36px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  margin-top: 56px;
}
.newsletter-strip .mark {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.4);
  display: grid; place-items: center;
}
.newsletter-strip h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.newsletter-strip p { font-size: 0.9rem; color: rgba(255,255,255,0.78); max-width: 460px; }
.newsletter-strip form { display: flex; gap: 8px; }
.newsletter-strip input {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  min-width: 240px;
}
.newsletter-strip input::placeholder { color: rgba(255,255,255,0.6); }
.newsletter-strip button {
  background: #fff;
  color: var(--emerald-deep);
  border: 0;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: transform .12s, background .15s, border-color .15s;
  letter-spacing: 0.01em;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--emerald-deep);
  color: #fff;
  background-image: linear-gradient(180deg, var(--emerald) 0%, var(--emerald-deep) 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.10) inset, 0 6px 20px -6px color-mix(in oklab, var(--emerald) 60%, black);
}
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.dark .btn-secondary {
  background: transparent;
  color: var(--d-ink);
  border-color: var(--d-line);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-lg { padding: 16px 28px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ===== Generic surfaces ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.dark .card { background: var(--d-surface); border-color: var(--d-line); }

/* ===== Page hero (used on gallery/journal/etc.) ===== */
.page-hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: end;
  padding: 56px 0 48px;
}
.page-hero h1 {
  font-size: clamp(3rem, 5vw, 4.2rem);
  letter-spacing: -0.035em;
}
.page-hero .rule {
  width: 80px; height: 2px;
  background: var(--ink-3);
  margin: 18px 0 24px;
}
.dark .page-hero .rule { background: var(--d-ink-3); }
.page-hero p { color: var(--ink-2); max-width: 360px; }
.dark .page-hero p { color: var(--d-ink-2); }

/* ===== Artwork placeholder ===== */
.art-ph {
  position: relative;
  width: 100%;
  background:
    repeating-linear-gradient(135deg,
      oklch(0.30 0.012 var(--accent-h)) 0 12px,
      oklch(0.34 0.014 var(--accent-h)) 12px 24px);
  color: rgba(255,255,255,0.85);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
}
.art-ph::after {
  content: "artwork";
  position: absolute;
  bottom: 10px; left: 12px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.25);
  padding: 3px 8px;
  border-radius: 999px;
}
.art-ph .silhouette {
  width: 60%; height: 60%;
  background: radial-gradient(ellipse at 50% 30%,
    oklch(0.55 0.02 var(--accent-h)) 0%,
    oklch(0.30 0.018 var(--accent-h)) 50%,
    oklch(0.18 0.014 var(--accent-h)) 100%);
  mix-blend-mode: screen;
  opacity: 0.85;
  border-radius: 50%;
  filter: blur(8px);
}
.art-ph.tall { aspect-ratio: 3 / 4; }
.art-ph.square { aspect-ratio: 1 / 1; }
.art-ph.wide { aspect-ratio: 16 / 9; }

/* ===== Forms ===== */
.input, .select, textarea.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: 0;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--emerald) 18%, transparent);
}
.dark .input, .dark .select, .dark textarea.input {
  background: var(--d-surface-2);
  color: var(--d-ink);
  border-color: var(--d-line);
}
.dark .input:focus, .dark .select:focus, .dark textarea.input:focus {
  border-color: var(--emerald-soft);
}
textarea.input { resize: vertical; min-height: 120px; }

.label-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--emerald);
}
.dark .label-eyebrow { color: var(--emerald-soft); }

/* ===== Page wrap ===== */
.page { padding: 32px 0 0; }

/* ===== Tweaks panel container ===== */
#tweaks-root { position: fixed; z-index: 100; }

/* ===== Misc ===== */
.icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 40px; height: 40px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.eyebrow {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--emerald);
}
.dark .eyebrow { color: var(--emerald-soft); }

.muted { color: var(--ink-3); }
.dark .muted { color: var(--d-ink-3); }
