:root {
  --paper: #f3f0e8;
  --ink: #1b2320;
  --muted: #5d6862;
  --line: #d5d0c3;
  --accent: #35584a;
  --field: #fbf9f4;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141a18;
    --ink: #e9e5da;
    --muted: #98a39c;
    --line: #2c3632;
    --accent: #9cc4b1;
    --field: #1a2220;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--accent); color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Header */
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.top { align-items: center; }
.mark img { border-radius: 4px; display: block; }
.mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.top nav { display: flex; gap: 22px; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--accent); }

/* Hero */
.hero { padding: 96px 0 88px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6.4vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
  max-width: 15em;
  text-wrap: balance;
}
.hero p { max-width: 34em; margin: 0; color: var(--muted); font-size: 19px; }

/* Sections */
.label {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 500;
}
section { padding: 0 0 88px; }

/* Projects */
.logos {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.tile {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 12%;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.tile img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.tile.dark { background: #121b16; }
.tile.dark img { width: 100%; }
.tile.light { background: #f6f3ec; }
.tile.light img { max-height: 78%; }
.tile.plain span {
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 27px);
  line-height: 1.15;
  text-align: center;
  letter-spacing: 0.01em;
}

/* Contact */
.contact h2, .doc h1 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.contact h2 { font-size: clamp(28px, 4.4vw, 40px); line-height: 1.12; margin: 0 0 12px; }
.contact > p { color: var(--muted); margin: 0 0 32px; max-width: 34em; }
form { display: grid; gap: 18px; max-width: 560px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, textarea {
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px 13px;
  width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 150px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
button {
  font: inherit;
  font-size: 16px;
  justify-self: start;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 4px;
  padding: 12px 26px;
  cursor: pointer;
}
button:hover { background: var(--accent); }
button:disabled { opacity: 0.55; cursor: default; }
.status { min-height: 1.6em; margin: 0; font-size: 15px; }
.status.ok { color: var(--accent); }
.status.err { color: #b0452f; }

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 14px;
  color: var(--muted);
}

/* Document pages */
.doc { padding: 72px 0 88px; max-width: 680px; }
.doc h1 { font-size: clamp(32px, 5.4vw, 48px); line-height: 1.1; margin: 0 0 12px; }
.doc .meta { color: var(--muted); margin: 0 0 44px; font-size: 15px; }
.doc h2 { font-family: var(--serif); font-weight: 400; font-size: 25px; margin: 48px 0 10px; }
.doc p, .doc ul { margin: 0 0 16px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 8px; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 16px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 500; color: var(--muted); font-size: 14px; }

@media (max-width: 600px) {
  .hero { padding: 64px 0 60px; }
  section { padding-bottom: 64px; }
  .row { grid-template-columns: 1fr; }
  .logos { grid-template-columns: 1fr; }
  .tile { aspect-ratio: 16 / 9; padding: 10% 18%; }
}
