/* ==========================================================================
   Baselarte — tokens
   Theme is set on <html data-theme> by local time of day (see boot.js / main.js).
   ========================================================================== */

:root {
  --paper: #f3f1ec;
  --ink: #141413;
  --muted: #6c6a65;
  --line: rgba(20, 20, 19, 0.12);

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(20px, 4vw, 48px);
  --column: 40rem;
  --wide: 72rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #0d0d0c;
  --ink: #ebe9e3;
  --muted: #8f8c86;
  --line: rgba(235, 233, 227, 0.12);

  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Smooth cross-fade when the clock crosses 06:00 / 18:00. */
html.theme-transition,
html.theme-transition * {
  transition: background-color 1.2s var(--ease), color 1.2s var(--ease),
    border-color 1.2s var(--ease), stroke 1.2s var(--ease) !important;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
  letter-spacing: 0;
}

h1,
h2,
p,
ul,
figure,
blockquote {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

.monospace-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  max-width: var(--wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) var(--gutter) 24px;
}

.site-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  font-size: 15px;
  color: var(--muted);
}

.site-nav a,
.footer-column a,
.footer-column button {
  transition: color 0.3s var(--ease);
}

.site-nav a:hover,
.footer-column a:hover,
.footer-column button:hover {
  color: var(--ink);
}

.language-toggle {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  transition: border-color 0.3s var(--ease);
}

.language-toggle:hover {
  border-color: var(--ink);
}

/* ==========================================================================
   Hero (centered)
   ========================================================================== */

.hero {
  max-width: 52rem;
  margin: 0 auto;
  padding: clamp(96px, 18vh, 200px) var(--gutter) clamp(72px, 12vh, 140px);
  text-align: center;
}

.hero-title {
  font-weight: 400;
  font-size: clamp(36px, 5.6vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-lede {
  max-width: 34rem;
  margin: clamp(24px, 3vw, 36px) auto 0;
  color: var(--muted);
  font-size: clamp(17px, 1.4vw, 19px);
  text-wrap: pretty;
}

.hero-lede em {
  color: var(--ink);
}

/* ==========================================================================
   Reading column
   ========================================================================== */

.reading-column {
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(96px, 14vh, 160px);
}

.content-section {
  padding-top: clamp(48px, 7vw, 80px);
  margin-top: clamp(48px, 7vw, 80px);
  border-top: 1px solid var(--line);
}

.content-section:first-child {
  margin-top: 0;
}

.content-section h2 {
  font-size: clamp(22px, 2.2vw, 26px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.content-section p {
  text-wrap: pretty;
}

.content-section p + p {
  margin-top: 16px;
}

.practice-list {
  margin-top: 28px;
  display: grid;
  gap: 20px;
}

.practice-list li {
  padding-left: 20px;
  border-left: 1px solid var(--line);
  color: var(--muted);
}

.practice-list li em {
  color: var(--ink);
}

.pull-quote {
  margin: 28px 0;
  padding: clamp(28px, 4vw, 40px) 0;
  border-block: 1px solid var(--line);
  text-align: center;
}

.pull-quote blockquote p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.pull-quote blockquote p::before {
  content: "“";
}

.pull-quote blockquote p::after {
  content: "”";
}

.pull-quote figcaption {
  margin-top: 18px;
  color: var(--muted);
}

.not-found-code {
  color: var(--muted);
  margin-bottom: 24px;
}

.status-section {
  text-align: center;
}

.status-section p {
  color: var(--muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer-grid {
  max-width: var(--wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr));
  gap: 40px 24px;
  padding: clamp(48px, 7vw, 80px) var(--gutter) 48px;
}

.footer-brand {
  display: grid;
  align-content: start;
  gap: 16px;
}

.footer-brand .logo-mark {
  width: 28px;
  height: 28px;
}

.motto {
  font-size: 20px;
  line-height: 1.3;
}

.footer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: var(--muted);
}

.footer-column h2 {
  color: var(--ink);
  margin-bottom: 6px;
}

.footer-column button[aria-pressed="true"] {
  color: var(--ink);
}

.footer-column p {
  font-variant-numeric: tabular-nums;
}

.footer-legal {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 40px);
  color: var(--muted);
}

/* ==========================================================================
   JavaScript-dependent states (classes set by boot.js)
   ========================================================================== */

/* Controls that only work with JavaScript (language switch, local time). */
html:not(.js-enabled) .requires-js {
  display: none;
}

/* Hidden until Motion fades them in. */

.motion-pending [data-animate-intro],
.motion-pending [data-animate-reveal] {
  opacity: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .site-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .site-nav a {
    display: none;
  }
}

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

  .motion-pending [data-animate-intro],
  .motion-pending [data-animate-reveal] {
    opacity: 1;
  }
}
