/* ==========================================================================
   Alex Grahm — author site
   Palette:  bg #0a0908 | surface #14120f | ink #ece6da | muted #948b7c
             gold #b8934f | oxblood #6b1f27
   Type:     Fraunces (display) / Inter (body) / IBM Plex Mono (meta)
   ========================================================================== */

:root {
  --bg: #0a0908;
  --surface: #141210;
  --surface-raised: #1b1815;
  --ink: #ece6da;
  --muted: #948b7c;
  --muted-dim: #5f584c;
  --gold: #b8934f;
  --gold-bright: #d4ac68;
  --oxblood: #6b1f27;
  --rule: #2a2622;

  --display: "Fraunces", Georgia, serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;

  --spine-width: 64px;
  --max-w: 720px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-left: var(--spine-width);
}

::selection {
  background: var(--gold);
  color: #0a0908;
}

a {
  color: var(--gold-bright);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 147, 79, 0.35);
  transition: border-color 0.2s ease, color 0.2s ease;
}
a:hover {
  border-color: var(--gold-bright);
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

/* ---------- Book spine (signature element) ---------- */

.spine {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--spine-width);
  background: linear-gradient(180deg, #100e0c 0%, #0c0b09 100%);
  border-right: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.spine__name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  white-space: nowrap;
}

.spine__mark {
  position: absolute;
  bottom: 28px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}

@media (max-width: 640px) {
  :root { --spine-width: 40px; }
  .spine__name { font-size: 0.85rem; letter-spacing: 0.08em; }
}

/* ---------- Layout shell ---------- */

.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 88px 0;
  border-bottom: 1px solid var(--rule);
}
section:last-of-type { border-bottom: none; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

/* ---------- Hero ---------- */

.hero {
  padding-top: 120px;
  padding-bottom: 96px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.hero__tagline {
  margin-top: 20px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.05rem;
  font-style: italic;
  font-family: var(--display);
  font-weight: 400;
}

/* ---------- About ---------- */

.about h2 { font-size: 1.9rem; margin-bottom: 24px; }
.about p { max-width: 60ch; color: var(--ink); }
.about p + p { margin-top: 16px; }

/* ---------- Works in progress ---------- */

.works h2 { font-size: 1.9rem; margin-bottom: 28px; }

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.work-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border-left: 2px solid var(--rule);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.work-item:hover {
  border-left-color: var(--gold);
  background: var(--surface-raised);
}

.work-item__title {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink);
}

.work-item__note {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 400;
  font-family: var(--body);
}

.status-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(184, 147, 79, 0.4);
  padding: 4px 10px;
  white-space: nowrap;
  align-self: start;
}

/* ---------- Updates ---------- */

.updates h2 { font-size: 1.9rem; margin-bottom: 28px; }

.updates-list {
  column-count: 2;
  column-gap: 22px;
}

@media (max-width: 560px) {
  .updates-list { column-count: 1; }
}

.update-card {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  display: inline-block;
  width: 100%;
  vertical-align: top;
  margin-bottom: 22px;
  padding: 22px 20px;
  background: var(--surface);
  border-top: 2px solid var(--rule);
  transition: border-color 0.2s ease, background 0.2s ease;

  /* Reveal-on-scroll starting state */
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.2s ease, background 0.2s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.update-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.update-card:hover {
  border-top-color: var(--gold);
  background: var(--surface-raised);
}

.update-card__date {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}

.update-card__title {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.3;
}

.update-card__body {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .update-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Contact ---------- */

.contact h2 { font-size: 1.9rem; margin-bottom: 12px; }
.contact__intro { color: var(--muted); max-width: 50ch; margin-bottom: 32px; }

.form-status {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 12px 16px;
  margin-bottom: 24px;
  border-left: 2px solid var(--gold);
  background: var(--surface);
}
.form-status--error {
  border-left-color: var(--oxblood);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 520px;
}

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.98rem;
  padding: 12px 14px;
  transition: border-color 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 140px;
}

/* honeypot - hidden from real visitors */
.field--hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submit-btn {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 28px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.submit-btn:hover {
  background: var(--gold);
  color: #0a0908;
}

/* ---------- Footer ---------- */

footer {
  padding: 40px 0 60px;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
