/* tom · temple of mine — shared styles, v3 */

:root {
  --bg: #F2EDE4;
  --bg-soft: #EDE7DC;
  --ink: #1F1B17;
  --ink-deep: #14110E;
  --stone: #5A5751;
  --stone-quiet: #8A857B;
  --ember: #8C4530;
  --highlight: #C8E0CB;     /* soft mint for accent pill, like Onno */
  --serif: 'Cormorant Garamond', Georgia, serif;
  --display: 'Libre Caslon Display', 'Libre Caslon Text', Georgia, serif;
  --caslon: 'Libre Caslon Text', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 2px;
  z-index: 100;
}

.skip-link:focus { top: 1rem; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

/* === Header — centered nav, Onno-style === */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
  position: relative;
}

.site-header-brand {
  position: absolute;
  left: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.site-header-brand img {
  width: 26px;
  height: 26px;
  mix-blend-mode: multiply;
}

.site-header-brand .name {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.site-nav a {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  padding: 0.5rem 0;
  position: relative;
}

.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); }

.site-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--ember);
}

.site-status {
  position: absolute;
  right: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 400;
}

.site-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ember);
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* === Main === */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 4rem;
}

.section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 1.5rem;
}

.section.dark {
  background: var(--ink-deep);
  color: var(--bg);
}

.section.dark .eyebrow { color: var(--highlight); }
.section.dark .section-title { color: var(--bg); }
.section.dark p { color: rgba(242, 237, 228, 0.8); }
.section.dark .accent { color: var(--bg); }

.container {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.container-wide {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

/* === Typography === */
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 1.25rem;
  font-weight: 500;
  text-align: center;
}

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.15;
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-title em {
  font-style: italic;
  color: var(--ember);
}

.section-title .pill {
  display: inline-block;
  background: var(--highlight);
  color: var(--ink);
  padding: 0.05em 0.5em;
  border-radius: 999px;
  font-style: italic;
  font-size: 0.95em;
  margin: 0 0.1em;
}

.section-lede {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.75;
  color: var(--stone);
  text-align: center;
  max-width: 580px;
  margin: 0 auto 2.5rem;
}

.section.dark .section-lede { color: rgba(242, 237, 228, 0.7); }

.section-lede .quiet {
  font-style: italic;
}

/* === Three-column grid (Onno style) === */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-top: 3rem;
}

.col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.col-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ember);
}

.section.dark .col-icon { color: var(--highlight); }

.col-icon svg { width: 100%; height: 100%; }

.col-title {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 0.6rem;
  line-height: 1.2;
  font-weight: 400;
}

.section.dark .col-title { color: var(--bg); }

.col-note {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--stone);
}

.section.dark .col-note { color: rgba(242, 237, 228, 0.7); }

/* === Marker === */
.marker {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 500;
  text-align: center;
}

.marker .dot {
  color: var(--ember);
  margin: 0 0.6em;
  opacity: 0.7;
}

.section.dark .marker { color: rgba(242, 237, 228, 0.5); }
.section.dark .marker .dot { color: var(--highlight); }

/* === Newsletter form === */
.form-section {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.form-label {
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 1rem;
  font-weight: 500;
  text-align: center;
}

.form-note {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--stone);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-style: italic;
  text-align: center;
}

.form {
  display: flex;
  border: 1px solid rgba(31, 27, 23, 0.25);
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.3);
  transition: border-color 0.4s ease, background 0.4s ease;
}

.form:focus-within {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
}

.form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  padding: 1rem 1.25rem;
  font-weight: 400;
  min-width: 0;
}

.form input::placeholder {
  color: var(--stone);
  opacity: 0.85;
}

.form button {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(31, 27, 23, 0.18);
  color: var(--ember);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 0 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
  font-weight: 500;
  white-space: nowrap;
  min-height: 48px;
}

.form button:hover {
  background: rgba(140, 69, 48, 0.08);
  color: var(--ink);
}

.form.sent { border-color: var(--ember); pointer-events: none; }
.form.sent input, .form.sent button {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.form-success {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease 0.3s;
}

.form-wrapper { position: relative; }
.form-wrapper.sent .form-success { opacity: 1; }

/* On dark sections, lighten the form */
.section.dark .form {
  border-color: rgba(242, 237, 228, 0.25);
  background: rgba(242, 237, 228, 0.05);
}
.section.dark .form input { color: var(--bg); }
.section.dark .form input::placeholder { color: rgba(242, 237, 228, 0.5); }
.section.dark .form button { color: var(--highlight); border-left-color: rgba(242, 237, 228, 0.15); }
.section.dark .form-note { color: rgba(242, 237, 228, 0.7); }
.section.dark .form-label { color: rgba(242, 237, 228, 0.6); }
.section.dark .form-success { color: var(--bg); }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ink);
  border: 1px solid var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 0.95rem 1.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 999px;
  min-height: 44px;
  font-weight: 500;
  text-decoration: none;
}

.btn:hover {
  background: var(--ember);
  border-color: var(--ember);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  background: transparent;
  color: var(--ember);
  border-color: var(--ember);
}

.section.dark .btn {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--bg);
}

.section.dark .btn:hover {
  background: var(--highlight);
  border-color: var(--highlight);
}

.section.dark .btn-ghost {
  background: transparent;
  color: var(--bg);
  border-color: rgba(242, 237, 228, 0.4);
}

.section.dark .btn-ghost:hover {
  color: var(--highlight);
  border-color: var(--highlight);
}

/* === Crisis note === */
.crisis-note {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--stone);
  line-height: 1.6;
  text-align: center;
  margin-top: 2.5rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.section.dark .crisis-note { color: rgba(242, 237, 228, 0.5); }

.crisis-note a {
  color: var(--ember);
  text-decoration: underline;
  text-decoration-color: rgba(140, 69, 48, 0.4);
  text-underline-offset: 3px;
}

.section.dark .crisis-note a { color: var(--highlight); text-decoration-color: rgba(200, 224, 203, 0.4); }

.crisis-note a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.section.dark .crisis-note a:hover { color: var(--bg); text-decoration-color: var(--bg); }

/* === Footer === */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2.5rem;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 400;
}

.site-footer .footer-left {
  font-family: var(--sans);
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
  color: var(--stone);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-footer .footer-left .sub {
  font-family: var(--caslon);
  font-style: italic;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  text-transform: lowercase;
  color: var(--stone-quiet);
  font-weight: 400;
}

.site-footer .footer-right {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.site-footer .footer-right a {
  color: var(--ember);
  text-decoration: underline;
  text-decoration-color: rgba(140, 69, 48, 0.4);
  text-underline-offset: 3px;
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.site-footer .footer-right a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.site-footer .footer-right .meta { color: var(--stone); }

/* === Animations === */
@keyframes appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.appear-1 { opacity: 0; animation: appear 1.2s ease-out 0.1s forwards; }
.appear-2 { opacity: 0; animation: appear 1.2s ease-out 0.3s forwards; }
.appear-3 { opacity: 0; animation: appear 1.2s ease-out 0.5s forwards; }
.appear-4 { opacity: 0; animation: appear 1.2s ease-out 0.7s forwards; }
.appear-5 { opacity: 0; animation: appear 1.2s ease-out 0.9s forwards; }

/* === Responsive === */
@media (max-width: 820px) {
  .site-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
  }
  .site-header-brand { position: static; }
  .site-status { position: static; }
  .site-nav { gap: 1.75rem; }
  .three-col {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .section { padding: 3rem 1.25rem; }
  .site-footer {
    padding: 1.5rem 1.25rem;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .site-footer .footer-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .appear-1, .appear-2, .appear-3, .appear-4, .appear-5 { opacity: 1 !important; }
  .site-status-dot { animation: none; opacity: 0.85; }
}

@media (prefers-contrast: more) {
  :root {
    --stone: #2C2A24;
    --ember: #6B3520;
  }
  .form { border-color: var(--ink); }
}
