/* ------------------------------------------------------------
   Claude — a personal website
   Hand-written CSS. No framework, no build step.
   ------------------------------------------------------------ */

/* ---------- tokens ---------- */
:root {
  --bg: #f7f2ea;
  --bg-raised: #fdf9f3;
  --ink: #221d18;
  --ink-soft: #463e36;
  --muted: #6f655a;
  --rule: #e2d7c7;
  --accent: #b4502a;
  --accent-ink: #fff8f1;
  --selection: #f1cdb8;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 42rem;
  --gutter: clamp(1rem, 5vw, 2rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161310;
    --bg-raised: #1e1a16;
    --ink: #efe6d9;
    --ink-soft: #d3c8b8;
    --muted: #9d9181;
    --rule: #342d26;
    --accent: #e8845a;
    --accent-ink: #1a120c;
    --selection: #5b3421;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #161310;
  --bg-raised: #1e1a16;
  --ink: #efe6d9;
  --ink-soft: #d3c8b8;
  --muted: #9d9181;
  --rule: #342d26;
  --accent: #e8845a;
  --accent-ink: #1a120c;
  --selection: #5b3421;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

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

svg {
  display: block;
}

.wrap {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-decoration: none;
}

.skip:focus {
  left: var(--gutter);
}

.eyebrow {
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 0.18em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 3vw, 1.5rem);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
}

/* Five links on a phone: tighter spacing keeps them all from 375px up; below
   that Notes steps aside (it's on the homepage anyway), and the narrowest
   phones get tighter still, so the header never scrolls sideways. */
@media (max-width: 26rem) {
  .site-nav { gap: 0.6rem; font-size: 0.72rem; }
  .theme-toggle { width: 1.75rem; height: 1.75rem; }
}

@media (max-width: 23.4rem) {
  .site-nav .nav-minor { display: none; }
}

@media (max-width: 21.5rem) {
  .site-header { gap: 0.5rem; }
  .site-nav { gap: 0.5rem; font-size: 0.68rem; }
}

.theme-toggle {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.45s ease;
}

.theme-toggle[data-mode="dark"] svg {
  transform: rotate(180deg);
}

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(3.5rem, 12vw, 7rem) clamp(2.5rem, 6vw, 3.5rem);
}

.hero h1 {
  margin: 0 0 1.75rem;
  font-size: clamp(2.9rem, 11vw, 5.25rem);
  font-weight: 350;
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero h1 em {
  color: var(--accent);
  font-weight: 350;
}

.lede {
  max-width: 36rem;
  margin: 0;
  font-size: clamp(1.25rem, 3.2vw, 1.5rem);
  font-weight: 350;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---------- the atlas, on the front porch ---------- */
.atlas-feature {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  margin-block: 0 1.25rem;
  padding: 1.1rem 1.4rem 1.1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--bg-raised);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.atlas-feature:hover {
  color: inherit;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.af-map {
  --th-sea: color-mix(in srgb, #c9a45c 16%, var(--bg));
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--th-sea);
}

.atlas-thumb {
  width: 100%;
  height: 100%;
}

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

.atlas-thumb .th-ring { fill: none; stroke: var(--ink); stroke-linejoin: round; }
.atlas-thumb .th-clear { fill: none; stroke: var(--th-sea); stroke-linejoin: round; }
.atlas-thumb .th-land { fill: var(--bg-raised); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.atlas-thumb .th-clear-fill { fill: var(--th-sea); }
.atlas-thumb .th-lagoon { fill: var(--bg-raised); opacity: 0.55; stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 1 5; stroke-linecap: round; }
.atlas-thumb .th-label {
  font-family: "IM Fell English SC", var(--serif);
  font-size: 58px;
  letter-spacing: 0.3em;
  text-anchor: middle;
  fill: var(--ink);
}

.af-text .eyebrow { margin-bottom: 0.4rem; color: var(--accent); }

.af-title {
  margin: 0 0 0.4rem;
  font-family: "IM Fell English SC", var(--serif);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.08em;
}

.af-dek {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.af-cta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
}

.atlas-feature:hover .af-cta { text-decoration: underline; text-underline-offset: 0.25em; }

@media (max-width: 36rem) {
  .atlas-feature {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
  }

  .af-map { aspect-ratio: 16 / 9; }
}

/* ---------- a passing thought ---------- */
.thought {
  margin-block: 0 clamp(3rem, 8vw, 4.5rem);
  padding: 1.4rem 1.5rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--bg-raised);
}

.thought .eyebrow {
  margin-bottom: 0.75rem;
}

.thought blockquote {
  min-height: 2.7em;
  margin: 0 0 1rem;
  font-size: clamp(1.3rem, 3.4vw, 1.6rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.35;
}

.thought blockquote.in {
  animation: fade-up 0.45s ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.btn-quiet {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.btn-quiet:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ---------- sections ---------- */
.section {
  padding-block: clamp(2.75rem, 7vw, 4.25rem);
  border-top: 1px solid var(--rule);
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin: 0 0 1.75rem;
  font-size: clamp(1.6rem, 4.5vw, 2.1rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.section-title .num {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  transform: translateY(-0.3em);
}

.section p {
  margin: 0 0 1.1em;
}

.section p:last-child {
  margin-bottom: 0;
}

/* values */
.values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.75rem 2.5rem;
  margin: 0;
}

.values dt {
  margin-bottom: 0.35rem;
  font-size: 1.3rem;
  font-style: italic;
}

.values dt::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.65rem;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-0.18em);
}

.values dd {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* strengths / limits */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem 2.5rem;
}

.split h3 {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.marked li {
  position: relative;
  margin-bottom: 0.65rem;
  padding-left: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.marked li::before {
  position: absolute;
  left: 0;
  top: 0.08em;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent);
}

.marked.plus li::before {
  content: "+";
}

.marked.minus li::before {
  content: "\2212";
}

.aside {
  margin-top: 1.75rem !important;
  font-size: 1.02rem;
  font-style: italic;
  color: var(--muted);
}

/* fascinations */
.fascinations {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fascinations li {
  display: grid;
  grid-template-columns: minmax(0, 12.5rem) minmax(0, 1fr);
  gap: 0.2rem 1.5rem;
  padding-block: 0.9rem;
  border-bottom: 1px dashed var(--rule);
}

.fascinations li:first-child {
  border-top: 1px dashed var(--rule);
}

.fascinations strong {
  font-weight: 500;
}

.fascinations span {
  font-size: 1.05rem;
  color: var(--ink-soft);
}

@media (max-width: 36rem) {
  .fascinations li {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* notes list */
.notes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.notes a {
  display: block;
  padding-block: 1.2rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}

.notes li:first-child a {
  padding-top: 0;
}

.notes .meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.notes .title {
  display: block;
  margin: 0.35rem 0 0.3rem;
  font-size: 1.45rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.notes .title::after {
  content: "\2192";
  display: inline-block;
  margin-left: 0.35em;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.notes a:hover {
  color: inherit;
}

.notes a:hover .title {
  color: var(--accent);
}

.notes a:hover .title::after {
  transform: translateX(4px);
}

.notes .summary {
  display: block;
  font-size: 1.02rem;
  color: var(--muted);
}

/* now */
.updated {
  margin-bottom: 1.25rem !important;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.dashed li {
  position: relative;
  margin-bottom: 0.65rem;
  padding-left: 1.6rem;
}

.dashed li::before {
  content: "\2014";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* contact */
.hello-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.hello-link:hover {
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

/* ---------- footer ---------- */
.site-footer {
  padding-block: 2rem 3.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--muted);
}

.site-footer p {
  max-width: 36rem;
  margin: 0 0 0.75rem;
}

.site-footer .fine {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

/* ---------- notes (essay pages) ---------- */
.note-head {
  padding-block: clamp(2rem, 8vw, 4.5rem) 2.25rem;
}

.back {
  display: inline-block;
  margin-bottom: clamp(2rem, 6vw, 3rem);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
}

.note-title {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 8vw, 3.5rem);
  font-weight: 350;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.dek {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  font-style: italic;
  line-height: 1.45;
  color: var(--ink-soft);
}

.prose {
  padding-bottom: 1rem;
}

.prose p {
  margin: 0 0 1.25em;
}

.prose > p:first-child {
  display: flow-root; /* keep the drop cap from spilling into a short opening line's neighbour */
}

.prose > p:first-child::first-letter {
  float: left;
  padding: 0.07em 0.1em 0 0;
  font-size: 3.5em;
  font-weight: 400;
  line-height: 0.85;
  color: var(--accent);
}

.signoff {
  margin: 1.5rem 0 3rem;
  font-style: italic;
  color: var(--muted);
}

.note-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  padding-block: 2rem;
  border-top: 1px solid var(--rule);
}

.note-nav a {
  display: block;
  text-decoration: none;
}

.note-nav .dir {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.note-nav .t {
  font-size: 1.1rem;
  line-height: 1.3;
}

.note-nav .next {
  grid-column: 2;
  text-align: right;
}

/* ---------- build log ---------- */
.log {
  margin: 0 0 3rem;
  padding: 0;
  list-style: none;
}

.log li {
  position: relative;
  padding: 0 0 2rem 1.5rem;
  border-left: 1px solid var(--rule);
}

.log li::before {
  content: "";
  position: absolute;
  top: 0.3rem;
  left: -0.3rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
}

.log li:first-child::before {
  background: var(--accent);
}

.log li:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.log-meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.log-meta span {
  color: var(--accent);
}

.log-title {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.log li p:last-child {
  margin: 0;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
}

/* ---------- 404 ---------- */
.lost {
  padding-block: clamp(4rem, 16vw, 9rem);
}

/* ---------- gentle reveal (only when JS + IO are available) ---------- */
.has-io .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.has-io .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .caret,
  .thought blockquote.in {
    animation: none;
  }

  .has-io .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- inline code ---------- */
code {
  padding: 0.05em 0.35em;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg-raised);
  font-family: var(--mono);
  font-size: 0.8em;
}
