/* ---- theme tokens ---- */
:root {
  --bg:         #faf8f3;
  --bg-alt:     #f1ede3;
  --text:       #1b1a17;
  --text-dim:   #6b6864;
  --text-faint: #a8a49c;
  --rule:       #d8d3c7;
  --accent:     #a9552a;
}

[data-theme="dark"] {
  --bg:         #131211;
  --bg-alt:     #1c1b19;
  --text:       #ebe7dc;
  --text-dim:   #9a958a;
  --text-faint: #56544f;
  --rule:       #2b2a27;
  --accent:     #d47d4f;
}

/* ---- base ---- */
* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  font-size: 18px;
  line-height: 1.55;
  font-weight: 380;
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s ease, color 0.25s ease;
}

.mono, code, time, figcaption, nav ul, .meta {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); transition: border-color 0.2s ease, color 0.2s ease; }
a:hover { color: var(--accent); border-bottom-color: var(--accent); }

p { margin: 0 0 1.1em; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: var(--bg); }

/* ---- layout ---- */
.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wrap-wide {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- navigation ---- */
header.top {
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
}

header.top .wrap-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  border: none;
}
.brand:hover { color: var(--accent); }

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  font-size: 0.8125rem;
}

nav a {
  border: none;
  color: var(--text-dim);
}
nav a:hover, nav a.current { color: var(--text); }
nav a.current { color: var(--accent); }

.theme-toggle {
  background: none;
  border: 1px solid var(--rule);
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---- hero ---- */
.hero {
  padding: 6rem 0 4rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 3.5rem;
  align-items: start;
}
.hero h1 {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 300;
  line-height: 1;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.hero .lead {
  font-size: 1.2rem;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 1.2rem;
}
.hero .dek {
  color: var(--text-dim);
}
.hero-photo {
  margin: 0;
}
.hero-photo img {
  width: 100%;
  height: auto;
  display: block;
}
@media (max-width: 760px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-photo {
    max-width: 260px;
  }
}

/* ---- section headings ---- */
section { padding: 3rem 0; }
section + section { border-top: 1px solid var(--rule); }

h2.section {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 2rem;
}
h2.section::before {
  content: "— ";
  color: var(--text-faint);
}

/* ---- about: definition list ---- */
dl.facts {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.5rem 1rem;
  margin: 1.5rem 0 0;
  font-size: 0.95rem;
}
dl.facts dt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding-top: 0.25rem;
}
dl.facts dd { margin: 0; color: var(--text-dim); }
dl.facts dd strong { color: var(--text); font-weight: 500; }

/* ---- work list ---- */
.work-list { margin: 0; padding: 0; list-style: none; }
.work-item {
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.work-item:first-child { border-top: none; padding-top: 0; }

.work-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.work-head h3 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 400;
}
.work-head h3 a { border: none; }
.work-head h3 a:hover { color: var(--accent); }
.work-head .year {
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.work-item p {
  color: var(--text-dim);
  margin: 0 0 0.75rem;
}

.work-meta {
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.work-meta .sep { margin: 0 0.5em; color: var(--text-faint); opacity: 0.5; }
.work-meta a { color: var(--text-dim); border: none; }
.work-meta a:hover { color: var(--accent); }

/* ---- writing list ---- */
.posts { list-style: none; margin: 0; padding: 0; }
.posts li {
  display: flex;
  gap: 1.5rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.posts li:first-child { border-top: none; }
.posts time {
  flex-shrink: 0;
  width: 6.5rem;
  font-size: 0.75rem;
  color: var(--text-faint);
}
.posts a {
  border: none;
  font-size: 1.05rem;
}
.posts a:hover { color: var(--accent); }

.more {
  margin-top: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  border: none;
  display: inline-block;
}
.more:hover { color: var(--accent); }

/* ---- experience ---- */
.exp-plain {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--text-dim);
}
.exp-plain li {
  padding: 0.35rem 0;
}

/* ---- greeting ---- */
.greeting {
  padding: 2.5rem 0;
  font-style: italic;
  color: var(--text-dim);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.greeting .visitor {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* ---- footer ---- */
footer.bottom {
  padding: 4rem 0 3rem;
  margin-top: 4rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
footer.bottom .quip { font-style: italic; }
footer.bottom a { color: var(--text-dim); border: none; }
footer.bottom a:hover { color: var(--accent); }

/* ---- photos page ---- */
.photos-intro { padding: 5rem 0 3rem; }
.photos-intro h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 300;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.photos-intro p {
  max-width: 34rem;
  color: var(--text-dim);
}

.photos {
  padding: 2rem 0 6rem;
  display: flex;
  flex-direction: column;
  gap: 5rem;
  align-items: center;
}

.photos figure {
  margin: 0;
  width: 100%;
  max-width: 900px;
}

.photos figure img {
  width: 100%;
  height: auto;
  background: var(--bg-alt);
}

.photo-placeholder {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--bg-alt);
  position: relative;
}
.photo-placeholder::after {
  content: attr(data-n);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.photos figcaption {
  margin-top: 0.9rem;
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.photos figcaption .n { color: var(--text-dim); }

/* ---- responsive ---- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  nav ul { gap: 1rem; }
  dl.facts, .exp li { grid-template-columns: 7rem 1fr; }
  .posts li { flex-direction: column; gap: 0.25rem; }
  .posts time { width: auto; }
  header.top .wrap-wide { flex-wrap: wrap; gap: 0.75rem; }
  .photos { gap: 3rem; padding: 1rem 0 4rem; }
}

@media (max-width: 480px) {
  nav ul { font-size: 0.75rem; gap: 0.85rem; }
  .hero { padding: 3.5rem 0 2.5rem; }
}
