

/* ─── Colors ─────────────────────────────────── */

:root {
  --bg: #F7F7F4;
  --text: #26251E;
  --text-muted: #43413C;
  --nav-muted: #918a82;
  --text-body: #43413C;
  --border: rgba(20,18,11,0.12);
  --link-border: rgba(20,18,11,0.25);
  --footer-text: #43413C;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120B;
    --text: #EDECEC;
    --text-muted: #8a8580;
    --nav-muted: #8a8580;
    --text-body: #a09a90;
    --border: rgba(237,236,236,0.1);
    --link-border: rgba(237,236,236,0.25);
    --footer-text: #5a5550;
  }
}

[data-theme="dark"] {
  --bg: #14120B;
  --text: #EDECEC;
  --text-muted: #8a8580;
  --nav-muted: #8a8580;
  --text-body: #a09a90;
  --border: rgba(237,236,236,0.1);
  --link-border: rgba(237,236,236,0.25);
  --footer-text: #5a5550;
}

/* ─── Base ───────────────────────────────────── */

body {
  font-family: Georgia, 'Times New Roman', serif !important;
  font-size: 16px;
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: background .3s, color .3s;
}

/* ─── Typography ─────────────────────────────── */
/*
 * Scale:
 *   xs:   0.8rem   (12.8px)  — footer, fine print
 *   sm:   0.875rem (14px)    — nav, header logo, metadata, examples
 *   base: 1rem     (16px)    — body text, definitions, paragraphs
 *   xl:   2rem     (32px)    — page titles (h1)
 *
 * Line heights:
 *   tight: 1.2  — headings
 *   base:  1.6  — body inherited
 *   loose: 1.7  — prose blocks
 */

h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 0.25em; }
h2 { font-size: 1.5rem; line-height: 1.3; margin: 0; }
h3 { font-size: 1rem; line-height: 1.4; margin: 0; font-weight: 600; }
p  { margin: 0; }

/* ─── Links ──────────────────────────────────── */

a {
  color: var(--text);
  text-decoration: none;
}

.link-underline {
  border-bottom: 1px solid var(--link-border);
}
.link-underline:hover {
  border-color: var(--text);
}

.link-muted {
  color: var(--nav-muted);
}
.link-muted:hover {
  color: var(--text);
}

.link-active {
  color: var(--text);
}

.link-footer {
  color: var(--footer-text);
}
.link-footer:hover {
  color: var(--text);
}

/* ─── Layout components ──────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25em 0;
}

.site-header .logo {
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.site-header nav {
  display: flex;
  gap: 1.5em;
}

.site-header nav a {
  font-size: 0.875rem;
}

.site-footer {
  padding: 1.5em 0;
  font-size: 0.8rem;
  color: var(--footer-text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8em;
  flex-wrap: wrap;
}

.site-footer .sep {
  margin: 0 0.2em;
}

/* ─── Content blocks ─────────────────────────── */

.prose {
  margin-top: 1.25em;
  line-height: 1.7;
  color: var(--text-body);
}

.prose p + p {
  margin-top: 1em;
}

.meta {
  margin-top: 0.25em;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.meta .sep {
  margin: 0 0.4em;
}

.definition {
  line-height: 1.7;
  color: var(--text-body);
}

.example {
  margin-top: 0.75em;
  font-style: italic;
  color: var(--text-muted);
}

.example + .prose {
  margin-top: 2em;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1em 0;
}

/* ─── Buttons ────────────────────────────────── */

.get-started {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 400 !important;
  color: var(--bg);
  background: var(--text);
  padding: 0.6em 1.5em;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.get-started:hover {
  opacity: 0.85;
}

/* ─── Forms ──────────────────────────────────── */

.contact-form {
  margin-top: 2em;
  display: flex;
  flex-direction: column;
  gap: 1.25em;
}

.form-row {
  display: flex;
  gap: 1em;
}

.form-row label {
  flex: 1;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.contact-form .optional {
  color: var(--footer-text);
}

.contact-form input:invalid,
.contact-form textarea:invalid {
  box-shadow: none;
}

.contact-form.submitted input:invalid,
.contact-form.submitted textarea:invalid,
.contact-form input.touched:invalid,
.contact-form textarea.touched:invalid {
  border-color: #c45a5a;
}

.contact-form input,
.contact-form textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5em 0.6em;
  background: var(--bg);
  color: var(--text);
  border-width: 1px;
  border-style: solid;
  border-color: var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--text-muted);
}


.contact-form textarea {
  resize: vertical;
}

.contact-form button {
  align-self: flex-start;
  cursor: pointer;
  border: none;
}

.form-success {
  margin-top: 2em;
  color: var(--text-body);
}

.form-error {
  color: #c45a5a;
  font-size: 0.875rem;
}

/* ─── Logo animation ─────────────────────────── */

h1, .logo { perspective: 300px; }

.logo svg, h1 svg {
  transition: transform .7s cubic-bezier(.4, 0, .2, 1);
  transform-style: preserve-3d;
  transform: rotate3d(1, 1, 0, 180deg);
}

.logo:hover svg, h1:hover svg {
  transform: rotate3d(1, 1, 0, 0deg);
}

/* ─── Theme toggle ───────────────────────────── */

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25em;
  color: var(--footer-text);
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--text);
}
