/* styles.css — single static stylesheet, themed via CSS custom properties.
   The Tweaks panel rewrites these vars on :root at runtime. */

:root {
  /* Themes are set via [data-theme] on the html element. Default = ink. */
  --bg: #0e0e0e;
  --bg-2: #161513;
  --fg: #f0ede5;
  --fg-2: rgba(240, 237, 229, 0.62);
  --fg-3: rgba(240, 237, 229, 0.38);
  --rule: rgba(240, 237, 229, 0.14);
  --accent: #e9b384; /* warm peach, low-chroma */
  --accent-soft: rgba(233, 179, 132, 0.18);

  --type-display: "Helvetica Neue", "Inter", "Helvetica", "Arial", system-ui, sans-serif;
  --type-body:    "Helvetica Neue", "Inter", "Helvetica", "Arial", system-ui, sans-serif;
  --type-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --col: 720px;          /* main reading column */
  --pad: clamp(20px, 5vw, 64px);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html[data-theme="cream"] {
  --bg: #f4efe6;
  --bg-2: #ebe5d8;
  --fg: #1a1714;
  --fg-2: rgba(26, 23, 20, 0.62);
  --fg-3: rgba(26, 23, 20, 0.38);
  --rule: rgba(26, 23, 20, 0.14);
  --accent: #b85c2e; /* terracotta */
  --accent-soft: rgba(184, 92, 46, 0.14);
}

html[data-theme="sand"] {
  --bg: #1a1815;
  --bg-2: #221f1a;
  --fg: #e8e2d4;
  --fg-2: rgba(232, 226, 212, 0.62);
  --fg-3: rgba(232, 226, 212, 0.38);
  --rule: rgba(232, 226, 212, 0.14);
  --accent: #c4a875;
  --accent-soft: rgba(196, 168, 117, 0.18);
}

/* Typography variants */
html[data-typography="serif"] {
  --type-display: "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
  --type-body: "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
}
html[data-typography="mix"] {
  --type-display: "Iowan Old Style", "Charter", Georgia, serif;
  --type-body: "Helvetica Neue", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--type-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  overflow-x: hidden;
}

/* ───────── Cursor warmth (radial light that follows the pointer) ───────── */
.cursor-warmth {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(
      600px circle at var(--mx, 50%) var(--my, 50%),
      var(--accent-soft),
      transparent 60%
    );
  opacity: 0;
  transition: opacity 600ms var(--ease);
}
.cursor-warmth.on { opacity: 1; }
@media (hover: none) { .cursor-warmth { display: none; } }
@media (prefers-reduced-motion: reduce) { .cursor-warmth { display: none; } }

/* ───────── Page chrome ───────── */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--col);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) var(--pad) 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: clamp(64px, 14vw, 120px);
}

.mark {
  font-family: var(--type-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--fg-2);
}
.mark .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(233, 179, 132, 0.45); }
  70%  { box-shadow: 0 0 0 12px rgba(233, 179, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(233, 179, 132, 0); }
}

.lang {
  display: inline-flex;
  gap: 0;
  font-family: var(--type-mono);
  font-size: 11px;
  border: 0.5px solid var(--rule);
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
}
.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.04em;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.lang button.on { background: var(--fg); color: var(--bg); }
.lang button:not(.on):hover { color: var(--fg); }

/* ───────── Hero ───────── */
.hero { padding-bottom: clamp(72px, 14vw, 140px); }

.eyebrow {
  font-family: var(--type-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 28px;
}

.headline {
  font-family: var(--type-display);
  font-weight: 700;
  font-size: clamp(40px, 7.4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
  text-wrap: balance;
}
.headline .rotator {
  display: inline-block;
  position: relative;
  color: var(--accent);
  font-style: italic;
  font-weight: 600;
  white-space: nowrap;
}
.headline .rotator-word {
  display: inline-block;
  transition: transform 480ms var(--ease), opacity 480ms var(--ease), filter 480ms var(--ease);
}
.headline .rotator-word.out {
  transform: translateY(-12px);
  opacity: 0;
  filter: blur(4px);
}
.headline .rotator-word.in {
  transform: translateY(12px);
  opacity: 0;
  filter: blur(4px);
}

.sub {
  max-width: 56ch;
  font-size: clamp(17px, 1.7vw, 19px);
  color: var(--fg-2);
  margin: 0;
  text-wrap: pretty;
}

/* ───────── Sections ───────── */
.section {
  padding: clamp(48px, 9vw, 96px) 0;
  border-top: 0.5px solid var(--rule);
}

.section-label {
  font-family: var(--type-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 28px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-label::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--fg-3);
  transform: translateY(-4px);
}

/* Now */
.now-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.now-list li {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--fg);
  text-wrap: pretty;
}
.now-list li::first-letter { color: var(--accent); }

/* About */
.prose p {
  margin: 0 0 1.1em;
  color: var(--fg);
  text-wrap: pretty;
  max-width: 60ch;
}
.prose p:last-child { margin-bottom: 0; }

/* Work */
.work-sub {
  font-family: var(--type-mono);
  font-size: 12px;
  color: var(--fg-2);
  margin: -16px 0 32px;
}
.role {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-top: 0.5px solid var(--rule);
  align-items: baseline;
}
.role:first-of-type { border-top: 0; padding-top: 4px; }
.role-period {
  font-family: var(--type-mono);
  font-size: 12px;
  color: var(--fg-3);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.role-title {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.005em;
  margin: 0 0 6px;
}
.role-body {
  margin: 0;
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}
@media (max-width: 560px) {
  .role { grid-template-columns: 1fr; gap: 4px; }
  .role-period { order: 2; }
}

/* Extras */
.extras {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  color: var(--fg-2);
}
.extras span { text-wrap: pretty; }

/* Contact */
.contact-lines {
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 28px;
  max-width: 32ch;
  text-wrap: balance;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 0.5px solid var(--rule);
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.005em;
  transition: background 220ms var(--ease), border-color 220ms var(--ease), transform 220ms var(--ease);
}
.btn:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.btn .arrow {
  display: inline-block;
  transition: transform 220ms var(--ease);
}
.btn:hover .arrow { transform: translate(2px, -2px); }
.btn.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn.primary:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 56px 0 32px;
  border-top: 0.5px solid var(--rule);
  font-family: var(--type-mono);
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.04em;
}
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--fg); }

/* Reveal-on-scroll: each .reveal child fades + lifts in */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .headline .rotator-word { transition: none; }
}

/* Soft selection */
::selection { background: var(--accent); color: var(--bg); }

/* Imagery placeholder (subtle banded SVG bg w/ mono caption) — currently unused
   in the layout, but kept here in case we add a portrait band later. */
.img-ph {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(
      45deg,
      var(--bg-2),
      var(--bg-2) 8px,
      var(--bg) 8px,
      var(--bg) 16px
    );
  border: 0.5px solid var(--rule);
  border-radius: 6px;
  position: relative;
  color: var(--fg-3);
  font-family: var(--type-mono);
  font-size: 11px;
}
.img-ph::after {
  content: attr(data-label);
  position: absolute;
  inset: auto 12px 10px auto;
}
