:root {
  --rail-closed: 64px;
  --rail-open: 226px;
  --paper: #ffffff;
  --ink: #0a0a0a;
  --silver: #8a8f95;
  --green: #168b5c;
  --red: #b84242;
  --rail: #090909;
  --rail-ink: #f8f8f6;
  --rail-muted: #989da3;
  --font-code: ui-monospace, "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", Menlo, Monaco, monospace;
  --section-width: 1180px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-code);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

h1,
h2,
h3,
p,
dl,
dt,
dd {
  margin: 0;
  font-family: var(--font-code);
}

a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: #0a0a0a; color: #fff; }

.skip-link {
  position: fixed;
  z-index: 500;
  top: 12px;
  left: calc(var(--rail-closed) + 14px);
  transform: translateY(-160%);
  padding: 8px 12px;
  background: #fff;
  color: #000;
  border: 1px solid #000;
  text-decoration: none;
  font-size: 14px;
}

.skip-link:focus { transform: none; }

/* left navigation */
.side-rail {
  position: fixed;
  z-index: 300;
  inset: 0 auto 0 0;
  width: var(--rail-closed);
  display: flex;
  flex-direction: column;
  padding: 14px 10px 16px;
  background: var(--rail);
  color: var(--rail-ink);
  border-right: 1px solid #1e1e1e;
  overflow: hidden;
  transition: width .24s cubic-bezier(.22, 1, .36, 1);
}

.nav-expanded .side-rail {
  width: var(--rail-open);
}

.side-rail__top {
  display: grid;
  gap: 10px;
}

.rail-brand {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.rail-brand__icon {
  width: 30px;
  height: 30px;
  margin-left: 7px;
  flex: 0 0 30px;
  object-fit: contain;
}

.rail-brand__name,
.rail-nav,
.side-rail__foot {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
  transition: opacity .16s ease, transform .2s ease;
}

.nav-expanded .rail-brand__name,
.nav-expanded .rail-nav,
.nav-expanded .side-rail__foot {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.rail-brand__name {
  font-size: 14px;
  font-weight: 700;
}

.rail-toggle {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: 7px;
  width: 24px;
  height: 48px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #d7d7d4;
  cursor: pointer;
}

.rail-toggle:hover,
.rail-toggle:focus-visible {
  color: #fff;
  background: transparent;
  outline: none;
}

.rail-toggle__glyph {
  display: block;
  font-size: 11px;
  line-height: 1;
}

.rail-nav {
  display: grid;
  gap: 6px;
  margin-top: auto;
  margin-bottom: auto;
}

.rail-nav__link {
  position: relative;
  display: block;
  padding: 10px 10px 10px 16px;
  color: var(--rail-muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.3;
}

.rail-nav__link:hover,
.rail-nav__link:focus-visible,
.rail-nav__link.is-active {
  color: #fff;
  outline: none;
}

.rail-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 10px;
  bottom: 5px;
  height: 1px;
  background: #fff;
}

.side-rail__foot {
  margin-top: auto;
  padding: 10px 8px 0 8px;
  color: #8e9399;
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
}

.rail-scrim {
  display: none;
}

/* blank white site canvas */
.site-canvas {
  margin-left: var(--rail-closed);
  min-height: 100vh;
  background: #fff;
  transition: margin-left .24s cubic-bezier(.22, 1, .36, 1);
}

.nav-expanded .site-canvas {
  margin-left: var(--rail-open);
}

.page-section {
  min-height: 100svh;
  display: flex;
  align-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: clamp(78px, 10vh, 110px) clamp(28px, 6vw, 88px);
}

.section-shell {
  width: min(100%, var(--section-width));
  margin: 0 auto;
}

/* shared typography and alignment */
h1 {
  font-size: clamp(34px, 4.5vw, 48px);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 700;
}

h2 {
  font-size: clamp(26px, 3vw, 32px);
  line-height: 1.28;
  letter-spacing: -.032em;
  font-weight: 700;
}

p,
dd {
  font-size: 16px;
}

.two-column-layout {
  display: grid;
  grid-template-columns: minmax(280px, .86fr) minmax(360px, 1.14fr);
  gap: clamp(54px, 8vw, 110px);
  align-items: start;
}

/* home */
.hero-shell {
  padding-left: clamp(0px, 6vw, 74px);
}

.hero-subtitle {
  margin-top: 18px;
  color: #555a60;
  font-size: 16px;
}

/* about */
.about-shell {
  display: grid;
  gap: clamp(44px, 7vh, 72px);
}

.about-copy {
  max-width: 660px;
  color: #24272a;
  line-height: 1.85;
}

.about-copy p + p {
  margin-top: 22px;
}

.about-facts {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr .8fr;
  gap: clamp(24px, 4vw, 54px);
  align-items: start;
}

.fact {
  min-width: 0;
}

.fact dt {
  margin-bottom: 8px;
  color: var(--silver);
  font-size: 14px;
}

.fact dd {
  color: #111;
  line-height: 1.55;
}

.fact--education dd {
  display: grid;
  gap: 2px;
}

/* work */
.work-shell {
  display: grid;
  gap: clamp(38px, 6vh, 58px);
}

.project-list {
  width: 100%;
  display: grid;
}

.project-line {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  color: #111;
  text-decoration: none;
}

a.project-line {
  cursor: pointer;
}

a.project-line:hover .project-line__main,
a.project-line:focus-visible .project-line__main {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

a.project-line:focus-visible {
  outline: 1px solid #111;
  outline-offset: 6px;
}

.project-line__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #d5d5d2;
  color: #111;
  font-size: 14px;
  overflow: hidden;
}

.project-line__icon--image {
  border: 0;
}

.project-line__icon--image img {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

.project-line__main {
  min-width: 0;
  font-size: clamp(16px, 1.4vw, 18px);
  font-weight: 700;
  line-height: 1.55;
}

.project-line__meta {
  color: #5c6167;
  font-size: 16px;
  font-weight: 400;
}

.project-line__action {
  color: var(--green);
  font-size: 18px;
}

.project-line__action--muted {
  color: var(--silver);
}

.tone-green { color: var(--green); }
.tone-silver { color: var(--silver); }
.tone-red { color: var(--red); }

/* contact */
.contact-copy {
  color: #41464b;
}

.contact-email {
  display: inline-block;
  margin-top: 24px;
  color: var(--green);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.contact-email:hover,
.contact-email:focus-visible {
  color: #0e6744;
  outline: none;
}

/* reveal */
.reveal-item {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(4px);
  transition:
    opacity .56s cubic-bezier(.22, 1, .36, 1),
    transform .56s cubic-bezier(.22, 1, .36, 1),
    filter .56s cubic-bezier(.22, 1, .36, 1);
}

.reveal-group.is-visible .reveal-item {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.reveal-group.is-visible .reveal-item:nth-child(1) { transition-delay: .03s; }
.reveal-group.is-visible .reveal-item:nth-child(2) { transition-delay: .11s; }
.reveal-group.is-visible .reveal-item:nth-child(3) { transition-delay: .19s; }

/* subpages */
.subpage {
  min-height: 100vh;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-code);
  font-size: 16px;
}

.subpage-main {
  min-height: 100vh;
  margin-left: var(--rail-closed);
  padding: clamp(78px, 10vw, 128px) clamp(28px, 8vw, 118px);
  background: #fff;
  transition: margin-left .24s cubic-bezier(.22, 1, .36, 1);
}

.nav-expanded .subpage-main {
  margin-left: var(--rail-open);
}

.subpage-shell {
  width: min(100%, 900px);
  margin: 0 auto;
}

.subpage-brand {
  display: inline-block;
  margin-bottom: 44px;
  color: var(--silver);
  font-size: 14px;
  text-decoration: none;
}

.puttbound-page {
  min-height: calc(100vh - clamp(156px, 20vw, 256px));
  display: grid;
  align-content: center;
}

.puttbound-page__icon {
  width: 88px;
  height: 88px;
  margin-bottom: 26px;
}

.puttbound-page h1,
.legal-page h1,
.error-page h1 {
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.12;
  letter-spacing: -.045em;
}

.puttbound-page__subtitle {
  margin-top: 18px;
  font-size: 18px;
  font-weight: 700;
}

.puttbound-page__soon {
  margin-top: 10px;
  color: #5c6167;
}

.button-row {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.code-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
}

.code-button--silver {
  border-color: #bfc2c5;
  background: linear-gradient(180deg, #f5f5f3, #cfd2d4);
  color: #000;
}

.code-button--ghost {
  background: #fff;
  color: #111;
}

.legal-page h1 {
  margin-bottom: 18px;
}

.legal-meta {
  margin-bottom: 40px;
  color: var(--silver);
  font-size: 14px;
}

.legal-page h2 {
  margin-top: 38px;
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.4;
}

.legal-page p,
.legal-page li {
  color: #292c2f;
  font-size: 16px;
  line-height: 1.82;
}

.legal-page p + p {
  margin-top: 14px;
}

.legal-page ul {
  padding-left: 24px;
}

.legal-page a:not(.code-button) {
  color: var(--green);
}

.legal-contact {
  margin-top: 14px;
}

.error-page p {
  margin-top: 18px;
  color: #5a5f64;
}

/* responsive */
@media (max-width: 980px) {
  html { scroll-snap-type: y proximity; }

  .two-column-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .about-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 34px;
  }
}

@media (max-width: 820px) {
  :root {
    --rail-closed: 56px;
    --rail-open: 220px;
  }

  .side-rail {
    width: var(--rail-closed);
    padding-left: 6px;
    padding-right: 6px;
  }

  .nav-expanded .side-rail {
    width: var(--rail-open);
  }

  .rail-brand__icon {
    width: 28px;
    height: 28px;
    margin-left: 8px;
    flex-basis: 28px;
  }

  .site-canvas,
  .nav-expanded .site-canvas,
  .subpage-main,
  .nav-expanded .subpage-main {
    margin-left: var(--rail-closed);
  }

  .nav-expanded .rail-scrim {
    display: block;
    position: fixed;
    z-index: 250;
    inset: 0 0 0 var(--rail-closed);
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }

  .page-section {
    padding: 84px 22px 58px;
  }

  .hero-shell {
    padding-left: 0;
  }

  .project-line {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
  }

  .project-line__action {
    grid-column: 2;
    justify-self: start;
  }

  .project-line__meta {
    display: block;
    margin-top: 3px;
  }

  .subpage-main {
    padding: 76px 22px 56px;
  }
}

@media (max-width: 560px) {
  .about-facts {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .fact--education dd {
    gap: 1px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 26px;
  }

  .contact-email {
    word-break: break-word;
  }

  .button-row {
    flex-direction: column;
  }

  .code-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .reveal-item {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}


/* collapsed rail can be clicked anywhere to open */
body:not(.nav-expanded) .side-rail {
  cursor: pointer;
}

body.nav-expanded .side-rail {
  cursor: default;
}
