@font-face {
  font-family: Newsreader;
  src: url("/fonts/newsreader-roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Newsreader;
  src: url("/fonts/newsreader-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #faf7f2;
  --ink: #2d332b;
  --sage: #526449;
  --muted: #686c61;
  --line: #d7d8cd;
  --wash: #eef0e7;
  --selection: #dee5d4;
  --serif: Newsreader, Georgia, serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #20231f;
  --ink: #f1ece1;
  --sage: #b4c39d;
  --muted: #b1b4a7;
  --line: #444a3e;
  --wash: #2c3228;
  --selection: #46533e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #20231f;
    --ink: #f1ece1;
    --sage: #b4c39d;
    --muted: #b1b4a7;
    --line: #444a3e;
    --wash: #2c3228;
    --selection: #46533e;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body, a, button { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--selection); color: var(--ink); }
a { color: inherit; text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; cursor: pointer; }
button, summary, a { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 6px; border-radius: 2px; }

.skip-link {
  position: absolute;
  top: -6rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--paper);
}
.skip-link:focus { top: 1rem; }

.page {
  width: min(100% - 7rem, 70rem);
  min-height: 100svh;
  margin-inline: auto;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 7rem;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  padding-block: 0.3rem;
  font-family: var(--serif);
  font-size: 1.875rem;
  letter-spacing: -0.045em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--sage); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.5rem 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
}
.theme-toggle:hover { color: var(--ink); }
.theme-orb {
  display: block;
  width: 1rem;
  height: 1rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: inset -0.4rem 0 0 currentColor;
  transform: rotate(-35deg);
  transition: transform 240ms ease;
}
[data-theme="dark"] .theme-orb { transform: rotate(145deg); }

.hero { padding-block: 5rem 4.25rem; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.studio-dot { width: 0.3rem; height: 0.3rem; background: var(--sage); border-radius: 50%; }

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.5rem, 7.8vw, 7rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.03;
}
h1 em { color: var(--sage); font-weight: 400; }
.hero-caption {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  margin-top: 1.75rem;
  text-decoration-thickness: 1px;
  color: var(--muted);
  font-size: 0.875rem;
}
.hero-caption > span { color: var(--sage); font-size: 1.25rem; }

.open-source, .studio-note, .contact {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2rem, 6vw, 6rem);
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
}

.section-number {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--muted);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
}
h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}
.studio-note h2 > span { display: block; }
.note-copy { padding-top: 0.2rem; }
.note-copy > p { max-width: 33rem; margin: 0; }
.note-copy > p + p { margin-top: 1rem; color: var(--muted); }

.principles { margin-top: 1.25rem; }
.principles summary {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 1rem;
  color: var(--sage);
  font-size: 0.8125rem;
  cursor: pointer;
  list-style: none;
}
.principles summary::-webkit-details-marker { display: none; }
.principles summary:hover { color: var(--ink); }
.expand-mark { position: relative; width: 0.625rem; height: 0.625rem; }
.expand-mark::before, .expand-mark::after {
  position: absolute;
  top: 50%;
  width: 100%;
  height: 1px;
  background: currentColor;
  content: "";
}
.expand-mark::after { transform: rotate(90deg); transition: transform 180ms ease; }
.principles[open] .expand-mark::after { transform: rotate(0); }
.principles ul { margin: 0.75rem 0 0; padding: 0 0 0 1rem; border-left: 1px solid var(--line); list-style: none; }
.principles li { margin-top: 0.85rem; color: var(--muted); font-size: 0.875rem; }
.principles strong { display: block; font-weight: 500; color: var(--ink); }

.contact { padding-block: 2.5rem 3rem; }
.contact .section-heading { max-width: 18rem; }
.contact-content > p { margin: 0 0 0.55rem; color: var(--muted); font-size: 0.875rem; }
.email-link {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-height: 2.75rem;
  max-width: 100%;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.7vw, 2rem);
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--sage);
  text-decoration: none;
}
.email-link > span {
  background-image: linear-gradient(var(--sage), var(--sage));
  background-position: 0 94%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: background-size 220ms ease;
}
.email-link:hover > span, .email-link:focus-visible > span { background-size: 100% 1px; }
.email-link svg { flex: 0 0 1.1rem; width: 1.1rem; height: 1.1rem; stroke: currentColor; stroke-width: 1.3; transition: transform 220ms ease; }
.email-link:hover svg { transform: translate(2px, -2px); }
.copy-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.copy-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.6875rem;
  transition: background-color 180ms ease, color 180ms ease;
}
.copy-button:hover { background: var(--wash); color: var(--ink); }
.copy-button svg { width: 1rem; height: 1rem; stroke: currentColor; stroke-width: 1.2; }
.copy-status { max-width: 18rem; color: var(--muted); font-size: 0.6875rem; }

.open-source { scroll-margin-top: 2rem; }
.section-intro { max-width: 20rem; margin: 1rem 0 0.5rem; color: var(--muted); font-size: 0.875rem; }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  color: var(--sage);
  font-size: 0.8125rem;
  text-decoration-thickness: 1px;
}
.text-link:hover, .hero-caption:hover { color: var(--ink); }
.text-link > span { transition: transform 180ms ease; }
.text-link:hover > span { transform: translate(2px, -2px); }
.project + .project { margin-top: 1.25rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.project-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1rem; }
.project h3 { margin: 0; font-family: var(--serif); font-size: 1.75rem; font-weight: 400; letter-spacing: -0.02em; line-height: 1.2; }
.project-license { color: var(--muted); font-size: 0.625rem; white-space: nowrap; }
.project p { max-width: 33rem; margin: 0.75rem 0 0.3rem; color: var(--muted); font-size: 0.875rem; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.6875rem;
}
.footer p { margin: 0; }
.footer span { margin-left: 0.75rem; }

@media (prefers-reduced-motion: no-preference) {
  html { transition: background-color 220ms ease, color 220ms ease; }
  .hero { animation: arrive 600ms ease both; }
  @keyframes arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 700px) {
  .page { width: calc(100% - 3rem); }
  .masthead { min-height: 5.5rem; }
  .wordmark { font-size: 1.6rem; }
  .theme-toggle { font-size: 0.6875rem; }
  .hero { padding-block: 3.5rem 3rem; }
  .eyebrow { font-size: 0.5625rem; letter-spacing: 0.09em; margin-bottom: 1.75rem; }
  h1 { font-size: clamp(2.45rem, 8.9vw, 3.8rem); }
  .hero-caption { font-size: 0.75rem; margin-top: 1.5rem; }
  .open-source, .studio-note, .contact { grid-template-columns: 1fr; gap: 1.5rem; padding-block: 2rem; }
  h2 { font-size: 1.875rem; }
  .studio-note h2 > span { display: inline; }
  .note-copy { font-size: 0.9375rem; }
  .contact .section-heading { max-width: none; }
  .email-link { font-size: clamp(1.25rem, 5.3vw, 1.8rem); gap: 0.65rem; }
  .footer { align-items: flex-start; font-size: 0.625rem; }
  .footer > p:last-child { text-align: right; }
  .footer span { display: block; margin-left: 0; }
}
