/* Minimal personal page — calm type, lots of air */

:root {
  --bg: #f7f6f3;
  --fg: #1a1a18;
  --muted: #5c5a56;
  --accent: #2d4a3e;
  --rule: rgba(26, 26, 24, 0.12);
  --max: 34rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  /* Widen fixed photo into the “center” band; text shifts right to match */
  --photo-extra: clamp(1.5rem, 4vw, 3.25rem);
  --photo-scale: 1.25;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  --text-col: min(var(--max), 100vw);
  --side-gutter: max(0px, calc((100vw - var(--text-col)) / 2));
  --photo-rail-width: calc(
    (var(--side-gutter) + var(--photo-extra)) * var(--photo-scale)
  );
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono",
    Menlo, monospace;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: var(--fg);
  background: var(--bg);
  transition: background-color 220ms ease, color 220ms ease;
}

.skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip:focus {
  position: fixed;
  top: var(--pad);
  left: var(--pad);
  z-index: 100;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: 0.5rem 0.75rem;
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Left strip: symmetric gutter + extra width so the subject reads larger; text column nudges right */
.photo-rail {
  position: fixed;
  z-index: 0;
  left: 0;
  top: 0;
  width: var(--photo-rail-width);
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  pointer-events: none;
}

.margin-photo {
  margin: 0;
  width: 100%;
  max-width: 100%;
}

.margin-photo__img {
  width: 100%;
  height: auto;
  max-height: min(96dvh, calc(62rem * var(--photo-scale)));
  display: block;
  object-fit: contain;
  border-radius: 3px;
  opacity: 0.94;
}

.shell {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max);
  margin-left: var(--photo-rail-width);
  margin-right: auto;
  padding: clamp(2.5rem, 8vh, 5rem) var(--pad) 3rem;
}

body.no-photo .shell {
  margin-left: auto;
  margin-right: auto;
}

.sidequests-page .shell {
  max-width: 40rem;
}

.sidequests-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.sidequests-item {
  margin: 0;
  border-bottom: 1px solid var(--rule);
}

.sidequests-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  color: inherit;
  text-decoration: none;
}

.sidequests-link:hover .sidequests-title {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.sidequests-title {
  color: var(--accent);
}

.sidequests-date {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.page {
  margin: 0;
  min-width: 0;
}

.masthead {
  margin-bottom: 2.75rem;
}

.masthead__line {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.name {
  margin: 0;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0.85rem 0 0;
  max-width: 28rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

.subtitle--next {
  margin-top: 0.4rem;
}

.subtitle__link {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

.subtitle__link:hover {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

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

.main {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.block {
  margin: 0;
}

.lede {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--fg);
}

.section-label {
  margin: 0 0 0.65rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.body {
  margin: 0;
  color: var(--muted);
}

.links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.links li {
  margin: 0;
  padding: 0.65rem 0;
  border-top: 1px solid var(--rule);
}

.links li:last-child {
  border-bottom: 1px solid var(--rule);
}

.sidequests-more {
  margin-top: 0.7rem;
}

.link {
  display: inline;
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.22em;
  transition: color 0.15s ease;
}

.link:hover {
  color: var(--fg);
  text-decoration: underline;
}

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

.footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.footer__note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.masthead__line,
.subtitle,
.section-label,
.body,
.footer__note,
.links li,
.link,
.subtitle__link,
.theme-toggle,
.site-copyright {
  transition: color 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.site-footer-controls {
  position: fixed;
  left: max(0.55rem, env(safe-area-inset-left));
  bottom: max(0.55rem, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: calc(100vw - 1.1rem - env(safe-area-inset-left) - env(safe-area-inset-right));
  pointer-events: none;
}

.site-footer-controls > * {
  pointer-events: auto;
}

.site-copyright {
  margin: 0;
  font-size: 0.5625rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--muted);
  opacity: 0.2;
  white-space: nowrap;
}

.theme-toggle {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  display: grid;
  place-items: center;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  background: color-mix(in srgb, var(--bg) 92%, var(--fg) 8%);
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  line-height: 0;
  cursor: pointer;
  opacity: 0.42;
  transition: opacity 160ms ease, color 160ms ease, border-color 160ms ease,
    background-color 220ms ease;
}

.theme-toggle:hover {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--fg) 20%, var(--rule) 80%);
  opacity: 0.96;
}

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

@media (max-width: 42rem) {
  .photo-rail {
    position: static;
    width: 100%;
    height: auto;
    max-width: min(18rem, 86vw);
    margin: 0 auto;
    padding: 0 var(--pad) 2rem;
    pointer-events: auto;
    order: 2;
  }

  .photo-rail .margin-photo__img {
    max-height: none;
  }

  .shell {
    order: 1;
    max-width: var(--max);
    margin-left: auto;
    margin-right: auto;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121210;
    --fg: #e8e6e1;
    --muted: #9c9890;
    --accent: #8fbc9f;
    --rule: rgba(232, 230, 225, 0.1);
  }
}

html[data-theme="light"] {
  --bg: #f7f6f3;
  --fg: #1a1a18;
  --muted: #5c5a56;
  --accent: #2d4a3e;
  --rule: rgba(26, 26, 24, 0.12);
}

html[data-theme="dark"] {
  --bg: #121210;
  --fg: #e8e6e1;
  --muted: #9c9890;
  --accent: #8fbc9f;
  --rule: rgba(232, 230, 225, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  body,
  .masthead__line,
  .subtitle,
  .section-label,
  .body,
  .footer__note,
  .links li,
  .link,
  .subtitle__link,
  .theme-toggle,
  .site-copyright {
    transition: none;
  }

  .link,
  .subtitle__link {
    transition: none;
  }
}
