@property --ft-l { syntax: "<color>"; inherits: true; initial-value: #707070; }
@property --ft-r { syntax: "<color>"; inherits: true; initial-value: #35312a; }
@property --gm-l { syntax: "<color>"; inherits: true; initial-value: #707070; }
@property --gm-r { syntax: "<color>"; inherits: true; initial-value: #35312a; }
@property --gf-l { syntax: "<color>"; inherits: true; initial-value: #2b2b2b; }
@property --gf-r { syntax: "<color>"; inherits: true; initial-value: #141210; }
:root {
  --bg: #FAFAFA;
  --fg: #2b2b2b;
  --muted: #707070;
  --rule: #e3e3e3;
  --accent: #b8923c;
  --line-l: rgba(43, 43, 43, 0.10);
  --line-r: rgba(43, 43, 43, 0.28);
  --serif: "Vollkorn", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* Background paintings (public domain):
   light: Claude Monet, The Water Lily Pond (c. 1917-19, W.1899), Albertina, Vienna
   dark:  Claude Monet, Lily Pond (1904, W.1664), MuMa Le Havre (image file mirrored left to right)
   Dark applies when the system is dark and the switch has not chosen light, or when the switch chose dark. */
@property --fg { syntax: "<color>"; inherits: true; initial-value: #2b2b2b; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: #707070; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #b8923c; }
@property --rule { syntax: "<color>"; inherits: true; initial-value: #e3e3e3; }
@property --bg { syntax: "<color>"; inherits: true; initial-value: #FAFAFA; }
@property --dark { syntax: "<number>"; inherits: true; initial-value: 0; }
:root {
  --dark: 0;
  --gm-l: #707070; --gm-r: #2f2b25; --gf-l: #2b2b2b; --gf-r: #141210; --ft-l: #707070; --ft-r: #35312a;
  transition: --ft-l 0.7s ease, --ft-r 0.7s ease, --gm-l 0.7s ease, --gm-r 0.7s ease, --gf-l 0.7s ease, --gf-r 0.7s ease, --fg 0.7s ease, --muted 0.7s ease, --accent 0.7s ease, --rule 0.7s ease, --bg 0.7s ease, --dark 0.7s ease;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0d0c;
    --fg: #e4e4e0;
    --muted: #a3a8a0;
    --rule: rgba(228, 228, 224, 0.16);
    --accent: #8ccf9f;
    --dark: 1;
    --line-l: rgba(228, 228, 224, 0.09);
    --foot: #7a7f77;
    --gm-l: #a3a8a0; --gm-r: #a3a8a0; --gf-l: #e4e4e0; --gf-r: #e4e4e0;
    --ft-l: #7a7f77; --ft-r: #7a7f77;
    --line-r: rgba(228, 228, 224, 0.09);
  }
  :root:not([data-theme="light"]) .credit { display: inline; }
  :root:not([data-theme="light"]) .credit-light { display: none; }
}
:root[data-theme="dark"] {
    --bg: #0c0d0c;
    --fg: #e4e4e0;
    --muted: #a3a8a0;
    --rule: rgba(228, 228, 224, 0.16);
    --accent: #8ccf9f;
    --dark: 1;
    --line-l: rgba(228, 228, 224, 0.09);
    --foot: #7a7f77;
    --gm-l: #a3a8a0; --gm-r: #a3a8a0; --gf-l: #e4e4e0; --gf-r: #e4e4e0;
    --ft-l: #7a7f77; --ft-r: #7a7f77;
    --line-r: rgba(228, 228, 224, 0.09);
}
:root[data-theme="dark"] .credit { display: inline; }
:root[data-theme="dark"] .credit-light { display: none; }

/* each painting on its own fixed layer under a neutral veil; they cross-fade with --dark */
body::before, body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none;
}
body::before {
  z-index: -2;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.48) 50%, rgba(255, 255, 255, 0.25) 100%),
              url("../images/waterlilypond-light.webp") center / cover no-repeat;
}
body::after {
  z-index: -1;
  opacity: var(--dark);
  background: linear-gradient(to right, rgba(8, 9, 8, 0.73) 0%, rgba(8, 9, 8, 0.68) 45%, rgba(8, 9, 8, 0.58) 100%),
              url("../images/waterlilies.webp") center / cover no-repeat;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  /* exactly one screen: dvh is the visible height on phones (without the browser bars), so nothing scrolls */
  height: 100vh; height: 100dvh;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* top bar */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 1.4rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* main */
main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 3rem;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
h1 {
  font-weight: 500;
  font-size: clamp(3rem, 8vw, 5.2rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 1.8rem;
}

.ket {
  font-family: var(--mono);
  font-size: 0.92rem;
  border-left: 2px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1rem;
  margin: 0 0 2.2rem;
  color: var(--fg);
}
.ket .c { color: var(--muted); display: block; margin-top: 0.3rem; font-size: 0.82rem; }
.cursor {
  display: inline-block;
  width: 0.55em; height: 1.05em;
  vertical-align: -0.18em;
  background: var(--accent);
  margin-left: 0.15em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }


.links { display: flex; flex-wrap: wrap; gap: 1.4rem; font-family: var(--mono); font-size: 0.85rem; }
.links a {
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: var(--fg);
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.links a:hover, .links a:focus-visible { color: var(--accent); border-color: var(--accent); }
.links svg { width: 17px; height: 17px; fill: currentColor; }


footer {
  max-width: 980px; width: 100%; margin: 0 auto;
  padding: 1.2rem 1.5rem 1.6rem;
  position: relative;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.74rem; color: var(--foot, var(--muted));
}

.credit { display: none; }
.theme { display: inline-flex; gap: 0.15rem; font-family: var(--mono); font-size: 0.78rem; }
.theme button {
  font: inherit; color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 0.15rem 0.35rem; border-bottom: 1px solid transparent;
  transition: color 0.4s ease, border-color 0.4s ease;
}
.theme button:hover, .theme button:focus-visible { color: var(--fg); }
.theme button[aria-pressed="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.theme .sep { color: var(--muted); opacity: 0.6; }
/* the rule above the footer: darker where the background is busier, so it reads the same all the way */
footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, var(--line-l), var(--line-r));
}
footer a {
  color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: color 0.2s, text-decoration-color 0.2s;
}
footer a:hover, footer a:focus-visible { color: var(--accent); text-decoration-color: var(--accent); }

@media (max-width: 760px) {
  main { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 0.5rem; padding-bottom: 1rem; min-height: 0; }
  .bar { padding: 1rem; }
  main, footer { padding-left: 1rem; padding-right: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}


/* ── header and footer text darken towards the right (light mode), where the overlay thins out
   and the painting is busier. The gradient spans the whole window (background-attachment: fixed),
   so every word gets the shade of its position. In dark mode both ends are the same colour. */
.bar > span:first-child,
.theme button,
.theme .sep {
  background-image: linear-gradient(to right, var(--gm-l), var(--gm-r));
  background-attachment: fixed;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.theme button[aria-pressed="true"] {
  background-image: linear-gradient(to right, var(--gf-l), var(--gf-r));
}
.theme button:hover, .theme button:focus-visible {
  background-image: linear-gradient(to right, var(--gf-l), var(--gf-r));
}
footer > span {
  background-image: linear-gradient(to right, var(--ft-l), var(--ft-r));
  background-attachment: fixed;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
footer a { text-decoration-color: color-mix(in srgb, var(--ft-r) 40%, transparent); }

/* phones */
@media (max-width: 600px) {
  /* the header stays at the top; the safe-area insets keep it clear of the notch and the home bar */
  .bar { position: sticky; top: 0; padding-top: max(1rem, env(safe-area-inset-top)); }
  footer { padding-bottom: max(1rem, env(safe-area-inset-bottom)); font-size: 0.68rem; }
}
