/* Self-hosted fonts (SIL Open Font License) */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/bricolage-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/bricolage-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f2ede3;
  --paper-2: #e9e2d4;
  --ink: #17140f;
  --muted: #6d6558;
  --rule: #cfc5b3;
  --signal: #1e8a4a;
  --term-bg: #17140f;
  --term-fg: #ece4d4;
  --term-muted: #8d8576;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --pad: clamp(16px, 4vw, 56px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13120f;
    --paper-2: #1c1a16;
    --ink: #ece4d4;
    --muted: #9a9283;
    --rule: #34302a;
    --signal: #4ade80;
    --term-bg: #0b0a08;
    --term-fg: #ece4d4;
    --term-muted: #7d7567;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; }

::selection { background: var(--signal); color: var(--paper); }

/* ---------- header ---------- */
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px var(--pad);
  font-family: var(--mono);
  font-size: 0.9rem;
}
.wordmark { font-weight: 600; text-decoration: none; }
.cursor { color: var(--signal); animation: blink 1.1s steps(1) infinite; }
.top nav { display: flex; gap: 22px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
.top nav a::before { content: "/"; color: var(--rule); margin-right: 2px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(40px, 8vw, 110px) var(--pad) clamp(48px, 7vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 40px;
  align-items: end;
  border-bottom: 1px solid var(--ink);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}
.hero::after {
  /* fade the grid towards the bottom */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, var(--paper) 95%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

h1 {
  font-weight: 800;
  font-size: clamp(3.4rem, 11vw, 9.5rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
}
h1 .line { display: block; white-space: nowrap; }
h1 .line:nth-child(2) { padding-left: 0.6em; }
h1 .line:nth-child(3) { padding-left: 1.2em; }
.rec {
  display: inline-block;
  width: 0.16em;
  height: 0.16em;
  margin-left: 0.08em;
  border-radius: 50%;
  background: var(--signal);
  vertical-align: 0.55em;
  animation: rec 1.6s ease-in-out infinite;
}

.hero-side { max-width: 400px; padding-bottom: 0.6em; }
.hero-side p { color: var(--muted); }
.status {
  margin-top: 22px !important;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink) !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 25%, transparent);
}

/* ---------- section scaffolding ---------- */
.work, .process, .contact { padding: clamp(56px, 8vw, 110px) var(--pad); }
.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(28px, 4vw, 48px);
  color: var(--muted);
}
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* ---------- services ---------- */
.group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--ink);
}
.group:last-of-type { border-bottom: 1px solid var(--ink); }
.group-title {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.group-title .mono { font-weight: 400; color: var(--signal); letter-spacing: 0.02em; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px dashed var(--rule);
  transition: padding-left 0.2s ease;
}
.rows li:first-child { padding-top: 4px; }
.rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.rows li:hover { padding-left: 10px; }
.rows li:hover h3 { color: var(--signal); }
.rows h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; transition: color 0.2s; }
.rows p { color: var(--muted); font-size: 1rem; }

.aside {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}
.aside::before { content: "* "; color: var(--signal); }

/* ---------- process / terminal ---------- */
.process { background: var(--paper-2); border-block: 1px solid var(--ink); }
.terminal {
  max-width: 860px;
  background: var(--term-bg);
  color: var(--term-fg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 8px 8px 0 var(--signal);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid #2c2822;
}
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a352d; }
.term-bar em {
  margin-left: auto;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.75rem;
  color: var(--term-muted);
}
.terminal pre {
  margin: 0;
  padding: 22px 22px 26px;
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.terminal .c { color: #4ade80; }
.terminal .m { color: var(--term-muted); }
.terminal .ok { color: #69db7c; }
.terminal .blink { animation: blink 1.1s steps(1) infinite; margin-left: 6px; }

/* ---------- contact ---------- */
.contact-lead { color: var(--muted); margin-bottom: 18px; }
.big-mail {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
  font-weight: 800;
  font-size: clamp(1.9rem, 7.5vw, 6.5rem);
  letter-spacing: -0.04em;
  line-height: 1;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--signal), var(--signal)) left bottom / 0 0.08em no-repeat;
  transition: background-size 0.35s ease;
  padding-bottom: 0.08em;
}
.big-mail:hover { background-size: 100% 0.08em; }
.big-mail .arrow { color: var(--signal); transition: transform 0.25s ease; }
.big-mail:hover .arrow { transform: translateX(0.15em); }

/* ---------- footer ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px var(--pad);
  border-top: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- motion ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes rec { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor, .rec, .terminal .blink { animation: none; }
  .rows li, .rows li:hover { transition: none; padding-left: 0; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .group { grid-template-columns: 1fr; gap: 18px; }
  .group-title { flex-direction: row; align-items: baseline; gap: 12px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .top nav { gap: 12px; }
  .rows li { grid-template-columns: 1fr; gap: 4px; }
  .foot { flex-direction: column; gap: 4px; }
  .terminal { box-shadow: 5px 5px 0 var(--signal); }
}
