:root {
  color-scheme: light dark;
  --paper: #f5f1e8;
  --ink: #1f1d17;
  --muted: #615d52;
  --rule: color-mix(in oklch, var(--ink) 10%, transparent);
  --accent: #294b41;
  --text: clamp(0.9rem, 0.86rem + 0.16vw, 1.02rem);
  --leading: 1.22;
  --edge: clamp(1rem, 4vw, 2rem);
  --page: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171611;
    --ink: #eee8dc;
    --muted: #aaa294;
    --rule: color-mix(in oklch, var(--ink) 14%, transparent);
    --accent: #a8c5b8;
  }
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 100%;
  text-rendering: geometricPrecision;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
}

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

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

.page-shell {
  display: grid;
  width: 100%;
  min-height: 100vh;
  margin-inline: auto;
  padding: var(--edge);
  max-width: var(--page);
  grid-template-rows: auto auto 1fr auto;
  gap: clamp(1.8rem, 4vw, 3.75rem);
}

.site-header,
.site-footer,
.statement,
.index-row {
  font-size: var(--text);
  font-weight: 400;
  line-height: var(--leading);
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.site-header,
.site-footer {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0.5rem;
}

.site-header > *,
.site-footer > *,
.index-row > * {
  min-width: 0;
}

.wordmark,
.intro-link,
.site-footer a,
.contact-form button {
  width: fit-content;
}

.intro-link,
.site-footer a,
.contact-form button {
  position: relative;
  color: var(--accent);
}

.intro-link::after,
.site-footer a::after,
.contact-form button::after {
  position: absolute;
  right: 0;
  bottom: -0.18em;
  left: 0;
  height: 0.09em;
  content: "";
  background: currentColor;
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 180ms ease;
}

.intro-link:hover::after,
.site-footer a:hover::after,
.contact-form button:hover::after {
  transform: scaleX(0.74);
}

.statement {
  max-width: 42rem;
  margin: clamp(1.25rem, 2.4vw, 2.25rem) 0 0;
  width: 100%;
}

.statement p {
  margin: 0;
}

.statement p + p {
  margin-top: 1.1em;
  color: var(--muted);
}

.index {
  display: grid;
  width: 100%;
  align-self: start;
  border-top: 1px solid var(--rule);
}

.index-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(8rem, 0.72fr) minmax(16rem, 1.55fr) minmax(9rem, 0.72fr);
  gap: clamp(1rem, 2.4vw, 2.5rem);
  align-items: baseline;
  padding: 0.52em 1.45rem 0.5em 0;
  border-bottom: 1px solid var(--rule);
  width: 100%;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.index-row:hover {
  color: var(--accent);
}

.index-row::after {
  position: absolute;
  top: 0.52em;
  right: 0;
  color: var(--accent);
  content: "↗";
  opacity: 0;
  transform: translate(-0.25rem, 0.08rem);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.index-row:hover::after {
  opacity: 1;
  transform: translate(0, 0.08rem);
}

.index-name,
.index-desc,
.index-meta {
  display: block;
}

.index-name {
  font-weight: 500;
}

.wordmark,
.intro-link,
.site-footer a,
.contact-form button {
  font-weight: 500;
}

.index-desc {
  color: color-mix(in oklch, currentColor 70%, var(--muted));
  max-width: 34rem;
  overflow-wrap: anywhere;
}

.index-meta {
  color: color-mix(in oklch, var(--muted) 78%, var(--paper));
  text-align: right;
  overflow-wrap: anywhere;
}

.index-row:hover .index-meta,
.index-row:hover .index-desc {
  color: currentColor;
}

.site-footer {
  color: var(--muted);
}

.contact-form {
  display: grid;
  width: min(100%, 42rem);
  grid-template-columns: minmax(10rem, 1.4fr) minmax(9rem, 0.8fr) auto auto;
  gap: 0.5rem;
  align-items: end;
}

.contact-trap {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.contact-form label {
  position: relative;
  display: grid;
  min-width: 0;
}

.contact-form label span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.contact-form input {
  width: 100%;
  min-width: 0;
  padding: 0.42rem 0 0.38rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: var(--leading);
  outline: none;
}

.contact-form input::placeholder {
  color: color-mix(in oklch, var(--muted) 64%, transparent);
  opacity: 1;
}

.contact-form input:focus {
  border-color: var(--accent);
}

.contact-form button {
  appearance: none;
  border: 0;
  border-radius: 0;
  padding: 0.42rem 0 0.38rem;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  line-height: var(--leading);
}

.contact-form button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.contact-form button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.contact-status {
  min-width: 4.5rem;
  padding: 0.42rem 0 0.38rem;
  color: var(--muted);
  font: inherit;
  line-height: var(--leading);
}

.contact-status:empty {
  display: none;
}

@media (max-width: 980px) {
  .page-shell {
    gap: 1.9rem;
    max-width: 34rem;
    min-height: auto;
    padding-bottom: calc(var(--edge) + 7rem + env(safe-area-inset-bottom));
    grid-template-rows: auto;
  }

  .site-header,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer {
    margin-top: clamp(2.75rem, 12vh, 5.5rem);
  }

  .statement {
    max-width: 22rem;
    margin-top: 1.2rem;
  }

  .index-row {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 0.18rem;
    padding: 0.52rem 0;
  }

  .index-row::after {
    display: none;
  }

  .index-meta {
    text-align: left;
  }

  .index-desc {
    max-width: 22rem;
  }

  .index-meta {
    max-width: 22rem;
  }

  .contact-form {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .contact-form input,
  .contact-form button {
    min-height: 44px;
    padding-top: 0.62rem;
    padding-bottom: 0.58rem;
    scroll-margin-block: 28vh;
  }
}

@media (max-width: 420px) {
  .page-shell {
    --edge: 0.95rem;
    max-width: 22rem;
  }

  .statement,
  .index-desc,
  .index-meta {
    max-width: 18rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
