:root {
  --paper: #161614; --ink: #d8d6cf; --muted: #8f8e87; --rule: #2b2b28;
  --gutter: clamp(1.5rem, 6vw, 5rem);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #f0f0ec; --ink: #1d1d1b; --muted: #6b6b66; --rule: #dddbd6;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); height: 100%; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body {
  margin: 0; min-height: 100%; padding: 2rem 0 5rem;
  background: var(--paper); color: var(--ink);
  font-family: "Times New Roman", Times, serif; font-size: 1.15rem; line-height: 1.5; text-align: left;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
button, a { -webkit-tap-highlight-color: transparent; }

/* top bar */
.bar { display: flex; justify-content: space-between; align-items: baseline; margin: 0 auto 4rem; width: calc(100% - 2 * var(--gutter)); max-width: 42rem; font-size: 1.05rem; }
.bar nav { display: flex; gap: 1.5rem; }
.bar a, .bar .switch { color: var(--muted); text-decoration: none; cursor: pointer; }
.bar a:hover, .bar a[aria-current="page"] { color: var(--ink); }
.bar .switch { position: relative; width: 2.6rem; height: 1.45rem; border: 1px solid var(--muted); border-radius: 999px; background: none; padding: 0; align-self: center; flex: none; }
.bar .switch:hover { border-color: var(--ink); }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 1rem; height: 1rem; border-radius: 50%; background: var(--ink); transition: transform .2s ease; }
.switch[aria-checked="true"] .thumb { transform: translateX(1.15rem); }

/* name + subtitle */
.garamond { font-family: "EB Garamond", Garamond, serif; }
h1.name { margin: 0 auto; width: calc(100% - 2 * var(--gutter)); max-width: 42rem; font-size: 2.75rem; font-weight: 500; line-height: 1.1; letter-spacing: .01em; }
.descriptor { margin: .5rem auto 3.5rem; width: calc(100% - 2 * var(--gutter)); max-width: 42rem; color: var(--muted); }
.descriptor a { color: var(--ink); font-family: "EB Garamond", Garamond, serif; font-size: 1.15em; font-weight: 400; text-decoration: none; }

/* about page bio */
.about { margin: 0 auto; width: calc(100% - 2 * var(--gutter)); max-width: 42rem; }
.about p { margin: 0; font-family: "EB Garamond", Garamond, serif; font-size: 1.3rem; line-height: 1.65; }

/* scrollable story strip */
.strip-wrap { position: relative; margin: 0 auto; width: calc(100% - 2 * var(--gutter)); max-width: 42rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.strip {
  display: flex; flex-wrap: nowrap; align-items: baseline; gap: 3.5rem;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 1.25rem 1rem 1.1rem 0;
  transition: padding .3s ease;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fl, 0px), #000 calc(100% - var(--fr, 0px)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fl, 0px), #000 calc(100% - var(--fr, 0px)), transparent 100%);
}
.strip::-webkit-scrollbar { display: none; }
/* scroll cues show only when the row overflows */
.strip-wrap.can-left { --fl: 3rem; }
.strip-wrap.can-right { --fr: 3rem; }
.arrow { display: none; position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 1.9rem; height: 1.9rem; padding: 0 0 .15rem; border: 1px solid var(--rule); border-radius: 50%; background: var(--paper); color: var(--muted); font: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.arrow:hover { color: var(--ink); border-color: var(--muted); }
.arrow.left { left: .35rem; }
.arrow.right { right: .35rem; }
.strip-wrap.can-left .arrow.left, .strip-wrap.can-right .arrow.right { display: block; }

.tab { flex: none; display: block; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; color: var(--muted); font: inherit; white-space: nowrap; }
.tab .t { display: block; font-family: "EB Garamond", Garamond, serif; font-size: 1.3rem; line-height: 1.15; transition: font-size .3s ease, color .2s ease; }
.tab .d { display: block; margin-top: .2rem; font-size: 1rem; transition: font-size .3s ease; }
.tab:hover .t, .tab[aria-selected="true"] .t { color: var(--ink); }
.strip.open { padding-top: .8rem; padding-bottom: .55rem; gap: 2.5rem; }
.strip.open .t { font-size: 1.05rem; }
.strip.open .d { font-size: .85rem; margin-top: 0; }

/* expanded story */
.reader { margin: 0 auto; text-align: left; padding: 3rem var(--gutter) 0; max-width: calc(42rem + 2 * var(--gutter)); }
.reader[hidden] { display: none; }
.reader h2 { margin: 0; font-family: "EB Garamond", Garamond, serif; font-size: 1.9rem; font-weight: 500; line-height: 1.12; }
.reader .date { margin: .5rem 0 2.5rem; color: var(--muted); font-size: 1.05rem; }
.reader .body p { margin: 0; font-family: "EB Garamond", Garamond, serif; font-size: 1.3rem; line-height: 1.65; }
.reader .body p + p { margin-top: 1.65em; }
.reader.pop h2, .reader.pop .date { animation: pop .3s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .tab .t, .tab .d, .strip, .switch .thumb { transition: none; }
  .reader.pop h2, .reader.pop .date { animation: none; }
}
@media (max-width: 480px) {
  h1.name { font-size: 2.25rem; }
  .bar { margin-bottom: 3rem; }
  .strip { gap: 2.25rem; }
  .reader h2 { font-size: 1.6rem; }
}
