/* =========================================================================
   alexcboyd.com — "Field line"
   Calm dark charcoal, olive-drab accent. One olive hairline runs the length
   of the page: a horizon behind the portrait, then a spine down the left.
   ========================================================================= */

:root {
  /* Colour */
  --ink:       #101210;  /* deepest — hero vignette, footer */
  --bg:        #151815;  /* page charcoal */
  --surface:   #1D211D;  /* raised cards */
  --line:      #2E332C;  /* hairlines */
  --olive:     #7E9153;  /* military green — rules, fills */
  --olive-lt:  #A7BC7C;  /* accent text, hover, focus */
  --bone:      #EAE7DD;  /* headings */
  --sand:      #A7A79B;  /* body */
  --sand-dim:  #8B8E84;  /* captions */

  /* Type */
  --display: "Fraunces", Georgia, serif;
  --sans:    "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  /* Layout */
  --gutter:  clamp(24px, 5vw, 72px);
  --measure: 1100px;
  --rail-x:  30px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  position: relative;
  background: var(--bg);
  color: var(--sand);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--bone);
  margin: 0;
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 30, "WONK" 1;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; height: auto; }

:focus-visible {
  outline: 2px solid var(--olive-lt);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--olive);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}
.skip:focus { left: 12px; }

/* Film grain — keeps the flat charcoal from feeling like dead pixels. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Shared -------------------------------------------------------------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--olive-lt);
  margin: 0 0 18px;
}

.section-lede {
  max-width: 46ch;
  color: var(--sand);
  margin: 18px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  padding: 13px 24px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-primary { background: var(--olive); color: #101210; }
.btn-primary:hover { background: var(--olive-lt); }
.btn-ghost { border-color: var(--line); color: var(--bone); }
.btn-ghost:hover { border-color: var(--olive); color: var(--olive-lt); }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Topbar -------------------------------------------------------------- */

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px var(--gutter);
}

.wordmark {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: var(--bone);
  letter-spacing: -0.01em;
}

.topnav { display: flex; gap: 28px; }
.topnav a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--sand-dim);
  transition: color 0.2s var(--ease);
}
.topnav a:hover { color: var(--olive-lt); }

@media (max-width: 640px) {
  .topnav a:not(:last-child) { display: none; }
}

/* The rail — the spine, and the jump nav ------------------------------ */

.rail {
  position: fixed;
  left: var(--rail-x);
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: none;
}

/* The rail lives in the left margin. Below this width that margin is too narrow
   to hold it without running into the section content, so it goes away. */
@media (min-width: 1280px) { .rail { display: block; } }

.rail-track {
  position: absolute;
  left: 0;
  top: -50vh;
  bottom: -50vh;
  width: 1px;
  background: var(--line);
}
.rail-fill {
  position: absolute;
  inset: 0 0 auto 0;
  width: 1px;
  height: 0;
  background: var(--olive);
  transition: height 0.15s linear;
}

.rail ul { list-style: none; margin: 0; padding: 0; }
.rail li + li { margin-top: 22px; }

.rail a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand-dim);
  opacity: 0.55;
  transition: opacity 0.25s var(--ease), color 0.25s var(--ease);
}
.rail a:hover,
.rail a.is-active { opacity: 1; color: var(--olive-lt); }

.rail .tick {
  width: 9px;
  height: 9px;
  margin-left: -4px;
  background: var(--bg);
  border: 1px solid var(--line);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.rail a:hover .tick,
.rail a.is-active .tick { background: var(--olive); border-color: var(--olive); }

/* Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(20px, 3vw, 40px) var(--gutter) clamp(72px, 8vw, 104px);
}

/* The horizon: one olive hairline, drawn on load. It passes behind him and
   emerges on the right as the rule above his numbers — the line underwrites
   the claims. main.js pins `top` to the stats rule; 56% is the no-JS fallback. */
.horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--olive) 8%, var(--olive) 100%);
  opacity: 0.55;
  transform: scaleX(0);
  transform-origin: 0 50%;
  animation: draw 1.5s var(--ease) 0.15s forwards;
}
@keyframes draw { to { transform: scaleX(1); } }

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--measure);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.95fr 1fr;
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
}

/* Both portraits are shown exactly as shot — no filter, no mask, no vignette.
   They sit in a mat instead: the same surface + hairline the offer cards use,
   so the frame reads as part of the system rather than an effect on the photo. */
.portrait,
.portrait-aside {
  margin: 0;
  position: relative;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.portrait img,
.portrait-aside img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.portrait {
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1.4s var(--ease) 0.5s forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

.hero-copy {
  position: relative;
  z-index: 3;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 1s var(--ease) 0.75s forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }

.hero-copy h1 {
  font-size: clamp(58px, 8.5vw, 108px);
  line-height: 0.92;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 0 0 22px;
}

.lede {
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.55;
  color: var(--sand);
  max-width: 34ch;
  margin: 0 0 32px;
}

/* No border here on purpose — the hero's horizon line is this row's rule. */
.stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  margin: 0 0 32px;
  padding: 20px 0 0;
}
.stats b {
  display: block;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 500;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
}
.stats span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--sand-dim);
}

/* Sections ------------------------------------------------------------ */

.section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(72px, 10vw, 120px) var(--gutter);
}

.section-head { margin-bottom: clamp(40px, 5vw, 64px); }
.section-head h2 {
  font-size: clamp(32px, 4.2vw, 46px);
  line-height: 1.1;
}

/* Ventures: a register, not cards. Role labels are the taxonomy. -------- */

.register { list-style: none; margin: 0; padding: 0; }
.register li { border-top: 1px solid var(--line); }
.register li:last-child { border-bottom: 1px solid var(--line); }

.venture {
  display: grid;
  grid-template-columns: 210px 1fr 190px;
  align-items: start;
  gap: 32px;
  padding: 32px 20px 32px 0;
  position: relative;
  transition: background 0.3s var(--ease), padding-left 0.3s var(--ease);
}
.venture::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--olive);
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform 0.3s var(--ease);
}
.venture:hover {
  background: linear-gradient(90deg, rgba(126, 145, 83, 0.07), transparent 70%);
  padding-left: 20px;
}
.venture:hover::before { transform: scaleY(1); }

.role {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand-dim);
  padding-top: 8px;
  transition: color 0.3s var(--ease);
}
.venture:hover .role { color: var(--olive-lt); }

.venture-name {
  display: block;
  font-family: var(--display);
  font-size: clamp(25px, 2.6vw, 31px);
  font-weight: 500;
  color: var(--bone);
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.venture-line {
  display: block;
  color: var(--sand);
  font-size: 16px;
  max-width: 52ch;
}

.domain {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--sand-dim);
  padding-top: 8px;
  transition: color 0.3s var(--ease);
}
.domain i {
  font-style: normal;
  transition: transform 0.3s var(--ease);
}
.venture:hover .domain { color: var(--olive-lt); }
.venture:hover .domain i { transform: translateX(5px); }

/* Work with me -------------------------------------------------------- */

.work-grid {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

/* Framed by the shared .portrait / .portrait-aside rule up in the hero block.
   Shown in full colour, as shot. */

.offers { display: grid; gap: 20px; }

.offer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(26px, 3vw, 36px);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.offer:hover { border-color: var(--olive); transform: translateY(-2px); }

.offer .eyebrow { margin-bottom: 14px; }
.offer h3 {
  font-size: 26px;
  margin: 0 0 12px;
}
.offer p {
  margin: 0 0 22px;
  font-size: 16px;
  color: var(--sand);
}

.offer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--olive-lt);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.25s var(--ease);
}
.offer-link i { font-style: normal; transition: transform 0.25s var(--ease); }
.offer-link:hover { border-color: var(--olive); }
.offer-link:hover i { transform: translateX(5px); }

/* Previously ---------------------------------------------------------- */

.prior { list-style: none; margin: 0; padding: 0; }
.prior li {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 32px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.prior li:last-child { border-bottom: 1px solid var(--line); }

.prior-name {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--bone);
}
.prior-line { color: var(--sand); font-size: 16px; }

/* Footer -------------------------------------------------------------- */

footer {
  background: var(--ink);
  border-top: 1px solid var(--line);
  padding: clamp(72px, 9vw, 110px) 0 32px;
}

/* Resolves to the exact content box of .section at every width, so the footer's
   left edge and its rules line up with the sections above. */
.footer-inner,
.colophon {
  width: min(100% - var(--gutter) * 2, calc(var(--measure) - var(--gutter) * 2));
  margin-inline: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 48px;
  align-items: start;
}

.footer-lead h2 {
  font-size: clamp(32px, 4.2vw, 46px);
  line-height: 1.1;
  margin-bottom: 0;
}
.footer-lead .section-lede { margin-bottom: 32px; }

.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li + li { margin-top: 10px; }
.footer-nav a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--sand-dim);
  transition: color 0.2s var(--ease);
}
.footer-nav a:hover { color: var(--olive-lt); }

.colophon {
  margin-top: clamp(56px, 7vw, 88px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--sand-dim);
}

/* 404 ----------------------------------------------------------------- */

/* The page's one motif is a line that runs the whole way. Here it stops —
   that's the entire idea, so nothing else on the page needs to work hard. */
.nf {
  position: relative;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(80px, 18vh, 180px) var(--gutter) clamp(80px, 12vh, 140px);
}

.nf-line {
  width: min(100%, 460px);
  height: 1px;
  margin-bottom: clamp(40px, 6vw, 64px);
  background: linear-gradient(90deg, var(--olive) 0%, var(--olive) 72%, transparent 100%);
  opacity: 0.55;
  transform-origin: 0 50%;
  animation: draw 1.1s var(--ease) 0.1s both;
}

.nf h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 22px;
}

.nf-lede {
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.6;
  color: var(--sand);
  max-width: 42ch;
  margin: 0 0 36px;
}

/* Scroll reveal ------------------------------------------------------- */

/* Gated on .js: without scripting the page must still be fully readable, so the
   hidden start state only exists once we know something can un-hide it. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }

/* Responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .horizon { top: 32%; }

  .portrait { max-width: 340px; }
  .hero-copy h1 { font-size: clamp(52px, 15vw, 76px); }
  .lede { max-width: 40ch; }

  .venture { grid-template-columns: 1fr; gap: 14px; padding: 28px 0; }
  .venture:hover { padding-left: 14px; }
  .role { padding-top: 0; }
  .domain { justify-content: flex-start; padding-top: 0; }

  .work-grid { grid-template-columns: 1fr; }
  .portrait-aside { max-width: 320px; }

  .prior li { grid-template-columns: 1fr; gap: 8px; }

  .footer-inner { grid-template-columns: 1fr; }
}

/* Quality floor ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .horizon { transform: scaleX(1); }
  .portrait, .hero-copy { opacity: 1; transform: none; }
  .js .reveal { opacity: 1; transform: none; }
}
