/* jonathandav.is
   Dark, one green accent, monospace for metadata, large type for the name.
   Closer to Crossmint's restraint than anything theatrical.

   Accent is #20c28c, his existing brand colour, taken from the logo and
   business card rather than inferred. It is a teal green, cooler and more
   muted than the #0f0 this domain served from 2019 and considerably calmer
   than the colour I had guessed at. The neutrals below are warmed very
   slightly toward it so the palette reads as one decision. */

:root {
  --bg:        #111313;
  --surface:   #171a19;
  --border:    #414844;
  --text:      #b3b8b5;
  --heading:   #f0f1e8;
  --muted:     #969e99;
  --rail:      #4b5550;
  --dot:       #222725;
  --accent:    #20c28c;
  --accent-ink:#091e16;
  --accent-dim:#147051;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 34rem;
  --gutter: clamp(22px, 3.55vw, 72px);
  --max-width: 1440px;
}

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

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

/* A dot grid, fixed so it reads as the surface the page sits on rather than
   something scrolling with it. Low enough contrast to be felt rather than
   seen, which is the only way texture survives on a page this spare. */

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 30px 30px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.4em;
}

strong { color: var(--heading); font-weight: 600; }

/* HUD framing, borrowed from the Curtis Nguyen reference. Quiet, not loud. */

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  padding: 1.25rem var(--gutter);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  align-items: baseline;
}

.hud nav { display: flex; gap: 1.75rem; }
.hud nav a { color: var(--muted); }
.hud nav a:hover { color: var(--accent); text-decoration: none; }
.hud nav a[aria-current="page"] { color: var(--heading); }

/* Nav toggle. Hidden entirely above the breakpoint, where there is room for
   four links. The button is revealed by script, so the nav stays a plain
   visible list if the script never runs. */

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] { color: var(--accent); }

/* The JD monogram rather than the full wordmark. It is near square, so it holds
   up at header size where the wordmark was illegible, and the name is already
   set in display type a few hundred pixels below. img/logo.svg keeps the full
   lockup for anywhere it is wanted at size. */

.brand { display: block; line-height: 0; }

.brand img {
  width: auto;
  height: 1.9rem;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.brand:hover img { opacity: 1; }

/* Interior pages open straight into content, so they need air under the header
   where the home page has a hero above it. */
.about, .capabilities, .contact { padding-top: 3.5rem; }

/* Prose does not want the full 1440. Holding the reading sections narrower
   keeps the section rule close to where the text actually stops, rather than
   running most of the way across an empty screen. */
.about, .contact { max-width: 880px; }

.skip {
  position: absolute;
  left: -9999px;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.skip:focus {
  left: var(--gutter);
  top: 0.5rem;
  z-index: 20;
  background: var(--accent);
  color: #06160c;
  padding: 0.5rem 1rem;
  border-radius: 2px;
}

main { padding: 0 var(--gutter); }

section, .name, .onward { max-width: var(--max-width); margin-inline: auto; }

.label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.label::before { content: "// "; color: var(--accent-dim); }

/* Hero
   Geometry taken from the comp. The name runs edge to edge on one line above a
   rule, with the portrait and the statement beneath it. */

.name {
  margin: 0 auto;
  padding-block: 39px 12px;
  border-bottom: 1px solid var(--border);
  font-size: clamp(76px, 14.35vw, 224px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.075em;
  color: var(--heading);
  white-space: nowrap;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.85fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: stretch;
  margin-top: 41px;
}

/* Registration marks drawn as eight background gradients rather than borders,
   so all four corners come from one element and every one of them tracks the
   accent variable. */

.portrait {
  position: relative;
  margin: 0;
  padding: 6px;
  align-self: start;
  background:
    linear-gradient(var(--accent), var(--accent)) left top / 21px 2px,
    linear-gradient(var(--accent), var(--accent)) left top / 2px 21px,
    linear-gradient(var(--accent), var(--accent)) right top / 21px 2px,
    linear-gradient(var(--accent), var(--accent)) right top / 2px 21px,
    linear-gradient(var(--accent), var(--accent)) left bottom / 21px 2px,
    linear-gradient(var(--accent), var(--accent)) left bottom / 2px 21px,
    linear-gradient(var(--accent), var(--accent)) right bottom / 21px 2px,
    linear-gradient(var(--accent), var(--accent)) right bottom / 2px 21px;
  background-repeat: no-repeat;
}

/* The photograph is a candid rather than a studio shot, which suits the
   register. Left untreated it fights the page, since warm restaurant light and
   a busy background sit badly against this palette. Desaturating most of the
   way keeps the expression, which is the part doing the work. */

.portrait-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 398 / 465;
  object-fit: cover;
  object-position: 50% 32%;
  filter: saturate(0.18) contrast(0.96) brightness(0.94);
}

.hero-copy {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-block: 72px;
}

.statement {
  position: relative;
  z-index: 1;
  margin: 0 0 30px;
  font-size: clamp(30px, 4.12vw, 65px);
  font-weight: 750;
  letter-spacing: -0.052em;
  line-height: 1.13;
  color: var(--heading);
}

.statement span { display: block; }

/* The title answers "what is he" for a scanning reader without competing with
   the line that says what he does. */

.role {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin: 0;
  padding: 6px 13px 5px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: clamp(10px, 1.07vw, 16px);
  line-height: 1.3;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

/* Rails with accent junctions. A bridge between things drawn as a diagram,
   which is what the statement beside it actually claims. A photograph of a
   literal bridge would collapse that sentence into civil engineering. */

.hero-lines {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.hero-lines .rail {
  fill: none;
  stroke: var(--rail);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.hero-lines .node { fill: var(--accent); }

/* Landing cards. Dividers rather than filled boxes, which keeps the page on a
   single surface and lets the rules do the separating. */

.onward {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 43px;
  border-top: 1px solid var(--border);
}

.onward a {
  display: block;
  padding: 44px 28px 40px;
  min-height: 205px;
  color: var(--text);
}

.onward a + a { border-left: 1px solid var(--border); }
.onward a:first-child { padding-left: 28px; }
.onward a:last-child { padding-right: 0; }
.onward a:hover { text-decoration: none; }

.onward-label {
  display: block;
  margin-bottom: 21px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--accent);
}

.onward a:hover .onward-label { color: var(--heading); }
.onward-label::after { content: " \2192"; }

.onward-text {
  display: block;
  max-width: 37ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

/* About */

/* Chapters are laid out with the marker in the left margin on wide screens, so
   the eye can run down the dates without reading the prose. That is the only
   scannable affordance the narrative needs, and it costs no extra words. */

.about { padding-bottom: 5rem; }

.movement {
  display: grid;
  grid-template-columns: 7rem minmax(0, var(--measure));
  gap: 0 3rem;
  padding: 2.75rem 0;
  /* Stop at the content rather than the section, so the rules between
     chapters end where the prose ends instead of running out into empty
     space. The section itself stays 68rem so the labels still align with
     the sections above and below. */
  max-width: calc(7rem + 3rem + var(--measure));
}

.movement + .movement { border-top: 1px solid var(--border); }

.movement > * { grid-column: 2; }

.movement p { margin: 0 0 1.5rem; }
.movement p:last-child { margin-bottom: 0; }

.year {
  grid-column: 1;
  grid-row: 1 / span 99;
  margin: 0.4rem 0 0 !important;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 60rem) {
  .movement { display: block; max-width: var(--measure); }
  .year {
    margin: 0 0 1.25rem !important;
    text-align: left;
    color: var(--accent);
  }
}

blockquote {
  margin: 2rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--accent-dim);
  color: var(--heading);
}

blockquote p { margin: 0 0 1rem; }
blockquote p:last-child { margin-bottom: 0; }

blockquote.pull {
  border-left: none;
  padding-left: 0;
  margin: 2.5rem 0;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.45;
  letter-spacing: -0.015em;
}

/* Capabilities */

.capabilities { padding-bottom: 5rem; }

.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.cap {
  background: var(--surface);
  padding: 2rem 1.75rem;
}

.cap h2 {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--accent);
}

.cap p { margin: 0 0 1rem; font-size: 0.95rem; }
.cap p:last-child { margin-bottom: 0; }

/* Contact */

.contact { padding-bottom: 2rem; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-direct h2,
.contact-form button {
  font-family: var(--sans);
}

.contact-direct h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  color: var(--heading);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.contact-direct p { margin: 0 0 1rem; }

.email a {
  font-family: var(--mono);
  font-size: 1.05rem;
  word-break: break-all;
}

.contact-form { display: flex; flex-direction: column; }

/* Web3Forms honeypot. Carried a style attribute originally, which the CSP
   blocked, making the trap visible and useless. Here it survives the policy. */
.botcheck { display: none !important; }

.contact-form label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-dim);
}

.contact-form textarea { resize: vertical; min-height: 9rem; }

.contact-form .h-captcha { margin-bottom: 1.5rem; }

.contact-form button {
  align-self: flex-start;
  background: var(--accent);
  color: #06160c;
  border: none;
  border-radius: 2px;
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.contact-form button:hover { background: #4aeb81; }

/* Narrow screens */

@media (max-width: 48rem) {

  .name {
    white-space: normal;
    font-size: clamp(58px, 16vw, 110px);
    line-height: 0.96;
    letter-spacing: -0.07em;
    padding-block: 30px 24px;
  }
  .name span { display: block; }

  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 28px; }
  .portrait { width: 100%; max-width: 390px; }
  .hero-copy { padding-block: 22px 52px; min-height: 290px; }
  .statement {
    max-width: 100%;
    font-size: clamp(30px, 7.6vw, 44px);
    letter-spacing: -0.045em;
  }
  .statement span { display: inline; }
  .hero-lines { opacity: 0.7; }

  .onward { grid-template-columns: 1fr; margin-top: 7px; }
  .onward a, .onward a:first-child, .onward a:last-child { min-height: 0; padding: 28px 0; }
  .onward a + a { border-left: 0; border-top: 1px solid var(--border); }

  /* Below this the header holds the mark and the toggle, and the nav drops
     into a panel beneath. The address goes, since it is on the contact page. */
  .hud .email-link { display: none; }
  .hud { gap: 0; padding-top: 1rem; padding-bottom: 0.85rem; align-items: center; }

  .has-nav-toggle .nav-toggle { display: inline-flex; }

  .has-nav-toggle #site-nav {
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    max-height: 0;
    visibility: hidden;
    transition: max-height 0.22s ease, visibility 0s linear 0.22s;
  }

  .has-nav-toggle .nav-toggle[aria-expanded="true"] ~ #site-nav {
    max-height: 16rem;
    visibility: visible;
    transition: max-height 0.22s ease;
  }

  .has-nav-toggle #site-nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
  }

  .has-nav-toggle #site-nav a:first-child { border-top: 1px solid var(--border); margin-top: 0.85rem; }

  /* The header draws its own rule beneath itself, so a border on the last item
     puts a second line a few pixels above it. */
  .has-nav-toggle #site-nav a:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
