/* Donkey Forge site styles. Fonts are self-hosted; no third-party requests. */

@font-face { font-family: "Archivo"; src: url("/fonts/archivo-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --bg: #101113;
  --bg-raised: #15171a;
  --line: #2a2d32;
  --line-strong: #3b3f45;
  --ink: #ebe7df;
  --steel: #a6acb3;
  --steel-dim: #80868d;
  --accent: #8fb5a2; /* verdigris: patina on worked bronze */
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  color-scheme: dark;
}

/* minimal reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; }
body, h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; }
a { color: inherit; text-decoration: inherit; }
svg { display: block; }

html {
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(235, 231, 223, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(235, 231, 223, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #0c0d0e; }

a:focus-visible, main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
main:focus { outline: none; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.mono-label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel); }
.mono-caption { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--steel-dim); }

.arrow { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; transition: transform 160ms ease; }

/* skip link */
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 13px; transition: top 120ms ease; }
.skip-link:focus { top: 12px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(16, 17, 19, 0.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; letter-spacing: 0.01em; }
.wordmark-glyph { width: 22px; height: 22px; fill: var(--ink); }
.primary-nav { display: flex; gap: clamp(14px, 2.4vw, 28px); }
.primary-nav a {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--steel);
  padding-block: 6px;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat;
  transition: color 140ms ease, background-size 200ms ease;
}
.primary-nav a:hover { color: var(--ink); background-size: 100% 1px; }

/* hero / drawing sheet */
.hero { padding-block: clamp(28px, 5vw, 56px) clamp(56px, 8vw, 96px); }
.sheet { position: relative; border: 1px solid var(--line-strong); padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 64px) 0; background: rgba(21, 23, 26, 0.55); }
.sheet-corner { position: absolute; width: 14px; height: 14px; border: 0 solid var(--accent); }
.sheet-corner.tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.sheet-corner.tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.sheet-corner.bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.sheet-corner.br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.sheet-ruler { position: absolute; list-style: none; display: flex; font-family: var(--mono); font-size: 10px; color: var(--steel-dim); }
.sheet-ruler.cols { top: 8px; left: 0; right: 0; }
.sheet-ruler.cols li { flex: 1; text-align: center; border-left: 1px solid var(--line); }
.sheet-ruler.cols li:first-child { border-left: 0; }
.sheet-ruler.rows { top: 0; bottom: 0; left: 8px; flex-direction: column; }
.sheet-ruler.rows li { flex: 1; display: flex; align-items: center; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy { padding-block: 12px clamp(32px, 4vw, 56px); }
.hero-title { margin-top: 18px; font-size: clamp(48px, 8.4vw, 104px); font-weight: 680; letter-spacing: -0.035em; line-height: 0.95; }
.hero-tagline { margin-top: 22px; max-width: 30ch; font-size: clamp(20px, 2.2vw, 25px); line-height: 1.35; font-weight: 500; letter-spacing: -0.01em; }
.hero-support { margin-top: 18px; max-width: 56ch; color: var(--steel); }
.hero-actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; }

/* CTA: GitHub. Solid plate with a sliding arrow. */
.cta-github { display: inline-flex; align-items: center; gap: 12px; padding: 14px 22px; background: var(--ink); color: #0f1012; font-weight: 620; font-size: 16px; border: 1px solid var(--ink); transition: background-color 160ms ease, box-shadow 160ms ease; }
.cta-github:hover { background: #fffaf1; box-shadow: 4px 4px 0 var(--accent); }
.cta-github:hover .arrow { transform: translate(2px, -2px); }

/* CTA: Contact. Outlined slot showing the address, label on a tab. */
.cta-contact { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); transition: border-color 160ms ease; }
.cta-contact-label { display: flex; align-items: center; padding: 0 16px; font-weight: 620; border-right: 1px solid var(--line-strong); transition: background-color 160ms ease, color 160ms ease; }
.cta-contact-addr { display: flex; align-items: center; padding: 14px 16px; font-family: var(--mono); font-size: 13.5px; color: var(--steel); }
.cta-contact:hover { border-color: var(--accent); }
.cta-contact:hover .cta-contact-label { background: var(--accent); color: #0c0d0e; }

.hero-figure { padding-bottom: 24px; }
.anvil { width: 100%; height: auto; overflow: visible; }
.hero-figure .mono-caption { margin-top: 10px; text-align: right; }

.dw-body { fill: rgba(235, 231, 223, 0.035); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.dw-thin { stroke: var(--steel-dim); stroke-width: 0.75; fill: none; }
.dw-dim { stroke: var(--steel); stroke-width: 0.75; fill: none; }
.dw-arrowhead { fill: none; stroke: var(--steel); stroke-width: 1; }
.dw-center { stroke: var(--accent); stroke-width: 0.75; stroke-dasharray: 14 3 2 3; opacity: 0.8; }
.dw-hidden { fill: none; stroke: var(--steel-dim); stroke-width: 0.75; stroke-dasharray: 3 3; }
.dw-hatch { stroke: var(--steel-dim); stroke-width: 0.75; }
.dw-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; fill: var(--steel); }

@media (prefers-reduced-motion: no-preference) {
  .dw-body { stroke-dasharray: 1400; stroke-dashoffset: 0; animation: df-draw 1.6s cubic-bezier(0.6, 0, 0.2, 1) both; }
  @keyframes df-draw { from { stroke-dashoffset: 1400; } to { stroke-dashoffset: 0; } }
}

.title-block { margin: 0 calc(clamp(20px, 5vw, 64px) * -1); display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; border-top: 1px solid var(--line-strong); }
.title-block > div { padding: 10px 16px 12px; border-left: 1px solid var(--line); }
.title-block > div:first-child { border-left: 0; }
.title-block dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel-dim); }
.title-block dd { margin-top: 2px; font-family: var(--mono); font-size: 13px; color: var(--ink); }

/* sections */
.section { padding-block: clamp(64px, 9vw, 120px); border-top: 1px solid var(--line); }
.section-head h2 { margin-top: 12px; font-size: clamp(32px, 4.2vw, 48px); }
.section-lede { margin-top: 16px; max-width: 38ch; color: var(--steel); }
.section-head.inline { display: flex; align-items: baseline; gap: 20px; margin-bottom: clamp(32px, 4vw, 48px); }
.section-head.inline h2 { margin-top: 0; }

/* Areas: sticky heading + numbered spec rows */
.areas-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.areas .section-head { position: sticky; top: 100px; }
.area-list { list-style: none; border-top: 1px solid var(--line-strong); }
.area-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 8px; row-gap: 6px; padding: 26px 0; border-bottom: 1px solid var(--line); transition: background-color 180ms ease; }
.area-row:hover { background: linear-gradient(90deg, rgba(143, 181, 162, 0.06), transparent 70%); }
.area-num { grid-row: span 2; font-family: var(--mono); font-size: 13px; color: var(--accent); padding-top: 5px; }
.area-title { font-size: clamp(20px, 2vw, 24px); font-weight: 600; }
.area-body { color: var(--steel); max-width: 58ch; }

/* Principles: 2x2 plates with stamped tags */
.principle-grid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.principle { background: var(--bg-raised); padding: clamp(24px, 3.4vw, 40px); min-height: 180px; display: flex; flex-direction: column; }
.principle-tag { color: var(--steel-dim); }
.principle-title { margin-top: auto; padding-top: 40px; font-size: clamp(22px, 2.4vw, 30px); }
.principle-body { margin-top: 10px; color: var(--steel); max-width: 44ch; }

/* Projects: empty bay */
.bay { border: 1px dashed var(--line-strong); padding: clamp(28px, 4vw, 48px); display: grid; gap: 14px; justify-items: start; background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(235, 231, 223, 0.018) 14px 15px); }
.bay-status { display: inline-flex; align-items: center; gap: 10px; }
.bay-dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--steel); }
.bay-text { font-size: clamp(20px, 2.2vw, 26px); font-weight: 500; letter-spacing: -0.01em; }

/* CTA: repos. Inline text link with a ruled underline. */
.cta-repos { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-family: var(--mono); font-size: 13.5px; color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; transition: text-underline-offset 160ms ease, color 160ms ease; }
.cta-repos:hover { color: var(--ink); text-underline-offset: 7px; }
.cta-repos:hover .arrow { transform: translate(2px, -2px); }

/* Project list (used once projects are added) */
.project-list { list-style: none; border-top: 1px solid var(--line-strong); }
.project-row { padding: 22px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.project-link { display: inline-flex; align-items: center; gap: 10px; }
.project-name { font-size: 22px; font-weight: 600; }
.project-link:hover .project-name { text-decoration: underline; text-underline-offset: 5px; }
.project-desc { color: var(--steel); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.contact-block { display: grid; gap: 14px; }

/* CTA: mail. Oversized address, a rule that extends on hover. */
.cta-mail {
  justify-self: start; font-size: clamp(26px, 4.6vw, 56px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; padding-bottom: 10px;
  background: linear-gradient(var(--line-strong), var(--line-strong)) 0 100% / 100% 2px no-repeat, linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size 260ms ease;
}
.cta-mail:hover { background-size: 100% 2px, 100% 2px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line-strong); padding-block: 32px 40px; }
.footer-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 16px 32px; align-items: center; }
.footer-name { font-weight: 650; }
.footer-links { list-style: none; display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--steel); font-size: 15px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.footer-links a:hover { color: var(--ink); text-decoration-color: var(--accent); }
.footer-legal { font-size: 11px; color: var(--steel-dim); }

/* 404 */
.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 48px 20px; }
.notfound h1 { font-size: clamp(40px, 6vw, 64px); margin-top: 12px; }
.notfound p { color: var(--steel); margin-top: 12px; }
.notfound a { display: inline-block; margin-top: 24px; font-family: var(--mono); font-size: 13.5px; color: var(--accent); text-decoration: underline; text-underline-offset: 5px; }

/* responsive */
@media (max-width: 900px) {
  .hero-grid, .areas-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .areas .section-head { position: static; }
  .hero-figure { max-width: 520px; }
  .hero-copy { padding-bottom: 0; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .primary-nav a:not([href="#contact"]) { display: none; }
  .sheet-ruler { display: none; }
  .principle-grid { grid-template-columns: minmax(0, 1fr); }
  .principle { min-height: 0; }
  .principle-title { padding-top: 24px; }
  .title-block { grid-template-columns: 1fr 1fr; }
  .title-block > div:nth-child(3) { border-left: 0; }
  .title-block > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .cta-github, .cta-contact { width: 100%; }
  .cta-github { justify-content: space-between; }
  .cta-contact-addr { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .area-row { grid-template-columns: 40px minmax(0, 1fr); }
}

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

@media print {
  body { background: #fff; color: #000; }
  .site-header, .skip-link { display: none; }
}
