/* Flaming Clay Ceramics — Design System v2 (white & cobalt)
   Source: DESIGN.md + design_handoff_ceramics_design_system/README.md */

:root {
  --page: #FFFFFF;
  --paper: #FAFAF8;
  --border: #DCE3F0;
  --cobalt-ink: #0E1730;
  --cobalt-deep: #16265C;
  --cobalt: #2B4C9B;
  --cobalt-mid: #7C93C4;
  --cobalt-muted: #7C8AAB;
  --success: #5B8A7A;
  --warning: #B99259;
  --error: #A2565C;
  --info: #5C79C4;

  --font-display: 'Satoshi', 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --space-2xs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-body);
  background: var(--page);
  color: var(--cobalt);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--cobalt); text-decoration: none; transition: color 100ms var(--ease-out); }
a:hover { color: var(--cobalt-deep); }

img { max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding-left: 56px; padding-right: 56px; }

@media (max-width: 1200px) {
  .container { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 768px) {
  .container { padding-left: 20px; padding-right: 20px; }
}

/* ---------- Header ---------- */

.site-header {
  height: 64px;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.site-header .header-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.avatar-frame {
  flex: none;
  width: 34px;
  height: 34px;
  filter: drop-shadow(1.5px 2px 2.5px rgba(22, 38, 92, 0.2));
}
.avatar-frame .avatar-clip {
  width: 100%;
  height: 100%;
  clip-path: polygon(2% 3%, 22% 0%, 48% 2%, 72% 0%, 98% 3%, 100% 26%, 97% 52%, 100% 76%, 98% 98%, 72% 100%, 48% 97%, 24% 100%, 2% 98%, 0% 74%, 3% 50%, 0% 25%);
  background: var(--paper);
  padding: 3px;
}
.avatar-frame img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-full); }

.header-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--cobalt-deep);
  white-space: nowrap;
}

.header-divider {
  flex: none;
  width: 1px;
  height: 14px;
  background: var(--border);
}

.header-location {
  font-size: 14px;
  color: var(--cobalt-muted);
  white-space: nowrap;
}

.site-header .header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.site-nav {
  display: flex;
  gap: 20px;
}
.site-nav a {
  font-size: 15px;
  color: var(--cobalt-muted);
  white-space: nowrap;
  padding-bottom: 2px;
}
.site-nav a.active {
  color: var(--cobalt);
  border-bottom: 1.5px solid var(--cobalt);
}
.site-nav a:hover { color: var(--cobalt); }

.btn-cta {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  color: #FFFFFF;
  background: var(--cobalt);
  padding: 9px 17px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  border: none;
  cursor: pointer;
  display: inline-block;
  transition: background 100ms var(--ease-out);
}
.btn-cta:hover { background: var(--cobalt-deep); color: #FFFFFF; }

.nav-toggle {
  display: none;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -12px;
  padding: 12px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle .bar {
  width: 19px;
  height: 1.5px;
  background: var(--cobalt);
}
.nav-toggle .bars { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Moon jar background (shared across pages) ---------- */

.moonjar-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  z-index: 0;
}

/* Any in-flow content after .moonjar-bg must get a stacking context above
   it explicitly — a fixed z-index:0 element paints after normal in-flow
   content in CSS's stacking order, so without this, <main> renders UNDER
   the fixed background on pages where real content lives in <main>
   (gallery.html, ask.html) rather than inside .moonjar-content. */
main {
  position: relative;
  z-index: 1;
}
.moonjar-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 88% 15%;
  display: block;
}

/* Home page: the jar sits near the top of the first screen. The photo is cropped to one viewport
   (cover) and shifted so the rim is high on the page, not pushed down by the photo's full height. */
.moonjar-bg--full { height: 100vh; }
.moonjar-bg--full .moonjar-bg-img { object-fit: cover; object-position: 50% 28%; }
.moonjar-bg-wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #FFFFFF 0%, rgba(255,255,255,.94) 38%, rgba(255,255,255,.55) 58%, rgba(255,255,255,0) 76%);
}

.moonjar-content {
  position: relative;
  z-index: 1;
  padding-top: var(--space-3xl);
}

.wordmark-lockup {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 56px;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--cobalt-deep);
}
.wordmark-line { display: inline-flex; align-items: baseline; gap: 5px; }
.flame-mark {
  display: inline-block;
  width: 20px;
  height: auto;
  transform: translateY(1px);
}
.wordmark-mark {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 0.18em;
}

.site-nav-v3 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}
.site-nav-v3 a {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.5;
  color: var(--cobalt);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.site-nav-v3 a:hover {
  border-bottom-color: var(--cobalt);
}
.site-nav-v3 a.active {
  color: var(--cobalt-deep);
  border-bottom-color: var(--cobalt-deep);
}
.nav-ig { display: inline-flex; align-items: center; border-bottom: none !important; padding-bottom: 0 !important; opacity: 0.85; }
.nav-ig:hover { opacity: 1; border-bottom: none !important; }

.moonjar-content { padding-bottom: var(--space-3xl); }

.contact-header {
  max-width: 640px;
  margin-top: 0;
}
.contact-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--cobalt-deep);
  margin-bottom: var(--space-sm);
}
.contact-header .tagline {
  font-size: 18px;
  color: var(--cobalt);
}

.contact-card {
  max-width: 640px;
  margin-top: var(--space-xl);
}

@media (max-width: 768px) {
  .moonjar-content { padding-top: var(--space-2xl); }
  .wordmark-lockup { font-size: 32px; }
  .site-nav-v3 { gap: var(--space-md); margin-top: var(--space-xl); }
  .site-nav-v3 a { font-size: 18px; }
  .contact-header { margin-top: 0; }
  .contact-header h1 { font-size: 32px; }
}

/* ---------- Page shell: persistent left nav ---------- */

.page-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 56px;
  padding-top: var(--space-2xl);
}

.sidebar {
  flex: none;
  width: 176px;
  position: sticky;
  top: var(--space-2xl);
}
.sidebar .wordmark-lockup {
  font-size: 26px;
  line-height: 1.08;
  margin-bottom: var(--space-xl);
}
.sidebar .wordmark-mark { width: 0.55em; height: 0.55em; }
.sidebar .flame-mark { width: 20px; height: auto; }
.sidebar .site-nav-v3 { margin-top: 0; gap: var(--space-sm); }
.sidebar .site-nav-v3 a { font-size: 16px; }

.page-content { flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .page-shell { flex-direction: column; align-items: stretch; gap: var(--space-lg); padding-top: var(--space-lg); }
  .sidebar { width: 100%; position: static; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-md); }
  /* One baseline for FLAMING, CLAY and the flame; word gap and flame gap
     are the same, and the flame scales with the type like it does on desktop. */
  .sidebar .wordmark-lockup { margin-bottom: var(--space-md); flex-direction: row; align-items: baseline; gap: 0.2em; font-size: 22px; }
  .sidebar .wordmark-line { gap: 0.2em; }
  .sidebar .flame-mark { width: 0.77em; height: auto; }
  .sidebar .site-nav-v3 { flex-direction: row; flex-wrap: wrap; gap: var(--space-md); }
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 64px;
  align-items: end;
  padding-top: 88px;
  padding-bottom: 96px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cobalt-muted);
  margin-bottom: var(--space-md);
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--cobalt-deep);
  margin-bottom: var(--space-md);
}

.hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--cobalt);
  max-width: 440px;
  margin-bottom: var(--space-xl);
}

.torn-frame {
  filter: drop-shadow(3px 5px 6px rgba(22, 38, 92, 0.15));
}
.torn-frame .torn-clip {
  background: var(--paper);
  padding: 16px 16px 18px;
}
.torn-frame img {
  display: block;
  width: 100%;
  object-fit: cover;
}

.hero-image-frame { aspect-ratio: 4 / 5; }
.hero-image-frame .torn-clip {
  clip-path: polygon(1.5% 2%, 20% 0%, 46% 3%, 70% 0.5%, 98.5% 2%, 100% 26%, 98% 52%, 100% 76%, 98% 98%, 74% 100%, 50% 97%, 26% 100%, 2% 98%, 0% 74%, 2.5% 50%, 0% 26%);
  height: 100%;
}
.hero-image-frame img { aspect-ratio: 4 / 5; height: 100%; }

/* ---------- Hero (text-only, homepage) ---------- */

.hero-solo {
  padding-top: 0;
  padding-bottom: 56px;
  max-width: 640px;
}
.hero-fullscreen {
  min-height: calc(100vh - 340px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 900px) {
  .hero-fullscreen { min-height: 70vh; }
}
.hero-solo .btn-cta { margin-top: var(--space-md); display: inline-block; }

@media (max-width: 768px) {
  .hero-solo { padding-top: 40px; padding-bottom: 32px; }
}

/* ---------- Section headers (Recent Work, etc.) ---------- */

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.025em;
  color: var(--cobalt-deep);
}
.section-link { font-size: 15px; color: var(--cobalt-muted); }
.section-link:hover { color: var(--cobalt); }

.recent-work-grid {
  column-count: 3;
  column-gap: var(--space-lg);
  padding-bottom: var(--space-3xl);
}
.recent-work-grid .gallery-item {
  break-inside: avoid;
  margin-bottom: var(--space-lg);
}
@media (max-width: 768px) {
  .recent-work-grid { column-count: 2; }
}
@media (max-width: 480px) {
  .recent-work-grid { column-count: 1; }
}

/* ---------- Collection page header (Folsom) ---------- */

.collection-header {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border);
}
.collection-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cobalt-muted);
  margin-bottom: var(--space-sm);
}
.collection-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--cobalt-deep);
  margin-bottom: var(--space-md);
}
.collection-header-text {
  margin-top: var(--space-xl);
}
.collection-header-text p:not(.collection-eyebrow) {
  font-size: 17px;
  line-height: 1.65;
  color: var(--cobalt);
  max-width: 64ch;
}
.collection-header-text p:not(.collection-eyebrow) + p {
  margin-top: var(--space-md);
}

/* Collage: a short horizontal strip of cropped event photos. The source
   photos are small (360x480), so tiles stay modest in size. */
.collage {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.8fr 1.3fr;
  grid-template-rows: 150px 150px;
  gap: 6px;
  max-width: 820px;
}
.collage-tile {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.collage-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.t-booth  { grid-column: 1; grid-row: 1 / 3; }
.t-booth img  { object-position: 40% 62%; }
.t-purple { grid-column: 2; grid-row: 1 / 3; }
.t-purple img { object-position: 45% 60%; }
.t-cup1   { grid-column: 3; grid-row: 1; }
.t-cup1 img   { object-position: 50% 55%; }
.t-cup2   { grid-column: 3; grid-row: 2; }
.t-cup2 img   { object-position: 35% 50%; }
.t-table  { grid-column: 4; grid-row: 1; }
.t-table img  { object-position: 55% 78%; }
.t-bronze { grid-column: 4; grid-row: 2; }
.t-bronze img { object-position: 40% 58%; }

@media (max-width: 768px) {
  .collection-header { padding-top: 0; }
  .collection-header h1 { font-size: 32px; }
  .collage {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 80px 80px 110px 90px;
  }
  .t-booth  { grid-column: 1 / 4; grid-row: 1 / 3; }
  .t-purple { grid-column: 1; grid-row: 3; }
  .t-cup1   { grid-column: 2; grid-row: 3; }
  .t-cup2   { grid-column: 3; grid-row: 3; }
  .t-table  { grid-column: 1 / 3; grid-row: 4; }
  .t-bronze { grid-column: 3; grid-row: 4; }
}

.gallery-notice {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cobalt-muted);
  padding-bottom: var(--space-3xl);
}

.gallery-empty {
  column-span: all;
  font-size: 17px;
  color: var(--cobalt-muted);
  padding: var(--space-xl) 0;
}

/* ---------- Residency Globe ---------- */

.globe-section {
  border-top: 1px solid var(--border);
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-3xl);
}

.globe-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.globe-visual {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1;
  margin: 0 auto;
}
.globe-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(22, 38, 92, 0.2));
  display: block;
}
.globe-visual img.hidden { display: none; }

.globe-pin {
  position: absolute;
  display: flex;
  align-items: center;
  transform: translate(-50%, -50%);
}
/* Anchor on the dot itself; the label hangs off to the right so its
   length never shifts where the dot sits on the globe. */
.globe-pin .label {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}
.globe-pin .dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--cobalt);
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 2px 5px rgba(22, 38, 92, 0.45);
  flex: none;
}
.globe-pin .label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cobalt-deep);
  background: rgba(255, 255, 255, 0.9);
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.residency-panel-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cobalt-muted);
  margin-bottom: var(--space-sm);
}

.residency-city {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  letter-spacing: -0.025em;
  color: var(--cobalt-deep);
  margin-bottom: var(--space-sm);
}

.residency-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-md);
}

.dashed-field {
  border: 1px dashed var(--cobalt-mid);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cobalt-mid);
}

.residency-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--cobalt);
  max-width: 440px;
  margin-bottom: var(--space-lg);
  text-wrap: pretty;
}

.residency-specs {
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
  margin-bottom: var(--space-lg);
}
.residency-spec-row {
  display: flex;
  gap: var(--space-md);
  font-size: 14px;
  padding: var(--space-xs) 0;
}
.residency-spec-row .label {
  min-width: 104px;
  flex: none;
  color: var(--cobalt-muted);
}

.residency-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.residency-progress .pill {
  display: inline-block;
  width: 26px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: background 250ms var(--ease-in-out);
}
.residency-progress .pill.active { background: var(--cobalt); }
.residency-progress .hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--cobalt-muted);
  margin-left: var(--space-sm);
}

.residency-advance-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.globe-visual { cursor: pointer; }
.residency-progress .pill-btn { background: none; border: none; padding: 6px 2px; cursor: pointer; }

.residency-spec-row .value { color: var(--cobalt); }
.spec-link { position: relative; color: var(--cobalt); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 2px; }
.spec-link:hover { text-decoration-color: var(--cobalt); }
.spec-preview {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 140px;
  height: 140px;
  background: var(--page);
  border: 1px dashed var(--cobalt-mid);
  border-radius: var(--radius-sm);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  text-align: center;
  z-index: 5;
  box-shadow: 0 4px 16px rgba(22,38,92,0.12);
}
.spec-link:hover .spec-preview { display: flex; }
.spec-preview-ph {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cobalt-muted);
}
.residency-spec-row .value.dashed {
  border: 1px dashed var(--cobalt-mid);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cobalt-mid);
  display: inline-block;
}

/* ---------- Gallery ---------- */

.gallery-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding: var(--space-2xl) 0 var(--space-lg);
  border-bottom: 1px solid var(--border);
  margin-bottom: 44px;
}

.gallery-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  letter-spacing: -0.025em;
  color: var(--cobalt-deep);
}

.filter-chips {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.filter-chip {
  font-size: 14px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: none;
  color: var(--cobalt-muted);
  cursor: pointer;
  font-family: var(--font-body);
}
.filter-chip.active {
  background: var(--cobalt);
  color: #FFFFFF;
  border-color: var(--cobalt);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-lg);
  align-items: start;
  padding-bottom: var(--space-3xl);
}

.gallery-item {
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--border);
}
.gallery-item .media {
  position: relative;
  overflow: hidden;
}
.gallery-item .media img {
  display: block;
  width: 100%;
  height: auto;
}
.gallery-item .media .placeholder-image {
  position: relative;
  aspect-ratio: 4 / 5;
}
.gallery-item.sold .media img {
  filter: grayscale(0.25) opacity(0.75);
}
.gallery-item .price-tag {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  background: var(--cobalt);
  padding: 6px 12px 6px 10px;
  border-radius: 0 0 var(--radius-md) 0;
}
.gallery-item.sold .price-tag {
  background: var(--cobalt-muted);
}
.gallery-item .band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.gallery-item .piece-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.005em;
  color: var(--cobalt-deep);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-item.sold .piece-title { color: var(--cobalt-muted); }

/* Desktop/hover-capable: same band + price-tag styling as mobile, but overlaid on
   the image and hidden until hover/focus instead of sitting permanently below it. */
@media (hover: hover) and (pointer: fine) {
  .gallery-item .band {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--paper);
    opacity: 0;
    transition: opacity 150ms var(--ease-out);
  }
  .gallery-item .price-tag {
    opacity: 0;
    transition: opacity 150ms var(--ease-out);
  }
  .gallery-item:hover .band,
  .gallery-item:focus-within .band,
  .gallery-item:hover .price-tag,
  .gallery-item:focus-within .price-tag { opacity: 1; }
}

.gallery-item.empty .piece-title,
.gallery-item.empty .piece-materials { color: var(--cobalt-muted); }

.placeholder-image {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, #EDF1F9 0 8px, #F8FAFD 8px 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}
.placeholder-image .chip {
  background: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cobalt-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}

/* 12-col spans set inline per item per spec; span classes as fallback */
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.offset-top-1 { margin-top: 56px; }
.offset-top-2 { margin-top: 16px; }
.offset-top-3 { margin-top: 32px; }
.offset-top-4 { margin-top: 40px; }

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid .gallery-item { grid-column: span 3 !important; margin-top: 0 !important; }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid .gallery-item { grid-column: span 1 !important; }
}

/* ---------- Empty states ---------- */

.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--cobalt-muted);
  font-size: 16px;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 0;
  text-align: center;
  color: var(--cobalt-muted);
  font-size: 14px;
}

/* ---------- Responsive: Header + Hero ---------- */

@media (max-width: 768px) {
  .site-header { height: 52px; }
  .header-location, .site-header .header-right .btn-cta { display: none; }
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .avatar-frame { width: 26px; height: 26px; }
  .avatar-frame .avatar-clip { padding: 2px; }
  .header-name { font-size: 14px; }

  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding: 36px 20px 30px;
  }
  .hero-eyebrow { font-size: 10px; letter-spacing: 0.14em; }
  .hero-headline { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .btn-cta.hero-cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 24px;
  }

  .globe-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  .residency-city { font-size: 28px; }
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 14px 20px;
  font-size: 16px;
  color: var(--cobalt);
  border-top: 1px solid var(--border);
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ---------- Contact / Ask form elements (shared) ---------- */

.card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
}
.card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--cobalt-deep);
  margin-bottom: var(--space-xs);
}
.card .hint { color: var(--cobalt-muted); font-size: 0.95rem; margin-bottom: var(--space-lg); }

label { display: block; margin-bottom: var(--space-xs); font-size: 0.95rem; color: var(--cobalt-deep); }
input, textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--cobalt-deep);
  background: var(--page);
}
input:focus, textarea:focus { outline: 2px solid var(--cobalt-mid); outline-offset: 1px; }
.field { margin-bottom: var(--space-md); }

.status { display: none; margin-top: var(--space-md); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.95rem; }
.status.success { display: block; background: #EAF2EF; color: var(--success); }
.status.error { display: block; background: #F7EAEB; color: var(--error); }
.btn-cta:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Email signup strip ---------- */

.signup-strip {
  max-width: 420px;
  margin: var(--space-2xl) 0 var(--space-xl);
}

.signup-strip p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--cobalt);
  margin-bottom: var(--space-sm);
}

.waitlist-form {
  display: flex;
  flex-direction: row;
  gap: var(--space-sm);
}

.waitlist-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-body);
}

.waitlist-form input:focus {
  outline: 2px solid var(--cobalt-mid);
  outline-offset: 1px;
}

.waitlist-form button {
  padding: 8px 16px;
  background: var(--cobalt-deep);
  color: var(--page);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.waitlist-form button:hover {
  background: var(--cobalt);
}

.waitlist-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-message {
  min-height: 24px;
  font-size: 14px;
  margin-top: var(--space-md);
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--error);
}


/* ---------- Product page ---------- */

.product-page { margin-top: var(--space-2xl); }
.product-back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cobalt);
  text-decoration: none;
  margin-bottom: var(--space-lg);
}
.product-back:hover { color: var(--cobalt-deep); }
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--space-2xl);
  align-items: start;
}
@media (max-width: 760px) { .product-layout { grid-template-columns: 1fr; gap: var(--space-xl); } }
.product-main {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  background: #fff;
}
.product-thumbs { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-sm); }
.product-thumb {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  opacity: 0.7;
}
.product-thumb.active, .product-thumb:hover { opacity: 1; border-color: var(--cobalt); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--cobalt-deep);
  margin-bottom: var(--space-sm);
}
.product-status {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin-bottom: var(--space-sm);
}
.product-status.sold { color: var(--cobalt-muted); }
.product-price { font-size: 20px; color: var(--cobalt-deep); margin-bottom: var(--space-lg); }
.product-buy {
  display: inline-block;
  padding: 10px 28px;
  background: var(--cobalt-deep);
  color: var(--page);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: var(--space-lg);
}
.product-buy:hover { background: var(--cobalt); }
.product-desc p { font-size: 16px; line-height: 1.6; color: var(--cobalt); margin-bottom: var(--space-md); }

/* ---------- Masonry grid (gallery.js layoutGallery) ----------
   gallery.js places each card in the shortest column, newest first, so the
   newest pieces fill the top rows. Replaces the CSS-columns fallback above
   once the feed has loaded. */
.recent-work-grid.masonry {
  column-count: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
}
.masonry-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.recent-work-grid.masonry .gallery-item { margin-bottom: 0; }

.collection-jump {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cobalt);
  padding: 8px 0;
}
.collection-jump:hover { color: var(--cobalt-deep); }
#gallery { scroll-margin-top: var(--space-lg); }

.product-buy-bar { display: none; }

/* ---------- Phones (iPhone 16 is 393pt wide) ---------- */
@media (max-width: 480px) {
  /* Two columns like a standard mobile shop, instead of one full-screen
     photo per scroll. */
  .recent-work-grid { column-count: 2; column-gap: 12px; }
  .recent-work-grid .gallery-item { margin-bottom: 12px; }
  .recent-work-grid.masonry, .masonry-col { gap: 12px; }
  .gallery-item .band { padding: 8px 10px; }
  .gallery-item .piece-title {
    font-size: 12px;
    line-height: 1.3;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .gallery-item .price-tag { font-size: 10px; padding: 4px 8px 4px 7px; }

  /* Nav fits on one row: "Folsom" instead of "Folsom Collection", and taller
     tap targets. */
  .nav-long { display: none; }
  .sidebar .site-nav-v3 { gap: 4px 18px; }
  .sidebar .site-nav-v3 a { padding: 6px 0; }
  .sidebar .wordmark-lockup { margin-bottom: 4px; }

  /* Product page: photo leaves room for title + price on the first screen;
     Buy lives in a bar pinned to the bottom. */
  .product-page { margin-top: var(--space-md); padding-bottom: 88px; }
  .product-back { margin-bottom: var(--space-md); }
  .product-layout { gap: var(--space-lg); }
  .product-main { max-height: 50svh; object-fit: contain; background: transparent; }
  .product-thumb { width: 56px; height: 56px; }
  .product-title { font-size: 26px; }
  .product-info > .product-buy { display: none; }
  .product-buy-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--border);
  }
  .product-buy-bar-price { font-size: 18px; color: var(--cobalt-deep); }
  .product-buy-bar .product-buy {
    flex: 1;
    margin: 0;
    text-align: center;
    padding: 14px 20px;
    font-size: 16px;
  }
}

/* ---------- Kiln Finder (firings.html) ----------
   Built to design_handoff_kiln_finder (turn 3). Status uses one cobalt hue in
   six weights (handoff's five plus "Full"); DESIGN.md allows no other hues. */
.kf-header { margin-bottom: var(--space-lg); }
.kf-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--cobalt-muted); }
.kf-eyebrow-gap { margin-top: var(--space-lg); margin-bottom: var(--space-sm); }
.kf-header h1 {
  font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 1.04;
  letter-spacing: -0.03em; color: var(--cobalt-deep); margin: var(--space-sm) 0;
}
.kf-sub { font-size: 18px; color: var(--cobalt); max-width: 560px; text-wrap: pretty; }
.kf-note { font-size: 13px; line-height: 1.5; color: var(--cobalt-muted); margin-top: var(--space-sm); }
/* The page intro is real information (coverage, how to report a missing kiln): full-contrast cobalt, not muted. */
.kf-header .kf-note { font-size: 14px; color: var(--cobalt); max-width: 640px; }
.kf-note a, .kf-ai-foot a, .kf-linkish { color: var(--cobalt); text-decoration: underline; text-underline-offset: 2px; }
.kf-linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* Two rows: what kind of firing, then where (state + near). */
.kf-filters {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-md);
  padding-bottom: var(--space-lg); margin-bottom: var(--space-lg); border-bottom: 1px solid var(--border);
}
.kf-where { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.kf-near { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kf-near-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--cobalt-muted); }
.kf-input, .kf-select {
  font: 15px var(--font-body); color: var(--cobalt-deep); background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px; min-height: 40px;
}
.kf-input { width: 124px; }
.kf-input:focus, .kf-select:focus { outline: 2px solid var(--cobalt-mid); outline-offset: 1px; }
.kf-locate { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--cobalt); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.kf-near-status { font-size: 13px; color: var(--cobalt-muted); flex-basis: 100%; }
.kf-near-status:empty { display: none; }

.kf-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-lg); align-items: start; }
.kf-map-wrap { position: relative; height: 600px; position: sticky; top: var(--space-lg); }
.kf-map { height: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; z-index: 0; background: #F8FAFD; }
.kf-tiles { filter: grayscale(1) contrast(.9) brightness(1.06); }
.kf-legend {
  position: absolute; top: 12px; right: 12px; z-index: 500; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--cobalt);
}
.kf-legend span { display: flex; align-items: center; gap: 8px; }
.kf-legend .kf-pin { position: static; transform: none; }

/* Pins: same dot as the bio globe's .globe-pin */
.kf-pin-wrap { position: relative; }
.kf-pin { position: absolute; transform: translate(-50%, -50%); display: block; border-radius: 50%; box-sizing: content-box; transition: transform 100ms var(--ease-out); }
.kf-pin-match { width: 13px; height: 13px; background: var(--cobalt); border: 2.5px solid #fff; box-shadow: 0 2px 5px rgba(22,38,92,.45); }
.kf-pin-other { width: 9px; height: 9px; background: var(--cobalt-mid); border: 2px solid #fff; }
.kf-pin-selected { width: 15px; height: 15px; background: var(--cobalt-deep); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(22,38,92,.5); }
.kf-pin.is-private { outline: 1px dashed var(--cobalt-mid); outline-offset: 3px; }
.kf-pin.is-hover { transform: translate(-50%, -50%) scale(1.35); }
.kf-pin-label {
  position: absolute; left: 14px; top: -10px; white-space: nowrap; font-family: var(--font-mono); font-size: 11px;
  color: var(--cobalt-deep); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 6px;
}

.kf-seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: var(--radius-full); padding: 3px; margin-bottom: var(--space-md); }
.kf-seg button { font: 15px var(--font-body); color: var(--cobalt-muted); background: none; border: 0; border-radius: var(--radius-full); padding: 8px 12px; min-height: 40px; cursor: pointer; }
.kf-seg button.active { background: var(--cobalt); color: #fff; }
.kf-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); margin-bottom: 12px; }
.kf-list-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--cobalt-deep); letter-spacing: -0.01em; }
.kf-sort { font-size: 13px; color: var(--cobalt-muted); white-space: nowrap; }
.kf-list { display: flex; flex-direction: column; gap: 12px; }
.kf-empty { color: var(--cobalt-muted); padding: var(--space-md) 0; }

.kf-card {
  width: 100%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); color: inherit;
  transition: border-color 100ms var(--ease-out), box-shadow 100ms var(--ease-out);
}
.kf-card-head {
  position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; padding: 14px 40px 14px 16px;
  background: none; border: 0; border-radius: var(--radius-md); cursor: pointer; font: inherit; color: inherit;
}
.kf-chevron { position: absolute; right: 16px; top: 20px; width: 8px; height: 8px; border-right: 2px solid var(--cobalt); border-bottom: 2px solid var(--cobalt); transform: rotate(45deg); transition: transform 150ms var(--ease-out); }
.kf-card.is-selected .kf-chevron { transform: rotate(-135deg); top: 24px; }
.kf-card-body { padding: 0 16px 16px; border-top: 1px solid var(--border); animation: kf-open 200ms var(--ease-out); }
@keyframes kf-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.kf-addr { font-size: 15px; color: var(--cobalt); margin-top: var(--space-md); }
.kf-card-body .kf-who, .kf-card-body .kf-tags, .kf-card-body .kf-key { margin-top: var(--space-sm); }
.kf-card-body .kf-actions { margin-top: var(--space-md); }
.kf-card:hover { border-color: var(--cobalt-mid); }
.kf-card.is-selected { border-color: var(--cobalt); box-shadow: 0 4px 16px rgba(22,38,92,.08); }
.kf-card.is-dashed { border-style: dashed; border-color: var(--cobalt-mid); }
.kf-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-sm); }
.kf-card-title { font-family: var(--font-display); font-weight: 500; font-size: 17px; line-height: 1.3; color: var(--cobalt-deep); }
.kf-meta { font-size: 14px; color: var(--cobalt); font-variant-numeric: tabular-nums; }
.kf-who { font-size: 13px; color: var(--cobalt-deep); font-weight: 500; }
.kf-who::before { content: "Who can join: "; font-weight: 400; color: var(--cobalt-muted); }
.kf-key { font-size: 14px; font-weight: 500; color: var(--cobalt-deep); }
.kf-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.kf-tag { font-size: 12px; color: var(--cobalt); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 2px 10px; }
.kf-count { font-family: var(--font-mono); font-size: 11px; color: var(--cobalt-muted); white-space: nowrap; padding-top: 4px; }

.kf-badge {
  font-family: var(--font-mono); font-weight: 500; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 7px; border-radius: var(--radius-sm); white-space: nowrap; flex: none; border: 1px solid transparent;
}
.kf-open { background: var(--cobalt); color: #fff; }
.kf-opens_soon { border-color: var(--cobalt); color: var(--cobalt); }
.kf-waitlist { background: #EDF1F9; border-color: var(--cobalt-mid); color: var(--cobalt-deep); }
.kf-full { background: #F8FAFD; border-color: var(--border); color: var(--cobalt-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.kf-ongoing { border-color: var(--border); color: var(--cobalt); }
.kf-students, .kf-members_only, .kf-invitation_only, .kf-residents_only { background: #F8FAFD; border-color: var(--border); color: var(--cobalt-muted); }
/* Handoff spec'd Cobalt Mid text here; Cobalt keeps it legible at 10.5px. */
.kf-more_info { border: 1px dashed var(--cobalt-mid); color: var(--cobalt); font-weight: 400; }

.kf-precision { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--cobalt-muted); margin-left: 6px; }
.kf-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin: var(--space-md) 0; padding-bottom: var(--space-md); border-bottom: 1px solid var(--border); }
.kf-actions .btn-cta { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.kf-btn-ghost {
  font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--cobalt); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 17px; min-height: 40px; display: inline-flex; align-items: center; gap: 4px; text-decoration: none;
}
.kf-btn-ghost:hover { border-color: var(--cobalt-mid); }
.kf-follow { margin-top: var(--space-md); }
.kf-rows { display: flex; flex-direction: column; gap: 8px; margin: var(--space-md) 0; }
.kf-row { display: grid; grid-template-columns: 104px 1fr; gap: var(--space-md); font-size: 14px; }
.kf-row dt { color: var(--cobalt-muted); }
.kf-row dd { color: var(--cobalt); }
.kf-ai { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; margin: var(--space-md) 0; }
.kf-ai-head { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cobalt); display: flex; align-items: center; gap: 8px; }
.kf-ai-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cobalt); }
.kf-ai-body { font-size: 15px; line-height: 1.5; color: var(--cobalt-deep); margin-top: 8px; }
.kf-ai-foot { font-family: var(--font-mono); font-size: 10.5px; color: var(--cobalt-muted); margin-top: 8px; overflow-wrap: anywhere; }
.kf-links { list-style: none; border-top: 1px solid var(--border); }
.kf-links a { display: flex; justify-content: space-between; gap: var(--space-sm); padding: 12px 0; min-height: 44px; border-bottom: 1px solid var(--border); color: var(--cobalt); font-size: 15px; text-decoration: none; overflow-wrap: anywhere; }
.kf-links a:hover span:first-child { text-decoration: underline; }
.kf-unknowns { font-size: 14px; color: var(--cobalt); padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.kf-mini { display: flex; flex-direction: column; gap: 8px; }
.kf-mini-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; font: 14px var(--font-body); color: var(--cobalt-deep); cursor: pointer; }
.kf-mini-row:hover { border-color: var(--cobalt-mid); }
.kf-clayai { display: inline-block; margin-top: var(--space-lg); color: var(--cobalt); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1100px) {
  .kf-body { grid-template-columns: 1fr; }
  .kf-map-wrap { position: relative; top: 0; height: 50svh; min-height: 320px; }
}
@media (max-width: 900px) {
  .kf-filters { align-items: stretch; }
  /* Phone: state on its own line, then Near as one line (label above, field, locate, distance). */
  .kf-where { flex-direction: column; align-items: stretch; gap: var(--space-sm); }
  .kf-near { display: grid; grid-template-columns: 1fr 44px auto; gap: 6px; }
  .kf-near-label { grid-column: 1 / -1; }
  .kf-near .kf-input { width: 100%; min-width: 0; }
  .kf-near-status { grid-column: 1 / -1; }
  .kf-header h1 { font-size: 32px; }
  .filter-chip { min-height: 44px; flex: none; }
  /* Phone: firing types in one swipeable row, so results start higher on the screen. */
  #kf-types { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--space-md)); padding-right: var(--space-md); }
  #kf-types::-webkit-scrollbar { display: none; }
  .kf-map-wrap { height: 38svh; min-height: 240px; }
  /* 16px stops iOS Safari zooming the page when a field is focused; 44px is a comfortable tap target. */
  .kf-input, .kf-select { font-size: 16px; min-height: 44px; }
  .kf-locate { width: 44px; height: 44px; }
  /* Legend: small strip along the bottom of the map so it no longer hides a third of it. */
  .kf-legend { top: auto; right: auto; bottom: 8px; left: 8px; flex-direction: row; gap: 10px; padding: 6px 10px; font-size: 11px; }
}

/* ---------- Tools section (tools.html + sidebar sub-links) ---------- */
.nav-sub { display: flex; flex-direction: column; gap: 6px; padding-left: 12px; margin: -2px 0 4px; border-left: 1px solid var(--border); }
.sidebar .site-nav-v3 .nav-sub a { font-size: 14px; }
@media (max-width: 900px) {
  .nav-sub { display: none; }
}
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg); margin-top: var(--space-lg); }
.tool-card {
  display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  color: inherit; text-decoration: none; background: #fff; transition: border-color 100ms var(--ease-out), box-shadow 100ms var(--ease-out);
}
.tool-card:hover { border-color: var(--cobalt-mid); box-shadow: 0 4px 16px rgba(22,38,92,.08); }
.tool-preview { position: relative; height: 240px; background: var(--paper); border-bottom: 1px solid var(--border); overflow: hidden; }
.tool-preview-tag {
  position: absolute; top: 12px; left: 12px; z-index: 500; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--cobalt); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px 7px;
}
.tool-preview-chat { display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-sm); padding: 48px var(--space-lg) var(--space-lg); height: auto; min-height: 240px; }
.tool-msg { padding: 10px 14px; border-radius: var(--radius-md); max-width: 85%; line-height: 1.45; font-size: 14px; }
.tool-msg-user { align-self: flex-end; background: var(--cobalt); color: #fff; }
.tool-msg-ai { align-self: flex-start; background: #fff; color: var(--cobalt-deep); border: 1px solid var(--border); }
.tool-map { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.tool-map .leaflet-control-attribution { font-size: 9px; }
.tool-card-text { padding: var(--space-lg); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tool-card-text h2 { font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: -0.02em; color: var(--cobalt-deep); }
.tool-card-text p:not(.kf-eyebrow) { font-size: 15px; line-height: 1.55; color: var(--cobalt); }
.tool-link { margin-top: auto; padding-top: var(--space-sm); font-family: var(--font-display); font-weight: 500; color: var(--cobalt); }
.tool-card:hover .tool-link { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .tools-grid { grid-template-columns: 1fr; }
  .tool-preview { height: 200px; }
  .tool-preview-chat { height: auto; min-height: 0; }
}

.kf-evidence { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--cobalt-deep); }
.kf-evidence a, .kf-ai-foot a { color: var(--cobalt); text-underline-offset: 3px; }
.kf-quote { font-size: 14px; line-height: 1.5; color: var(--cobalt); margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--border); }

/* Map clusters: one cobalt hue (DESIGN.md), white ring like the pins, count in mono. */
.kf-cluster-wrap { background: none; border: 0; }
.kf-cluster {
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--cobalt); color: #fff; font: 500 13px var(--font-mono); font-variant-numeric: tabular-nums;
  border: 3px solid #fff; box-shadow: 0 0 0 1px var(--cobalt-mid), 0 2px 8px rgba(22,38,92,.25); cursor: pointer;
  transition: transform 100ms var(--ease-out);
}
.kf-cluster:hover { transform: scale(1.08); }

/* "Is this listing wrong?" flag and its thank-you popup */
.kf-flag { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 0; font: inherit; color: var(--cobalt); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.kf-flag:hover, .kf-flag:focus-visible { color: var(--cobalt-muted, var(--cobalt)); }
.kf-flag-ic { flex: none; }
.kf-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 24, 40, 0.45); }
.kf-modal-card { position: relative; max-width: 380px; width: 100%; background: #fff; color: #1b1e2b; border-radius: 10px; padding: 28px 24px 22px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); }
.kf-modal-card h3 { margin: 0 24px 10px 0; font-size: 18px; line-height: 1.3; }
.kf-modal-card p { margin: 0; font-size: 15px; line-height: 1.5; }
.kf-modal-card a { color: var(--cobalt); text-underline-offset: 3px; }
.kf-modal-x { position: absolute; top: 6px; right: 8px; width: 36px; height: 36px; border: 0; background: none; font-size: 26px; line-height: 1; color: #555; cursor: pointer; border-radius: 6px; }
.kf-modal-x:hover, .kf-modal-x:focus-visible { background: #eee; }
.kf-modal-card textarea { width: 100%; margin: 12px 0 0; padding: 10px 12px; font: inherit; font-size: 15px; line-height: 1.4; border: 1px solid #c9cde0; border-radius: 8px; resize: vertical; box-sizing: border-box; }
.kf-modal-card textarea:focus { outline: 2px solid var(--cobalt); outline-offset: 1px; }
.kf-modal-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.kf-modal-send { background: var(--cobalt); color: #fff; border: 0; border-radius: 8px; padding: 9px 18px; font: inherit; font-size: 15px; cursor: pointer; }
.kf-modal-send:hover, .kf-modal-send:focus-visible { filter: brightness(1.12); }
.kf-modal-sub { margin-top: 14px !important; font-size: 13px !important; color: #555; }

/* Thin line between what you can join now and everything else */
.kf-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; border-top: 1px solid var(--cobalt); position: relative; height: 0; }
.kf-divider span { position: absolute; top: -8px; left: 0; padding: 0 8px 0 0; background: var(--paper, #fff); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--cobalt-muted, var(--cobalt)); }

/* ---------- Phone header and nav (all pages) ----------
   Wordmark on the left, Instagram top-right, five links spread evenly across one row
   with a hairline underneath. Tap targets are 44px tall. */
@media (max-width: 900px) {
  .sidebar { position: relative; top: auto; display: block; } /* top:auto — the desktop sticky offset would otherwise shove it 48px down over the page content */
  .sidebar .wordmark-lockup { font-size: 28px; margin-bottom: var(--space-md); }
  .sidebar .site-nav-v3 {
    flex-wrap: nowrap; justify-content: space-between; align-items: stretch;
    gap: 0; padding-bottom: 2px; border-bottom: 1px solid var(--border);
  }
  .sidebar .site-nav-v3 a:not(.nav-ig) {
    display: inline-flex; align-items: center; min-height: 44px;
    font-family: var(--font-display); font-weight: 500; font-size: 15px; letter-spacing: -0.005em;
    padding: 0 2px; border-bottom: 2px solid transparent; margin-bottom: -2px;
    white-space: nowrap;
  }
  .sidebar .site-nav-v3 a.active { border-bottom-color: var(--cobalt-deep); }
  .sidebar .nav-ig {
    position: absolute; top: -4px; right: 0; width: 44px; height: 44px; justify-content: center;
    border: 1px solid var(--border); border-radius: 50%; background: rgba(255,255,255,.7); opacity: 1;
  }
  .sidebar .nav-ig svg { width: 20px; height: 20px; }
}
@media (max-width: 360px) {
  .sidebar .site-nav-v3 a:not(.nav-ig) { font-size: 14px; }
}

/* ---------- Phone homepage: the whole first screen fits, signup sits at the bottom ----------
   svh = the visible height with Safari's toolbars showing, so "Notify Me" never hides below the fold. */
@media (max-width: 900px) {
  body.home .moonjar-bg--full { height: 100svh; }
  body.home .moonjar-bg-wash {
    background:
      linear-gradient(180deg, #fff 0%, rgba(255,255,255,.9) 24%, rgba(255,255,255,0) 46%, rgba(255,255,255,0) 52%, rgba(255,255,255,.92) 78%, #fff 100%);
  }
  body.home .page-shell { min-height: 100svh; padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom)); }
  body.home .page-content { display: flex; flex-direction: column; flex: 1; }
  body.home .hero-fullscreen { min-height: 0; flex: 1; }
  body.home .signup-strip { max-width: none; margin: 0; }
  body.home .signup-strip p { font-size: 15px; font-weight: 500; color: var(--cobalt-deep); }
  body.home .waitlist-form input,
  body.home .waitlist-form button { min-height: 48px; font-size: 16px; } /* 16px stops iOS zooming on focus */
  body.home .form-message { min-height: 0; margin-top: var(--space-sm); }
}
