/* worddriftvault.life — RAIN GLASS */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Spectral:ital,wght@0,400;0,600;0,700;1,400&display=swap");

:root {
  --glass-white: #f2f5f7;
  --mist: #dee6ea;
  --rain-blue: #35688c;
  --graphite: #22272c;
  --pencil: #6c777f;
  --step: 24px;
  --max-width: 72rem;
  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --focus-ring: 0 0 0 2px var(--glass-white), 0 0 0 4px var(--rain-blue);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--graphite);
  background: var(--glass-white);
  min-height: 100vh;
  overflow-x: clip;
}

body.cookie-pending {
  padding-bottom: 7rem;
}

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

a {
  color: var(--rain-blue);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--graphite);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--graphite);
  color: var(--glass-white);
}

.skip-link:focus {
  left: 0;
}

/* Step rules + offset blocks (24px steps, max 4 then reset) */
.step-stack {
  display: grid;
  gap: var(--step);
}

.offset-block {
  --offset-steps: 0;
  margin-left: calc(var(--offset-steps) * var(--step));
  padding-left: var(--step);
  border-left: 1px solid var(--mist);
}

.offset-block[data-step="1"] { --offset-steps: 1; }
.offset-block[data-step="2"] { --offset-steps: 2; }
.offset-block[data-step="3"] { --offset-steps: 3; }
.offset-block[data-step="4"] { --offset-steps: 4; }
.offset-block[data-step="0"],
.offset-block[data-step="5"],
.offset-block[data-step="6"],
.offset-block[data-step="7"],
.offset-block[data-step="8"] { --offset-steps: 0; }

.step-rule {
  position: relative;
  padding-top: calc(var(--step) + 0.5rem);
}

.step-rule::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: calc(4 * var(--step));
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--rain-blue) 0,
    var(--rain-blue) var(--step),
    var(--mist) var(--step),
    var(--mist) calc(2 * var(--step)),
    var(--rain-blue) calc(2 * var(--step)),
    var(--rain-blue) calc(3 * var(--step)),
    var(--mist) calc(3 * var(--step)),
    var(--mist) calc(4 * var(--step))
  );
}

.step-rule::after {
  content: attr(data-step-label);
  position: absolute;
  top: 0.35rem;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pencil);
}

/* Layout shells */
.site-header,
.site-footer,
.page-main,
.content-wrap {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.site-header {
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--mist);
}

.site-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--graphite);
  background: var(--glass-white);
  border: 1px solid var(--mist);
  cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--rain-blue);
  color: var(--rain-blue);
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--graphite);
  text-decoration: none;
}

.brand span {
  color: var(--rain-blue);
}

.site-nav ul {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

@media (max-width: 767px) {
  .site-nav ul:not(.nav--open) {
    display: none;
  }

  .site-nav ul.nav--open {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--glass-white);
    border: 1px solid var(--mist);
  }

  .site-nav a {
    display: block;
    padding: 0.35rem 0;
    font-size: 1rem;
  }
}

.site-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--graphite);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--rain-blue);
  border-bottom: 1px solid var(--rain-blue);
}

.nav-tier-two {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--mist);
}

.nav-tier-two ul {
  margin-top: 0;
  gap: 0.35rem 1rem;
}

.nav-tier-two a {
  font-size: 0.8125rem;
  color: var(--pencil);
}

.page-main {
  padding: 2rem 0 4rem;
}

.hero {
  display: grid;
  gap: var(--step);
  margin-bottom: calc(2 * var(--step));
}

.hero-photo {
  margin: 0 0 2rem;
  max-height: 22rem;
  overflow: hidden;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 768px) {
  .hero-photo {
    margin: -2rem 0 2rem;
    border-radius: 0 0 0 3rem;
  }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  font-weight: 700;
  margin: 0;
}

.lead {
  font-size: 1.125rem;
  color: var(--pencil);
  max-width: 42rem;
}

/* Photo frames: 2px mist inset + rain-blue corner rule */
.photo-frame {
  position: relative;
  display: block;
  max-width: 100%;
  background: var(--glass-white);
  box-shadow: inset 0 0 0 2px var(--mist);
}

.photo-frame img {
  width: 100%;
}

.photo-frame::before,
.photo-frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.photo-frame::before {
  top: 8px;
  left: 8px;
  border-top: 2px solid var(--rain-blue);
  border-left: 2px solid var(--rain-blue);
}

.photo-frame::after {
  bottom: 8px;
  right: 8px;
  border-bottom: 2px solid var(--rain-blue);
  border-right: 2px solid var(--rain-blue);
}

.photo-caption {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--pencil);
}

/* Cards */
.card-grid {
  display: grid;
  gap: var(--step);
}

.card {
  padding: var(--step);
  background: var(--glass-white);
  border: 1px solid var(--mist);
}

.card h2,
.card h3 {
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
}

.card p:last-child {
  margin-bottom: 0;
}

/* Articles — outdented first line, no drop-caps */
.article-body {
  max-width: 42rem;
}

.article-body > p:first-of-type {
  text-indent: -1.5em;
  padding-left: 1.5em;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  font-family: var(--font-display);
  line-height: 1.25;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pencil);
  margin-bottom: 1.5rem;
}

/* Map variants — Site B (RAIN GLASS) */
.map-block {
  margin: calc(2 * var(--step)) 0;
}

.map-caption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--pencil);
  margin: 0.75rem 0 0;
}

.map-disclosure {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--mist);
  border-left: 3px solid var(--rain-blue);
  font-size: 0.875rem;
  color: var(--graphite);
}

.map-disclosure[hidden] {
  display: none;
}

.map-embed {
  position: relative;
  width: 100%;
  border: 0;
  background: var(--mist);
}

/* MAP-A — stepped inset card */
.map-a .map-shell {
  padding: var(--step);
  background: var(--glass-white);
  border: 1px solid var(--mist);
  box-shadow: inset 0 0 0 2px var(--mist);
}

.map-a .map-embed {
  height: 320px;
}

/* MAP-B — full-bleed mist rail */
.map-b .map-shell {
  padding-block: var(--step);
  border-block: 1px solid var(--mist);
}

@media (min-width: 768px) {
  .map-b .map-shell {
    margin-inline: calc(-1 * var(--step));
  }
}

.map-b .map-embed {
  height: 280px;
  box-shadow: inset 0 0 0 2px var(--mist);
}

/* MAP-C — narrow side rail */
.map-c .map-shell {
  display: grid;
  gap: 1rem;
}

.map-c .map-embed {
  height: 220px;
  max-width: 100%;
}

@media (min-width: 768px) {
  .map-c .map-shell {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }

  .map-c .map-embed {
    height: 100%;
    min-height: 220px;
  }
}

/* MAP-D — compact footer strip */
.map-d .map-shell {
  padding-top: var(--step);
  border-top: 1px solid var(--mist);
}

.map-d .map-embed {
  height: 180px;
  opacity: 0.95;
}

/* Footer */
.site-footer {
  padding: 2rem 0 5rem;
  border-top: 1px solid var(--mist);
  font-size: 0.875rem;
  color: var(--pencil);
}

.site-footer a {
  color: var(--graphite);
}

.footer-grid {
  display: grid;
  gap: var(--step);
}

.footer-legal {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
}

.btn-primary {
  background: var(--rain-blue);
  color: var(--glass-white);
  border-color: var(--rain-blue);
}

.btn-primary:hover {
  background: var(--graphite);
  border-color: var(--graphite);
  color: var(--glass-white);
}

.btn-secondary {
  color: var(--graphite);
  border-color: var(--mist);
  background: var(--glass-white);
}

.btn-secondary:hover {
  border-color: var(--rain-blue);
  color: var(--rain-blue);
}

.btn-ghost {
  color: var(--rain-blue);
  border-color: transparent;
  text-decoration: underline;
  min-height: auto;
  padding-inline: 0.25rem;
}

/* Cookie banner — glass-white strip, step rule */
.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 9000;
  background: var(--glass-white);
  border-top: 1px solid var(--mist);
  box-shadow: 0 -1px 0 var(--mist);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner__inner {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
  padding: 1rem 0 1.25rem;
}

.cookie-banner__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pencil);
  margin-bottom: 0.5rem;
}

.cookie-banner__text {
  margin: 0 0 1rem;
  max-width: 52rem;
  font-size: 0.9375rem;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cookie-panel {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 9001;
  background: var(--glass-white);
  border-top: 1px solid var(--mist);
  box-shadow: 0 -8px 32px rgba(34, 39, 44, 0.1);
  max-height: min(70vh, 32rem);
  overflow-y: auto;
}

.cookie-panel[hidden] {
  display: none;
}

.cookie-panel__inner {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
  padding: 1.25rem 0 1.5rem;
}

.cookie-panel__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  margin: 0 0 0.75rem;
  color: var(--graphite);
}

.cookie-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.cookie-banner--panel-open .cookie-banner__inner {
  visibility: hidden;
  height: 0;
  padding: 0;
  overflow: hidden;
}

.cookie-toggle--locked .cookie-switch {
  cursor: not-allowed;
}

.cookie-panel fieldset {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

.cookie-panel legend {
  font-family: var(--font-display);
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.cookie-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--mist);
}

.cookie-toggle__name {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
}

.cookie-toggle__desc {
  display: block;
  color: var(--pencil);
  font-size: 0.8125rem;
  margin-top: 0.15rem;
}

.cookie-switch {
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--pencil);
  background: var(--mist);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  padding: 0;
}

.cookie-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--glass-white);
  transition: transform 220ms ease;
}

.cookie-switch--on {
  background: var(--rain-blue);
  border-color: var(--rain-blue);
}

.cookie-switch--on::after {
  transform: translateX(1.2rem);
}

.cookie-switch--locked {
  opacity: 0.85;
  cursor: not-allowed;
}

.cookie-toggle input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--rain-blue);
}

.cookie-toggle input[disabled] {
  opacity: 0.55;
}

/* Responsive breakpoints */
@media (min-width: 768px) {
  .site-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
  }

  .site-header__top {
    flex: 0 0 auto;
  }

  .site-nav {
    flex: 1;
  }

  .site-nav ul {
    margin-top: 0;
    justify-content: flex-end;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr;
  }

  .map-a .map-embed {
    height: 380px;
  }

  .map-b .map-embed {
    height: 340px;
  }
}

@media (min-width: 1440px) {
  :root {
    --max-width: 76rem;
  }

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-a .map-embed {
    height: 420px;
  }
}

@media (max-width: 374px) {
  body {
    font-size: 0.9375rem;
  }

  .cookie-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}
