/* ---------------------------------------------------------------
   themes.css — four ways to read the same page.

   The HTML never changes. Every theme below re-skins and re-lays-out
   the same semantic markup, which is the constraint that makes this
   worth doing: if a theme needs new elements, the theme is wrong.

   Loaded after styles.css, so [data-theme="x"] wins on source order.
   --------------------------------------------------------------- */

/* The switcher itself. Deliberately theme-agnostic so it stays findable. */

.theme-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 12px rgb(0 0 0 / 0.08);
}

.theme-switch:hover { border-color: var(--accent); }

.theme-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-switch b {
  color: var(--accent);
  font-weight: 600;
}

.theme-switch i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  font-style: normal;
}

@media (max-width: 560px) {
  .theme-switch { top: 0.6rem; right: 0.6rem; padding: 0.4rem 0.7rem; }
  .theme-switch span.label { display: none; }
}

/* ===============================================================
   TERMINAL — everything monospace, output rather than document.
   Section markers become commands; the page reads like a session.
   =============================================================== */

:root[data-theme="terminal"] {
  --bg: #08090b;
  --surface: #0e1014;
  --text: #d3f5dc;
  --muted: #7fa98c;
  --faint: #4d6b57;
  --rule: #1c2620;
  --accent: #43d17c;
  --accent-dim: #10201700;
}

[data-theme="terminal"] body {
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.7;
}

[data-theme="terminal"] .page { max-width: 46rem; }

[data-theme="terminal"] .masthead h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0;
}

[data-theme="terminal"] .masthead h1::before {
  content: "mahd@toronto:~$ whoami\A";
  white-space: pre;
  display: block;
  color: var(--faint);
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}

[data-theme="terminal"] .tagline::before { content: "# "; }

[data-theme="terminal"] .marker {
  border-bottom: 1px dashed var(--rule);
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
}

[data-theme="terminal"] .marker::before {
  content: "$ ";
  color: var(--faint);
}

[data-theme="terminal"] .now li::before,
[data-theme="terminal"] .principles li::before { content: ">"; }

[data-theme="terminal"] .summary {
  border-left: 1px solid var(--accent);
  background: var(--surface);
  padding: 0.7rem 1rem;
}

[data-theme="terminal"] .tags li,
[data-theme="terminal"] .badge {
  border-radius: 0;
  background: transparent;
}

[data-theme="terminal"] .tags li::before { content: "["; }
[data-theme="terminal"] .tags li::after { content: "]"; }

[data-theme="terminal"] .links a,
[data-theme="terminal"] .contact a { border-bottom-color: var(--accent); }
[data-theme="terminal"] .links a::before { content: "→ "; }

[data-theme="terminal"] .theme-switch { border-radius: 0; }

/* ===============================================================
   BRUTALIST — Swiss grid energy. Enormous type, hard edges,
   one loud colour, nothing soft anywhere.
   =============================================================== */

:root[data-theme="brutalist"] {
  --bg: #f2f2ef;
  --surface: #ffffff;
  --text: #000000;
  --muted: #2b2b2b;
  --faint: #767676;
  --rule: #000000;
  --accent: #1b3cff;
  --accent-dim: #dfe4ff;
}

[data-theme="brutalist"] body {
  font-size: 17px;
  line-height: 1.45;
}

[data-theme="brutalist"] .page { max-width: 58rem; }

[data-theme="brutalist"] .masthead h1 {
  font-size: clamp(3rem, 13vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.88;
  text-transform: uppercase;
}

[data-theme="brutalist"] .tagline {
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  display: inline-block;
  padding: 0.25rem 0.6rem;
  margin-top: 1.2rem;
}

[data-theme="brutalist"] .lede {
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 450;
}

[data-theme="brutalist"] .marker {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  border-bottom: 4px solid var(--rule);
  padding-bottom: 0.35rem;
}

[data-theme="brutalist"] .dateline {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 0.75rem;
}

[data-theme="brutalist"] .project h3 {
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
}

[data-theme="brutalist"] .summary {
  border-left: 8px solid var(--accent);
  font-weight: 500;
  font-size: 1.1rem;
}

[data-theme="brutalist"] .project + .project { border-top: 2px solid var(--rule); }

[data-theme="brutalist"] .tags li,
[data-theme="brutalist"] .badge,
[data-theme="brutalist"] .formula,
[data-theme="brutalist"] .theme-switch {
  border-radius: 0;
  border: 2px solid var(--rule);
}

[data-theme="brutalist"] .badge { background: var(--accent); color: #fff; }

[data-theme="brutalist"] a { text-decoration-thickness: 2px; }

[data-theme="brutalist"] .now li::before,
[data-theme="brutalist"] .principles li::before {
  content: "■";
  font-size: 0.7em;
}

[data-theme="brutalist"] footer { border-top: 4px solid var(--rule); }

/* ===============================================================
   ZINE — cut-and-paste energy. Cards, offsets, more colour,
   the one theme that is allowed to be fun.
   =============================================================== */

:root[data-theme="zine"] {
  --bg: #fdf3e3;
  --surface: #fffdf8;
  --text: #1d1a17;
  --muted: #514a41;
  --faint: #8b8074;
  --rule: #1d1a17;
  --accent: #e0483c;
  --accent-dim: #ffe2b8;
}

[data-theme="zine"] body { font-size: 16.5px; }

[data-theme="zine"] .page { max-width: 54rem; }

[data-theme="zine"] .masthead h1 {
  font-size: clamp(2.4rem, 9vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  display: inline-block;
  background: var(--accent);
  color: #fff8ee;
  padding: 0.15em 0.4em;
  transform: rotate(-1.6deg);
}

[data-theme="zine"] .tagline {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--text);
  padding: 0.2rem 0.55rem;
  border: 2px solid var(--rule);
  transform: rotate(0.8deg);
  margin-top: 1.4rem;
}

/* Sections become pasted cards. */
[data-theme="zine"] main > section {
  background: var(--surface);
  border: 2px solid var(--rule);
  border-radius: 10px;
  box-shadow: 6px 6px 0 var(--rule);
  padding: 1.4rem 1.5rem 1.7rem;
  margin-bottom: 2rem;
}

[data-theme="zine"] .marker {
  display: inline-block;
  background: var(--rule);
  color: var(--bg);
  border: 0;
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  margin-bottom: 1.2rem;
}

[data-theme="zine"] .dateline {
  float: none;
  margin-left: 0.6rem;
  color: var(--accent-dim);
}

[data-theme="zine"] .project h3 { font-weight: 800; }

[data-theme="zine"] .summary {
  background: var(--accent-dim);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 0.8rem 1rem;
}

[data-theme="zine"] .tags li {
  border: 2px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
}

[data-theme="zine"] .badge {
  background: var(--accent);
  color: #fff8ee;
  border-radius: 999px;
}

[data-theme="zine"] .now li::before { content: "★"; }
[data-theme="zine"] .principles li::before { content: "✂"; }

[data-theme="zine"] .theme-switch {
  border: 2px solid var(--rule);
  box-shadow: 3px 3px 0 var(--rule);
}

[data-theme="zine"] footer {
  border-top: 2px dashed var(--rule);
}

/* Rotation is decoration; anyone who asked for less motion gets none. */
@media (prefers-reduced-motion: reduce) {
  [data-theme="zine"] .masthead h1,
  [data-theme="zine"] .tagline { transform: none; }
}
