:root {
  --paper: #e9ebed;
  --paper-deep: #dde1e4;
  --ink: #1e292a;
  --muted: #627071;
  --line: #c9cec8;
  --blue: #2f5274;
  --blue-dark: #223e59;
  --rust: #a65e42;
  --white: #f7f8f8;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea { font: inherit; }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  transform: translateY(-200%);
  padding: .75rem 1rem;
  background: var(--ink);
  color: white;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: relative;
  z-index: 10;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 88px;
  padding: 0 clamp(1.25rem, 5vw, 5rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.wordmark { font-weight: 800; text-decoration: none; font-size: 1.15rem; letter-spacing: -.04em; }
.wordmark span { color: var(--rust); }
nav { display: flex; gap: 2rem; }
nav a, .header-github { font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }
nav a:hover, .header-github:hover, .text-link:hover, .project-link:hover { color: var(--rust); }
.header-github { justify-self: end; }

.hero {
  max-width: 1440px;
  min-height: 690px;
  margin: 0 auto;
  padding: clamp(5rem, 10vw, 9rem) clamp(1.25rem, 5vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
}
.eyebrow, .section-index {
  margin: 0 0 2rem;
  color: var(--blue);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: .75rem; }
.eyebrow span { width: 28px; height: 1px; background: var(--rust); }
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 820px;
  margin-bottom: 2rem;
  font-family: var(--serif);
  font-size: clamp(3.5rem, 7vw, 7rem);
  line-height: .94;
  font-weight: 400;
  letter-spacing: -.06em;
}
h1 em { color: var(--blue); font-weight: 400; }
.hero-intro { max-width: 650px; color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.7; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.5rem; margin-top: 2.5rem; }
.button {
  border: 0;
  border-radius: 0;
  padding: 1rem 1.35rem;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-decoration: none;
  text-transform: uppercase;
}
.button-primary { background: var(--blue); color: white; box-shadow: inset 0 0 0 1px var(--blue); transition: background .2s ease, transform .2s ease; }
.button-primary:hover { background: var(--blue-dark); transform: translateY(-2px); }
.button-primary:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(166, 94, 66, .35); outline-offset: 3px; }
.text-link, .project-link { font-size: .78rem; font-weight: 750; letter-spacing: .04em; text-underline-offset: 5px; }

.system-card { padding: 1.5rem; border: 1px solid var(--line); background: rgba(250, 249, 245, .62); box-shadow: 18px 18px 0 var(--paper-deep); }
.system-card-header { display: flex; justify-content: space-between; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .68rem; text-transform: uppercase; }
.status { display: flex; align-items: center; gap: .4rem; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(47, 82, 116, .12); }
.system-diagram { position: relative; min-height: 290px; }
.diagram-node { position: absolute; z-index: 2; padding: .65rem .8rem; border: 1px solid var(--blue); background: var(--paper); color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .68rem; }
.node-client { top: 42%; left: 0; }
.node-gateway { top: 16%; left: 37%; background: var(--blue); color: white; }
.node-worker { right: 3%; bottom: 18%; }
.node-store { left: 33%; bottom: 6%; border-color: var(--rust); color: var(--rust); }
.connector { position: absolute; display: block; border-color: var(--line); border-style: solid; }
.c-one { top: 30%; left: 15%; width: 26%; height: 23%; border-width: 1px 1px 0 0; }
.c-two { top: 25%; left: 55%; width: 32%; height: 49%; border-width: 0 1px 1px 0; }
.c-three { bottom: 19%; left: 45%; width: 43%; border-width: 1px 0 0; }
.system-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.system-metrics div { padding: 1rem .4rem .2rem; }
.system-metrics div + div { border-left: 1px solid var(--line); padding-left: 1rem; }
.system-metrics span, .system-metrics small { display: block; color: var(--muted); font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; }
.system-metrics strong { display: block; margin: .35rem 0; font-family: var(--serif); font-size: 1.2rem; font-weight: 400; }

.signal-strip { min-height: 72px; padding: 1rem clamp(1.25rem, 5vw, 5rem); display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: clamp(1rem, 3vw, 3rem); background: var(--ink); color: #dfe5df; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.signal-strip i { width: 4px; height: 4px; border-radius: 50%; background: var(--rust); }

.work-section, .principles, .contact-section { padding: clamp(5rem, 10vw, 9rem) clamp(1.25rem, 5vw, 5rem); }
.work-section { max-width: 1440px; margin: 0 auto; }
.section-heading { display: grid; grid-template-columns: minmax(170px, .55fr) 1.45fr; gap: 2rem; margin-bottom: 5rem; }
.section-heading h2, .contact-intro h2 { max-width: 760px; margin-bottom: 1rem; font-family: var(--serif); font-size: clamp(2.7rem, 5vw, 5rem); font-weight: 400; line-height: 1; letter-spacing: -.05em; }
.section-heading > div > p, .contact-intro > p { max-width: 620px; color: var(--muted); line-height: 1.7; }

.projects { border-top: 1px solid var(--ink); }
.project { border-bottom: 1px solid var(--line); }
.project-meta { min-height: 58px; padding: .75rem 0; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; color: var(--muted); font-size: .67rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.project-meta span:nth-child(2) { text-align: center; }
.project-meta span:last-child { text-align: right; }
.project-body { display: grid; grid-template-columns: minmax(280px, .75fr) 1.25fr; gap: clamp(3rem, 8vw, 8rem); padding: 2.5rem 0 5rem; }
.project-title-block > p:first-child { color: var(--rust); font-size: .7rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.project-title-block h3 { margin-bottom: 1.25rem; font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1; font-weight: 400; letter-spacing: -.04em; }
.project-summary { color: var(--muted); line-height: 1.65; }
.project-link { display: inline-block; margin-top: 1rem; }
.project-details dl { margin: 0; }
.project-details dl > div { display: grid; grid-template-columns: 125px 1fr; gap: 1.25rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.project-details dt { color: var(--blue); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.project-details dd { margin: 0; color: #435052; font-size: .9rem; line-height: 1.55; }

.principles { background: var(--paper-deep); }
.principles > * { max-width: 1280px; margin-left: auto; margin-right: auto; }
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.principle-grid article { min-height: 310px; padding: 2rem; }
.principle-grid article + article { border-left: 1px solid var(--line); }
.principle-grid span { color: var(--rust); font-family: var(--serif); }
.principle-grid h3 { max-width: 230px; margin: 5rem 0 1rem; font-family: var(--serif); font-size: 1.8rem; font-weight: 400; }
.principle-grid p { color: var(--muted); line-height: 1.6; font-size: .92rem; }

.contact-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(3rem, 10vw, 10rem); background: var(--ink); color: var(--white); }
.contact-intro { max-width: 510px; justify-self: end; }
.contact-intro .section-index { color: #a5b8cc; }
.contact-intro > p { color: #aeb9b7; }
.contact-form { max-width: 760px; width: 100%; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.contact-form label { display: block; margin-bottom: 1.75rem; color: #c9d1cf; font-size: .68rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.contact-form input, .contact-form textarea { width: 100%; margin-top: .65rem; padding: 1rem 0; border: 0; border-bottom: 1px solid #576160; border-radius: 0; background: transparent; color: white; outline: 0; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { border-bottom-color: #b8cbe0; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: #6f7a79; }
.honeypot { position: absolute !important; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.form-footer { display: flex; align-items: center; gap: 1.5rem; }
.form-status { margin: 0; color: #aeb9b7; font-size: .82rem; line-height: 1.5; }
.form-status.error { color: #e7a78e; }

footer { min-height: 100px; padding: 2rem clamp(1.25rem, 5vw, 5rem); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-top: 1px solid #3d4747; background: var(--ink); color: #97a3a1; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
footer .wordmark { color: white; }
footer p { margin: 0; }
footer p:last-child { text-align: right; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 6rem; }
  .system-card { max-width: 620px; }
  .section-heading, .project-body, .contact-section { grid-template-columns: 1fr; }
  .section-heading { margin-bottom: 3rem; }
  .contact-intro { justify-self: start; }
  .principle-grid { grid-template-columns: 1fr; }
  .principle-grid article { min-height: 230px; }
  .principle-grid article + article { border-left: 0; border-top: 1px solid var(--line); }
  .principle-grid h3 { margin-top: 3rem; }
}

@media (max-width: 560px) {
  .hero { min-height: auto; }
  h1 { font-size: clamp(3.2rem, 16vw, 5rem); }
  .system-card { padding: 1rem; box-shadow: 9px 9px 0 var(--paper-deep); }
  .system-metrics { grid-template-columns: 1fr; }
  .system-metrics div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: .4rem; }
  .signal-strip i { display: none; }
  .project-meta { grid-template-columns: auto 1fr; gap: 1rem; }
  .project-meta span:nth-child(2) { text-align: right; }
  .project-meta span:last-child { display: none; }
  .project-body { padding-bottom: 4rem; }
  .project-details dl > div { grid-template-columns: 1fr; gap: .5rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  footer { grid-template-columns: 1fr; gap: 1rem; }
  footer p:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

