/* Two dark themes, colors taken from the two logos.
   Default = blue "brain" theme; the switch sets data-theme="heart" for red. */
:root {
  color-scheme: dark;
  --radius: 12px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --todo-bg: #3d3300;
  --todo-ink: #ffe27a;

  --bg: #050505;
  --surface: #0c1216;
  --text: #e9f6f9;
  --muted: #93a9b0;
  --border: #1c2a30;
  --accent: #4fc8e4;
  --accent-ink: #031418;
  --glow: rgba(148, 238, 246, 0.28);
}

:root[data-theme="heart"] {
  --bg: #050505;
  --surface: #130a0a;
  --text: #f6efec;
  --muted: #b59a96;
  --border: #2e1a19;
  --accent: #ee645a;
  --accent-ink: #1a0505;
  --glow: rgba(238, 100, 90, 0.3);
}

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

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
  hyphens: auto;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 46rem);
  margin-inline: auto;
}

main {
  flex: 1;
  padding-block: clamp(2rem, 6vw, 4rem);
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  margin-top: 2.5em;
}

h3 {
  font-size: 1.15rem;
}

main > .wrap > :first-child {
  margin-top: 0;
}

p,
ul {
  margin: 0 0 1em;
}

ul {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.35em;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  z-index: 10;
}

.skip:focus {
  top: 0.75rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 1.5rem;
}

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  padding-block: 0.75rem;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
}

nav li {
  margin: 0;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--text);
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.lead {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--muted);
  max-width: 38rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.card > :last-child {
  margin-bottom: 0;
}

.tag {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin: 0 0.35rem 0.35rem 0;
}

.todo {
  background: var(--todo-bg);
  color: var(--todo-ink);
  padding: 0 0.25em;
  border-radius: 4px;
}

dl {
  margin: 0 0 1em;
}

dt {
  font-weight: 600;
  margin-top: 0.9em;
}

dd {
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  padding-block: 1.25rem;
}

.site-footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin: 0;
}

.site-footer a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* Glow behind the page, tinted by the active theme */
body {
  background-image: radial-gradient(70rem 28rem at 50% -8rem, var(--glow), transparent 70%);
  background-repeat: no-repeat;
}

.card {
  box-shadow: 0 14px 34px -22px var(--glow);
}

/* Logos: both images are in the page, the theme decides which one shows */
.logo {
  display: block;
}

.logo-heart,
:root[data-theme="heart"] .logo-brain {
  display: none;
}

:root[data-theme="heart"] .logo-heart {
  display: block;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border), 0 0 14px var(--glow);
}

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

.hero-logo {
  flex: 0 0 auto;
  width: min(15rem, 62vw);
}

.hero-logo .logo {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  -webkit-mask-image: radial-gradient(circle farthest-corner, #000 68%, transparent 100%);
  mask-image: radial-gradient(circle farthest-corner, #000 68%, transparent 100%);
}

.hero-text {
  flex: 1 1 20rem;
  min-width: 0;
}

.hero-text h1 {
  font-size: clamp(1.75rem, 4.6vw, 2.4rem);
  overflow-wrap: normal;
  hyphens: manual;
}

/* Design switch (only shown when JavaScript is available) */
.theme-switch {
  display: none;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.js .theme-switch {
  display: inline-flex;
}

.theme-switch button {
  font: inherit;
  font-size: 0.85rem;
  min-height: 2.5rem;
  min-width: 3rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

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

.theme-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
