:root {
  color-scheme: light;
  --cream-50: oklch(98% 0.009 88);
  --cream-100: oklch(95% 0.014 88);
  --cream-200: oklch(89% 0.018 88);
  --forest-900: oklch(27% 0.052 154);
  --forest-800: oklch(34% 0.061 154);
  --forest-700: oklch(41% 0.065 154);
  --forest-100: oklch(92% 0.025 154);
  --coffee-950: oklch(22% 0.035 55);
  --coffee-700: oklch(40% 0.03 55);
  --coffee-500: oklch(55% 0.025 55);
  --maple-600: oklch(48% 0.16 28);
  --error-700: oklch(43% 0.16 28);
  --font-display: Georgia, 'Times New Roman', serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --space-xs: .25rem;
  --space-sm: .5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --radius-sm: .35rem;
  --radius-md: .65rem;
  --content: 84rem;
  --focus: 0 0 0 .2rem oklch(75% 0.12 28 / .48);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream-50);
  color: var(--coffee-950);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.5;
  min-width: 20rem;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--forest-800); text-underline-offset: .2em; }
a:hover { color: var(--forest-700); }
:focus-visible { outline: .15rem solid var(--maple-600); outline-offset: .2rem; }
button:disabled { cursor: not-allowed; opacity: .48; }

.skip-link {
  background: var(--forest-900);
  color: var(--cream-50);
  left: 1rem;
  padding: .75rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 600;
}
.skip-link:focus { top: 1rem; }
.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.masthead {
  align-items: center;
  background: var(--cream-50);
  border-bottom: 1px solid var(--cream-200);
  display: flex;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: .75rem max(1rem, calc((100vw - var(--content)) / 2));
  position: relative;
  z-index: 10;
}
.brand {
  align-items: center;
  color: var(--forest-900);
  display: inline-flex;
  font-size: 1.05rem;
  font-weight: 750;
  gap: .7rem;
  text-decoration: none;
}
.brand-mark { color: var(--maple-600); font-size: 1.45rem; line-height: 1; }
.masthead-actions { align-items: center; display: flex; gap: 1rem; }
.masthead-actions a, .text-button {
  background: none;
  border: 0;
  color: var(--forest-900);
  font-weight: 650;
  min-height: 2.75rem;
  padding: .55rem .35rem;
  text-decoration: none;
}
.text-button:hover, .masthead-actions a:hover { color: var(--maple-600); }

.hero {
  border-bottom: 1px solid var(--cream-200);
  display: grid;
  margin: 0 auto;
  max-width: var(--content);
  overflow: hidden;
  padding: var(--space-2xl) 1rem var(--space-xl);
  position: relative;
}
.hero-copy { max-width: 47rem; position: relative; z-index: 2; }
.hero-art { color: var(--forest-700); opacity: .28; pointer-events: none; }
.landscape { display: block; height: auto; width: 100%; }
.eyebrow {
  color: var(--maple-600);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .11em;
  margin: 0 0 var(--space-sm);
  text-transform: uppercase;
}
h1, h2, h3 { margin-top: 0; text-wrap: balance; }
.hero h1, .profile-shell h1 {
  color: var(--coffee-950);
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: .98;
  margin-bottom: var(--space-lg);
}
.hero-intro { color: var(--coffee-700); font-size: 1.1rem; margin: 0 0 var(--space-xl); max-width: 62ch; }

.filters { display: grid; gap: var(--space-md); }
.filters label, .login-form label {
  display: block;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .07em;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
}
input, select {
  background: oklch(99% 0.006 88);
  border: 1px solid var(--coffee-500);
  border-radius: var(--radius-sm);
  color: var(--coffee-950);
  min-height: 3.1rem;
  padding: .7rem .85rem;
  width: 100%;
}
input::placeholder { color: oklch(49% 0.02 55); }
input:hover, select:hover { border-color: var(--forest-700); }
input:focus, select:focus { border-color: var(--forest-700); box-shadow: var(--focus); outline: 0; }
.secondary-button, .primary-button, .login-form button {
  align-items: center;
  border-radius: var(--radius-sm);
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 3.1rem;
  padding: .7rem 1rem;
  text-decoration: none;
}
.secondary-button { align-self: end; background: transparent; border: 1px solid var(--forest-800); color: var(--forest-900); }
.secondary-button:hover:not(:disabled) { background: var(--forest-100); }
.primary-button, .login-form button { background: var(--forest-900); border: 1px solid var(--forest-900); color: var(--cream-50); }
.primary-button:hover, .login-form button:hover:not(:disabled) { background: var(--forest-800); color: var(--cream-50); }

.province-index {
  display: flex;
  gap: .35rem;
  margin: 0 auto;
  max-width: var(--content);
  overflow-x: auto;
  padding: .8rem 1rem;
  scrollbar-width: thin;
}
.province-chip {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--forest-900);
  display: flex;
  flex: 0 0 auto;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .5rem .75rem;
}
.province-chip strong { font-variant-numeric: tabular-nums; }
.province-chip:hover { background: var(--forest-100); }
.province-chip.active { background: var(--forest-900); color: var(--cream-50); }

.directory-results { border-top: 1px solid var(--cream-200); margin: 0 auto; max-width: var(--content); padding: var(--space-xl) 1rem var(--space-3xl); }
.results-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: var(--space-md); }
.results-heading h2 { color: var(--forest-900); font-family: var(--font-display); font-size: 1.8rem; font-weight: 500; margin: 0; }
.results-heading > p { color: var(--coffee-700); font-size: .9rem; font-variant-numeric: tabular-nums; margin: 0; }
.results-list { border-top: 1px solid var(--cream-200); }
.roaster-row {
  align-items: center;
  border-bottom: 1px solid var(--cream-200);
  color: inherit;
  display: grid;
  gap: var(--space-md);
  min-height: 7rem;
  padding: var(--space-md) .25rem;
  text-decoration: none;
}
.roaster-row:hover { background: var(--cream-100); color: inherit; }
.roaster-name { color: var(--forest-900); font-size: 1.05rem; font-weight: 800; }
.roaster-location { color: var(--coffee-700); display: flex; font-size: .9rem; gap: .5rem; }
.roaster-location abbr { text-decoration: none; }
.roaster-summary { color: var(--coffee-700); display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.row-arrow { border: 1px solid var(--forest-800); border-radius: var(--radius-sm); color: var(--forest-900); display: grid; font-size: 1.3rem; height: 2.75rem; place-items: center; width: 2.75rem; }
.pagination { align-items: center; display: flex; gap: var(--space-md); justify-content: center; padding-top: var(--space-xl); }
.pagination button { background: transparent; border: 1px solid var(--coffee-500); border-radius: var(--radius-sm); color: var(--forest-900); min-height: 2.75rem; padding: .55rem .9rem; }
.pagination span { font-size: .9rem; font-variant-numeric: tabular-nums; }
.empty-state { max-width: 38rem; padding: var(--space-2xl) 0; }
.empty-state h3 { color: var(--forest-900); font-family: var(--font-display); font-size: 1.8rem; font-weight: 500; margin-bottom: var(--space-sm); }

.about-section { background: var(--forest-900); color: var(--cream-100); padding: var(--space-3xl) max(1rem, calc((100vw - var(--content)) / 2)); }
.about-section .eyebrow { color: oklch(75% 0.12 28); }
.about-section h2 { font-family: var(--font-display); font-size: 2rem; font-weight: 500; margin-bottom: var(--space-md); }
.about-section p:last-child { color: oklch(88% 0.015 154); margin: 0; max-width: 70ch; }
.site-footer { background: var(--forest-900); border-top: 1px solid oklch(88% 0.015 154 / .2); color: oklch(88% 0.015 154); padding: var(--space-lg) max(1rem, calc((100vw - var(--content)) / 2)); }
.site-footer p { font-size: .85rem; margin: 0; }

.profile-shell { margin: 0 auto; max-width: var(--content); min-height: calc(100vh - 4.5rem); padding: var(--space-2xl) 1rem var(--space-3xl); }
.back-link { display: inline-block; font-weight: 700; margin-bottom: var(--space-2xl); }
.profile-shell h1 { max-width: 18ch; }
.profile-grid { border-top: 1px solid var(--cream-200); display: grid; gap: var(--space-2xl); padding-top: var(--space-xl); }
.profile-grid h2 { color: var(--forest-900); font-family: var(--font-display); font-size: 1.65rem; font-weight: 500; }
.profile-summary { color: var(--coffee-700); font-family: var(--font-display); font-size: 1.35rem; line-height: 1.6; margin: 0; max-width: 62ch; }
.profile-facts { background: var(--cream-100); border: 1px solid var(--cream-200); border-radius: var(--radius-md); padding: var(--space-lg); }
.profile-facts dl { margin: 0 0 var(--space-lg); }
.profile-facts dl div { border-bottom: 1px solid var(--cream-200); padding: .8rem 0; }
.profile-facts dt { color: var(--coffee-700); font-size: .75rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.profile-facts dd { margin: .2rem 0 0; overflow-wrap: anywhere; }
.not-found { max-width: 54rem; }
.not-found > p:not(.eyebrow) { color: var(--coffee-700); max-width: 60ch; }

.login-page { background: var(--forest-900); }
.login-shell { display: grid; min-height: 100vh; padding: 1rem; place-items: center; }
.login-panel { background: var(--cream-50); border-radius: var(--radius-md); box-shadow: 0 1.5rem 4rem oklch(13% 0.025 154 / .28); max-width: 32rem; padding: var(--space-2xl); width: 100%; }
.login-panel h1 { font-family: var(--font-display); font-size: 2.2rem; font-weight: 500; line-height: 1.05; }
.login-panel > p:not(.eyebrow) { color: var(--coffee-700); }
.login-form { display: grid; gap: var(--space-md); margin-top: var(--space-xl); }
.form-error { color: var(--error-700); font-weight: 650; margin: 0; }

.loading-state { margin: 0 auto; max-width: var(--content); padding: var(--space-3xl) 1rem; }
.skeleton { animation: pulse 1.2s ease-in-out infinite alternate; background: var(--cream-200); border-radius: var(--radius-sm); }
.skeleton-title { height: 5rem; max-width: 34rem; }
.skeleton-control { height: 3.1rem; margin: var(--space-xl) 0; max-width: 48rem; }
.skeleton-row { height: 6rem; margin-top: var(--space-md); }
@keyframes pulse { to { background: var(--cream-100); } }

@media (min-width: 44rem) {
  .hero { grid-template-columns: minmax(25rem, 1.05fr) minmax(20rem, .95fr); padding-top: var(--space-3xl); }
  .hero h1, .profile-shell h1 { font-size: 4.25rem; }
  .hero-art { align-self: end; }
  .filters { grid-template-columns: minmax(15rem, 2fr) minmax(11rem, 1fr) minmax(11rem, 1fr) auto; }
  .search-control { grid-column: 1 / -1; }
  .roaster-row { grid-template-columns: minmax(13rem, 1.05fr) minmax(9rem, .7fr) minmax(18rem, 1.6fr) 2.75rem; min-height: 5.6rem; }
  .roaster-location { display: grid; grid-template-columns: 1fr auto; }
  .profile-grid { grid-template-columns: minmax(0, 1.65fr) minmax(18rem, .7fr); }
}

@media (min-width: 68rem) {
  .hero h1, .profile-shell h1 { font-size: 5rem; }
  .hero { min-height: 31rem; }
}

@media (max-width: 43.99rem) {
  .masthead { align-items: flex-start; gap: .6rem; }
  .brand { max-width: 13rem; }
  .masthead-actions { gap: .35rem; }
  .masthead-actions a { display: none; }
  .hero-art { margin-top: var(--space-xl); }
  .results-heading { align-items: flex-start; flex-direction: column; gap: var(--space-sm); }
  .roaster-row { grid-template-columns: 1fr auto; }
  .roaster-location, .roaster-summary { grid-column: 1; }
  .row-arrow { grid-column: 2; grid-row: 1 / span 3; }
  .login-panel { padding: var(--space-xl); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
