/* ==========================================================================
   EDIT ME: colors, fonts, and spacing all live in this one block.
   Change these and the whole page follows.

   The design is deliberately flat: no gradients, no shadows, no rounded
   corners, no animation. Structure comes from hairline rules, alignment,
   and type size — not from boxes.
   ========================================================================== */

:root {
  color-scheme: light;

  --color-bg: #fbfaf8;
  --color-border: #e2e2e2;
  --color-text: #101112;
  --color-text-muted: #6a6d70;
  --color-accent: #8a3b12;
  --color-surface: #f1eeea;

  --font-sans:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;

  --rule: 1px solid var(--color-border);
  --page-width: 64rem;
  --text-width: 40rem;
  --gutter: 1.5rem;
}

/* Dark theme. Two selectors so it works from the operating system setting on
   its own, and from the toggle button. Keep these blocks in sync. */

:root[data-theme='dark'] {
  color-scheme: dark;

  --color-bg: #0e0f10;
  --color-border: #26282a;
  --color-text: #f2f2f2;
  --color-text-muted: #9a9da0;
  --color-accent: #e8875a;
  --color-surface: #18191a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --color-bg: #0e0f10;
    --color-border: #26282a;
    --color-text: #f2f2f2;
    --color-text-muted: #9a9da0;
    --color-accent: #e8875a;
    --color-surface: #18191a;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

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

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
}

h1,
h2,
h3,
p,
ul,
figure,
blockquote {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--gutter);
  translate: 0 -200%;
  padding: 0.5rem 0.75rem;
  border: var(--rule);
  background: var(--color-bg);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 2;
}

.skip-link:focus-visible {
  translate: 0 0;
}

/* The sprite holds icon definitions only and must never take up space. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Small uppercase section label. */
.label {
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.page {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding: 1.25rem var(--gutter) 4rem;
}

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  /* Leave room for the fixed toolbar in the corner. */
  padding: 0 5.5rem 1.25rem 0;
  border-bottom: var(--rule);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--color-text);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand__mark {
  width: 32px;
  height: 32px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.nav a {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.section {
  margin-top: 4rem;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: var(--rule);
}

.section__head a {
  font-size: 0.875rem;
  text-underline-offset: 3px;
}

.page-title {
  margin-top: 3rem;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.lead {
  max-width: var(--text-width);
  margin-top: 0.75rem;
  margin-bottom: 2rem;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
}

.crumbs {
  margin-top: 2rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.crumbs a {
  color: inherit;
}

.notice {
  margin: 1.5rem 0;
  padding: 0.875rem 1rem;
  border-left: 2px solid var(--color-accent);
  background: var(--color-surface);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  margin-top: 1.5rem;
}

.hero__banner {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  background: var(--color-surface);
}

.hero__body {
  position: relative;
}

.hero__avatar {
  display: block;
  width: 88px;
  height: 88px;
  margin-top: -44px;
  margin-left: var(--gutter);
  border: 3px solid var(--color-bg);
  background: var(--color-surface);
  position: relative;
}

.hero__name {
  margin-top: 1.5rem;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}

.hero__tagline {
  max-width: var(--text-width);
  margin-top: 0.875rem;
  font-size: 1.1875rem;
  text-wrap: pretty;
}

.hero__meta {
  margin-top: 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.about > p,
.about .motto {
  max-width: var(--text-width);
  margin-top: 1rem;
}

.about .label {
  padding-bottom: 0.75rem;
  border-bottom: var(--rule);
}

.motto {
  padding-left: 1rem;
  border-left: 2px solid var(--color-accent);
  font-size: 1.25rem;
  font-style: italic;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Posts — hairline rows, no cards
   ========================================================================== */

.post {
  padding: 1.75rem 0;
  border-bottom: var(--rule);
}

.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.post__title {
  margin-top: 0.375rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  text-wrap: balance;
}

.post__title a {
  color: inherit;
  text-decoration: none;
}

.post__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post--single .post__title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  letter-spacing: -0.03em;
}

.post__text {
  max-width: var(--text-width);
  margin-top: 0.75rem;
  overflow-wrap: anywhere;
}

.post__text p + p {
  margin-top: 0.75rem;
}

.post__text .tag {
  text-decoration: none;
}

.post__text .tag:hover {
  text-decoration: underline;
}

.post__images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.375rem;
  max-width: var(--text-width);
  margin-top: 1rem;
}

.post__links {
  margin-top: 1rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.post__links a {
  text-underline-offset: 3px;
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.375rem;
  margin-top: 1.25rem;
}

.gallery--post {
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  margin-top: 1.5rem;
}

.shot a {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-surface);
}

.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot a:hover img {
  opacity: 0.85;
}

.shot__play {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 2.5rem;
  height: 2.5rem;
  translate: -50% -50%;
  padding: 0.5rem;
  background: rgb(0 0 0 / 0.6);
  color: #fff;
  fill: #fff;
  stroke: none;
}

.lightbox {
  max-width: min(96vw, 80rem);
  max-height: 96vh;
  padding: 0;
  border: var(--rule);
  background: var(--color-bg);
  color: var(--color-text);
}

.lightbox::backdrop {
  background: rgb(0 0 0 / 0.85);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  margin-inline: auto;
}

.lightbox__close {
  display: block;
  margin-left: auto;
  padding: 0.5rem 0.875rem;
  border: 0;
  border-bottom: var(--rule);
  border-left: var(--rule);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.lightbox__caption {
  max-width: var(--text-width);
  padding: 0.75rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* ==========================================================================
   Videos
   ========================================================================== */

.videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.video a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.video__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-surface);
}

.video__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video__title {
  display: block;
  margin-top: 0.5rem;
  font-weight: 500;
}

.video a:hover .video__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.video time {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

/* ==========================================================================
   Tags
   ========================================================================== */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.25rem;
}

.tags a {
  color: var(--color-text);
  font-size: 0.9375rem;
  text-decoration: none;
}

.tags a:hover {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tags span {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Link list — hairline rows, no cards
   ========================================================================== */

.links {
  margin-top: 0.75rem;
  border-top: var(--rule);
  max-width: var(--text-width);
}

.links li {
  border-bottom: var(--rule);
}

.link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.125rem 0;
  color: inherit;
  text-decoration: none;
}

.link__index {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.link__body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.link__title {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.link__meta {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.link__arrow {
  margin-left: auto;
  color: var(--color-text-muted);
  align-self: center;
}

.link:hover .link__title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.link:hover .link__arrow {
  color: var(--color-text);
}

/* ==========================================================================
   Pager
   ========================================================================== */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  font-size: 0.9375rem;
}

.pager > span:only-of-type {
  color: var(--color-text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 5rem;
  padding-top: 1.25rem;
  border-top: var(--rule);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.footer strong {
  color: var(--color-text);
  font-weight: 600;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.footer a {
  color: inherit;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Toolbar (theme toggle + copy link)
   ========================================================================== */

.toolbar {
  position: fixed;
  top: var(--gutter);
  right: var(--gutter);
  display: flex;
  gap: 0.5rem;
  z-index: 1;
}

.toolbar__button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: var(--rule);
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
}

.toolbar__button:hover {
  color: var(--color-text);
}

/* Show the sun in light mode and the moon in dark mode. Both icons live in
   the same button so its size never shifts when the theme changes. */
.icon--dark {
  display: none;
}

:root[data-theme='dark'] .icon--light {
  display: none;
}

:root[data-theme='dark'] .icon--dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .icon--light {
    display: none;
  }

  :root:not([data-theme='light']) .icon--dark {
    display: block;
  }
}
