/* ————————————————————————————————————————————————
   LAMPLIGHT — the garden of Michael Grafl
   Late evening, autumn, a lamp left on.
   Dark "listening room" and light "morning paper",
   following the system unless overridden.
   ———————————————————————————————————————————————— */

@font-face {
  font-family: "Fraunces";
  src: url("/garden-fonts/fraunces-72-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/garden-fonts/fraunces-72-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/garden-fonts/fraunces-72-400i.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/garden-fonts/newsreader-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/garden-fonts/newsreader-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/garden-fonts/newsreader-400i.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

/* ——— themes ——— */

:root {
  /* dark: the listening room */
  --bg: #16120d;
  --card: #1f1913;
  --ink: #ece0c9;
  --ink-soft: #d8c9ae;
  --muted: #a08c70;
  --accent: #e2a75e;
  --accent-strong: #f0bd7c;
  --line: #2e2519;
  --glow: rgba(255, 176, 92, 0.09);
  --grain-opacity: 0.05;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    /* light: morning paper */
    --bg: #f5efe1;
    --card: #faf4e6;
    --ink: #2b2114;
    --ink-soft: #4a3c29;
    --muted: #8a7758;
    --accent: #9c4f16;
    --accent-strong: #7f3f0f;
    --line: #e2d5ba;
    --glow: rgba(255, 196, 120, 0.22);
    --grain-opacity: 0.06;
    color-scheme: light;
  }
}

:root[data-theme="dark"] {
  --bg: #16120d; --card: #1f1913; --ink: #ece0c9; --ink-soft: #d8c9ae;
  --muted: #a08c70; --accent: #e2a75e; --accent-strong: #f0bd7c;
  --line: #2e2519; --glow: rgba(255, 176, 92, 0.09); --grain-opacity: 0.05;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5efe1; --card: #faf4e6; --ink: #2b2114; --ink-soft: #4a3c29;
  --muted: #8a7758; --accent: #9c4f16; --accent-strong: #7f3f0f;
  --line: #e2d5ba; --glow: rgba(255, 196, 120, 0.22); --grain-opacity: 0.06;
  color-scheme: light;
}

/* ——— base ——— */

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0 auto;
  max-width: 42rem;
  padding: 2rem 1.5rem 5rem;
  background: var(--bg);
  color: var(--ink);
  font-family: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.68;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* lamplight from above */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 90% 55% at 50% -12%, var(--glow), transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 2;
}

::selection { background: #e8c388; color: #241a0e; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
a:hover { color: var(--accent-strong); text-decoration-color: var(--accent-strong); }

/* ——— site chrome ——— */

header.site {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--accent); }

header.site nav {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
}
header.site nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
header.site nav a:hover { color: var(--accent); }

#theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
#theme-toggle .sun { display: none; }
#theme-toggle .moon { display: inline; }
@media (prefers-color-scheme: light) {
  #theme-toggle .sun { display: inline; }
  #theme-toggle .moon { display: none; }
}
:root[data-theme="dark"] #theme-toggle .sun { display: none; }
:root[data-theme="dark"] #theme-toggle .moon { display: inline; }
:root[data-theme="light"] #theme-toggle .sun { display: inline; }
:root[data-theme="light"] #theme-toggle .moon { display: none; }

footer {
  margin-top: 5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.82rem;
  color: var(--muted);
}
footer a { color: var(--muted); }

/* ——— hero (front page) ——— */

.hero {
  margin: 4.5rem 0 2.5rem;
}

.hero h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(3rem, 9vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
}

.intro {
  font-size: 1.22rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 34rem;
  margin-bottom: 1rem;
}
.intro p { margin: 0.8rem 0; }

/* ——— typography ——— */

article h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 2.3rem;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
}

.prose h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 0.75rem;
}
.prose h3 {
  font-weight: 500;
  font-size: 1.15rem;
  font-style: italic;
  margin: 2rem 0 0.5rem;
}

.prose p { margin: 1.25rem 0; }
.prose ul, .prose ol { margin: 1.25rem 0; padding-left: 1.4rem; }
.prose li { margin: 0.4rem 0; }

/* drop cap on the first paragraph of a piece */
.prose > p:first-of-type::first-letter {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  float: left;
  font-size: 3.3em;
  line-height: 0.82;
  padding: 0.06em 0.14em 0 0;
  color: var(--accent);
}

.prose blockquote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--ink-soft);
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}
pre {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
}
pre code { background: none; border: none; padding: 0; }

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

img, iframe { max-width: 100%; }
iframe { border-radius: 10px; }

.footnote { font-size: 0.88rem; color: var(--muted); }
.footnote hr { margin: 2rem 0 1rem; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.prose th, .prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.prose th {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  font-size: 0.92rem;
}
.toc ul { list-style: none; padding-left: 1.25rem; margin: 0; }
.toc > ul { padding-left: 0; }
.toc li { margin: 0.3rem 0; }

/* the manual is documentation, not an essay: no drop cap */
article.docs .prose > p:first-of-type::first-letter {
  float: none;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
  color: inherit;
}

/* ——— meta & labels ——— */

.meta {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0 0 2.75rem;
}
.tag { white-space: nowrap; }

section.listing, section.release, section.gigs { margin-top: 3.5rem; }

.label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  margin: 0 0 0.5rem;
}

/* ——— annotated entries ——— */

ul.entries { list-style: none; padding: 0; margin: 0; }
ul.entries li {
  display: grid;
  grid-template-columns: 7.25rem 1fr;
  gap: 0 1.25rem;
  padding: 0.85rem 0.25rem;
  border-radius: 6px;
}
ul.entries .date {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding-top: 0.3em;
}
ul.entries .title {
  font-weight: 500;
  font-size: 1.08rem;
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, var(--ink) 25%, transparent);
}
ul.entries .title:hover { color: var(--accent); }
ul.entries .tags {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.6rem;
}
ul.entries .desc {
  margin: 0.15rem 0 0;
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ——— release cards & gigs ——— */

.release-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  margin: 1.25rem 0;
  box-shadow: 0 12px 40px -18px rgba(0, 0, 0, 0.55);
}
.release-card h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.9rem;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 0.4rem;
  font-style: normal;
}
.release-card .meta {
  margin: 0 0 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}
.release-card p { margin: 0.8rem 0; }
.release-card .links {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.release-card .links a { margin-right: 1.1rem; }
.release-card .track { margin-top: 1.4rem; }
.release-card .track-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 0.45rem;
}
.release-card iframe { display: block; margin-top: 0; }

ul.gig-list { list-style: none; padding: 0; margin: 0; }
ul.gig-list li {
  display: grid;
  grid-template-columns: 7.25rem 1fr;
  gap: 0 1.25rem;
  padding: 0.7rem 0.25rem;
}
ul.gig-list .date {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding-top: 0.3em;
}

/* ——— garden mechanics ——— */

.seed {
  border-bottom: 1px dashed var(--muted);
  cursor: help;
}

.backlinks {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  font-size: 0.92rem;
}
.backlinks h2 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.backlinks ul { list-style: none; padding: 0; margin: 0; }
.backlinks li { display: inline; }
.backlinks li + li::before { content: " · "; color: var(--muted); }

/* ——— entrance choreography ——— */

.reveal {
  animation: rise 0.7s cubic-bezier(0.2, 0.6, 0.2, 1) both;
  animation-delay: calc(var(--d, 0) * 100ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  body { transition: none; }
}

/* ——— small screens ——— */

@media (max-width: 520px) {
  html { font-size: 17px; }
  body { padding: 1.5rem 1.25rem 4rem; }
  .hero { margin: 3rem 0 2rem; }
  ul.entries li, ul.gig-list li { grid-template-columns: 1fr; gap: 0; }
  ul.entries .date, ul.gig-list .date { padding-top: 0; }
  .release-card { padding: 1.25rem 1.25rem; }
}
