:root {
  --bg: #0e1116;
  --block: #121720;
  --line: #232a34;
  --line-2: #2a313c;
  --text: #e6e9ee;
  --muted: #9aa4b2;
  --soft: #c4cad3;
  --accent: #2dd4bf;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

ul { list-style: none; margin: 0; padding: 0; }

/* --- hero --- */
.hero {
  display: flex;
  gap: 36px;
  align-items: center;
  /* Leaves room for the whole What I do section on the first screen;
     290px = that section down to the bottom of its blocks, plus a small gap. */
  min-height: calc(100vh - 290px);
  min-height: calc(100svh - 290px);
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--line);
}
.photo {
  display: block;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
}
.path { color: var(--accent); font-size: 14px; margin: 0; min-height: 1.55em; }
h1 { font-size: 46px; line-height: 1.1; letter-spacing: -1px; margin: 8px 0 6px; }
.sub { color: var(--muted); font-size: 18px; margin: 0; }
.lead { color: var(--soft); font-size: 19px; max-width: 600px; margin: 18px 0 0; }
.tags { display: flex; flex-wrap: wrap; margin-top: 22px; }

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 3px 9px;
  margin: 0 6px 6px 0;
}

/* --- sections --- */
section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--accent);
  margin: 0 0 18px;
  min-height: 1.55em;
}
section h2:not(.label) { font-size: 28px; margin: 0 0 22px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.box {
  background: var(--block);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}
.box h3 { font-size: 16px; margin: 0 0 6px; }
.box p { color: var(--muted); font-size: 14px; margin: 0; }

.skills { margin: 0; }
.row { margin-bottom: 16px; }
.row dt { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.row dd { margin: 0; }

.how li { font-size: 19px; margin-bottom: 12px; }
.how li::before { content: "→ " / ""; color: var(--accent); }

/* --- contact --- */
form { max-width: 480px; }
label { display: block; color: var(--muted); font-size: 13px; margin: 0 0 6px; }
input, textarea {
  display: block;
  width: 100%;
  background: var(--block);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  margin: 0 0 14px;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

button {
  background: var(--accent);
  color: var(--bg);
  border: 0;
  border-radius: 6px;
  padding: 11px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: .6; cursor: wait; }

#form-status { min-height: 1.55em; margin: 14px 0 0; color: var(--muted); }
#form-status.ok { color: var(--accent); }
#form-status.err { color: #f59e8b; }

.links { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }

footer p { color: var(--muted); font-size: 13px; margin: 0; padding: 28px 0; }

/* --- writing list (home) --- */
.posts li { border-top: 1px solid var(--line); }
.posts li:last-child { border-bottom: 1px solid var(--line); }
.posts a { display: block; padding: 16px 0; color: var(--text); }
.posts a:hover { text-decoration: none; }
.posts a:hover .post-title { color: var(--accent); }
.post-title { display: block; font-size: 18px; font-weight: 600; }
.post-meta { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }

/* --- article page --- */
.post { max-width: 680px; padding: 56px 0 64px; border-bottom: 1px solid var(--line); }
.post .back { font-size: 14px; line-height: 1.55; margin: 0 0 40px; }
.post .label { color: var(--accent); font-size: 13px; line-height: 1.55; margin: 0 0 12px; }
.post h1 { font-size: 36px; letter-spacing: -.5px; margin: 0 0 32px; }
.post h2 { font-size: 22px; margin: 44px 0 14px; }
.post p { color: var(--soft); font-size: 17px; line-height: 1.7; margin: 0 0 18px; }
.post strong { color: var(--text); }
.post ul { margin: 0 0 18px; }
.post li { color: var(--soft); font-size: 17px; line-height: 1.7; margin: 0 0 8px; padding-left: 22px; position: relative; }
.post li::before { content: "–"; color: var(--accent); position: absolute; left: 0; }
.post .try { border-left: 2px solid var(--accent); padding-left: 16px; }
.post .table { overflow-x: auto; margin: 0 0 18px; }
.post table { width: 100%; border-collapse: collapse; font-size: 15px; }
.post th, .post td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.post th { color: var(--muted); font-weight: 400; font-size: 13px; }
.post td:last-child { color: var(--accent); }
.post .post-end { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }

/* --- phones --- */
@media (max-width: 640px) {
  .hero { flex-direction: column; align-items: flex-start; justify-content: center; gap: 24px; padding: 64px 0 56px; }
  .photo { width: 112px; height: 112px; }
  h1 { font-size: 36px; }
  .lead { font-size: 17px; }
  section { padding: 48px 0; }
  .grid { grid-template-columns: 1fr 1fr; }
  .post { padding: 40px 0 48px; }
  .post h1 { font-size: 28px; }
  .post p, .post li { font-size: 16px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
}

/* --- motion (off for prefers-reduced-motion) --- */
.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .cursor { animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }

  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal.in { opacity: 1; transform: none; }
  .grid .reveal:nth-child(2), .how li:nth-child(2) { transition-delay: .08s; }
  .grid .reveal:nth-child(3), .how li:nth-child(3) { transition-delay: .16s; }
  .grid .reveal:nth-child(4) { transition-delay: .24s; }

  .box { transition: border-color .25s, transform .25s; }
  .box:hover { border-color: var(--accent); }
  .js .box.reveal { transition: opacity .6s ease, transform .6s ease, border-color .25s; }
  .js .box.reveal.in:hover { transform: translateY(-2px); transition-delay: 0s; }
  .tag { transition: background-color .2s; }
  .tag:hover { background: #13302d; }
  input, textarea, button { transition: border-color .2s, filter .2s; }
}
