:root {
  --paper: #F3F1EA;
  --paper-dim: #E7E4D9;
  --ink: #1B2430;
  --ink-dim: #5C6570;
  --blue: #1E3A8A;
  --blue-line: #1E3A8A55;
  --blue-faint: #1E3A8A22;
  --accent: #C4501F;
  --ok: #2F6D4F;
  --radius: 2px;
  --maxw: 1080px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      var(--blue-faint) 39px,
      var(--blue-faint) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      var(--blue-faint) 39px,
      var(--blue-faint) 40px
    ),
    var(--paper);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--blue);
  color: var(--paper);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font-family: inherit;
}

img {
  max-width: 100%;
}

.mono {
  font-family: "JetBrains Mono", monospace;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
  letter-spacing: -0.01em;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 241, 234, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--blue-line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--maxw);
  min-height: 64px;
  margin: 0 auto;
  padding: 14px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.brand .badge {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  background: var(--paper);
  overflow: hidden;
  flex-shrink: 0;
}

.brand .badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

nav.links {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav.links a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 3px;
}

nav.links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 200ms ease;
}

nav.links a:hover::after,
nav.links a:focus-visible::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  width: 38px;
  height: 34px;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  background: var(--ink);
  margin: 3px auto;
}

.hero {
  position: relative;
  padding: 96px 0 64px;
  overflow: hidden;
}

.hero .wrap {
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "◆";
  font-size: 9px;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 78px);
  line-height: 0.98;
  font-weight: 700;
  max-width: 14ch;
}

.hero .role {
  margin-top: 18px;
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--ink-dim);
  max-width: 52ch;
}

.hero .role strong {
  color: var(--ink);
  font-weight: 600;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  font-family: "Inter", sans-serif;
  transition:
    transform 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.btn.primary {
  background: var(--ink);
  color: var(--paper);
}

.btn.primary:hover {
  background: var(--blue);
  border-color: var(--blue);
  transform: translateY(-2px);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
}

.btn.ghost:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.callouts {
  position: absolute;
  right: 24px;
  top: 64px;
  width: 230px;
  display: none;
}

.hero-photo {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 8px;
  margin-bottom: 28px;
}

.hero-photo .frame {
  position: relative;
  border: 1px solid var(--blue-line);
  overflow: hidden;
  aspect-ratio: 4 / 5;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.hero-photo .cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--ink-dim);
  padding: 7px 3px 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-photo .cap b {
  color: var(--ink);
}

.corner-tick {
  position: absolute;
  width: 10px;
  height: 10px;
}

.corner-tick.tl {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

.corner-tick.br {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.callout {
  position: relative;
  margin-bottom: 46px;
  padding-left: 26px;
}

.callout svg {
  position: absolute;
  left: 0;
  top: 6px;
}

.callout .k {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--blue);
  letter-spacing: 0.05em;
}

.callout .v {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

.titleblock {
  margin-top: 64px;
  border: 1.5px solid var(--ink);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 640px;
  min-height: 140px;
  align-items: stretch;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.titleblock div {
  padding: 10px 12px;
  border-right: 1px solid var(--blue-line);
  border-bottom: 1px solid var(--blue-line);
  min-width: 0;
}

.titleblock div:nth-child(4n) {
  border-right: none;
}

.titleblock .lbl {
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 9px;
  margin-bottom: 4px;
  display: block;
}

.titleblock .val {
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.draw-underline {
  position: relative;
  display: inline-block;
}

.draw-underline svg {
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 10px;
}

.draw-underline path {
  stroke: var(--accent);
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw 900ms 300ms ease forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

section {
  padding: 88px 0;
  border-top: 1px solid var(--blue-line);
}

.section-head {
  margin-bottom: 44px;
}

.sheet-no {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--blue);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
}

.section-head p.sub {
  color: var(--ink-dim);
  max-width: 60ch;
  margin-top: 10px;
  font-size: 15px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 600ms ease,
    transform 600ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
}

.about-grid p {
  font-size: 16px;
  color: var(--ink);
}

.status-card {
  border: 1.5px solid var(--ink);
  padding: 20px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  align-self: start;
}

.status-card .row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--blue-line);
}

.status-card .row:last-child {
  border-bottom: none;
}

.status-card .row > span:last-child {
  text-align: right;
  overflow-wrap: anywhere;
}

.status-card .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  margin-right: 6px;
}

.stack-diagram {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 720px;
}

.stack-layer {
  border: 1.5px solid var(--ink);
  border-top: none;
  padding: 20px 24px;
  position: relative;
  background: var(--paper);
}

.stack-layer:first-child {
  border-top: 1.5px solid var(--ink);
}

.stack-layer .layer-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.stack-layer .layer-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--blue);
}

.stack-layer h3 {
  font-size: 17px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  border: 1px solid var(--blue-line);
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--ink-dim);
  background: var(--paper-dim);
  overflow-wrap: anywhere;
}

.flow-arrow {
  position: absolute;
  right: 26px;
  top: -13px;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  z-index: 2;
}

.projects {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project-card {
  border: 1.5px solid var(--ink);
  padding: 28px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  position: relative;
  transition:
    box-shadow 200ms ease,
    transform 200ms ease;
}

.project-card:hover {
  box-shadow: 6px 6px 0 var(--blue-faint);
  transform: translate(-2px, -2px);
}

.project-sheet {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--ink-dim);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.08em;
}

.project-body h3 {
  font-size: 21px;
  margin-bottom: 4px;
}

.project-body .tags {
  margin: 12px 0 16px;
}

.project-body ul {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--ink);
  font-size: 14.5px;
}

.project-body li {
  margin-bottom: 6px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-links a {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  color: var(--ink);
}

.project-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.timeline {
  position: relative;
  padding-left: 28px;
  max-width: 720px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1.5px;
  background: var(--blue-line);
}

.t-item {
  position: relative;
  padding-bottom: 36px;
}

.t-item:last-child {
  padding-bottom: 0;
}

.t-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 4px;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--blue);
  background: var(--paper);
  border-radius: 50%;
}

.t-item .range {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.t-item h3 {
  font-size: 17px;
  margin: 5px 0 3px;
}

.t-item .school {
  color: var(--ink-dim);
  font-size: 14px;
  font-style: italic;
}

footer {
  border-top: 1.5px solid var(--ink);
  padding: 64px 0 40px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
}

footer h2 {
  font-size: clamp(28px, 5vw, 44px);
  max-width: 12ch;
  line-height: 1.05;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

.contact-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--blue-line);
  transition:
    padding-left 150ms ease,
    color 150ms ease;
  overflow-wrap: anywhere;
}

.contact-list a:hover {
  padding-left: 8px;
  color: var(--blue);
}

.contact-list .k {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--ink-dim);
  text-transform: uppercase;
  width: 64px;
  flex-shrink: 0;
}

.fine {
  margin-top: 40px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-dim);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

#contact-form {
  width: 100%;
  max-width: 720px;
}

#contact-form input,
#contact-form textarea {
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

#contact-form input:focus,
#contact-form textarea:focus {
  border-color: var(--blue) !important;
  box-shadow: 3px 3px 0 var(--blue-faint);
}

#contact-form textarea {
  min-height: 150px;
}

@media (min-width: 960px) {
  .callouts {
    display: block;
  }
}

@media (max-width: 959px) {
  .hero {
    padding-top: 75px;
  }

  .hero h1 {
    max-width: 13ch;
  }

  .callouts {
    position: relative;
    right: auto;
    top: auto;
    width: min(100%, 360px);
    margin: 50px auto 0;
    display: block;
  }

  .hero-photo {
    margin-bottom: 30px;
  }

  .callout {
    margin-bottom: 28px;
  }

  .titleblock {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  nav.links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(243, 241, 234, 0.98);
    border-bottom: 1px solid var(--blue-line);
    padding: 16px 24px;
    gap: 0;
    display: none;
  }

  nav.links.open {
    display: flex;
  }

  nav.links a {
    padding: 12px 0;
    border-bottom: 1px solid var(--blue-line);
  }

  nav.links a:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: 68px 0 55px;
  }

  .hero h1 {
    font-size: clamp(38px, 11vw, 58px);
    max-width: 100%;
  }

  .hero .role {
    font-size: 16px;
  }

  .titleblock {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 45px;
  }

  .titleblock div:nth-child(4n) {
    border-right: 1px solid var(--blue-line);
  }

  .titleblock div:nth-child(2n) {
    border-right: none;
  }

  section {
    padding: 65px 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .project-card {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 22px;
  }

  .project-sheet {
    writing-mode: horizontal-tb;
  }

  .stack-layer {
    padding: 18px;
  }

  .stack-layer .layer-head {
    align-items: flex-start;
  }

  .flow-arrow {
    right: 18px;
  }

  .status-card {
    width: 100%;
  }

  .contact-list {
    margin-top: 0;
  }
}

@media (max-width: 520px) {
  .wrap {
    padding: 0 17px;
  }

  .nav {
    padding: 12px 17px;
  }

  .brand {
    font-size: 13px;
  }

  .brand .badge {
    width: 28px;
    height: 28px;
  }

  .hero {
    padding: 55px 0 45px;
  }

  .eyebrow {
    font-size: 10px;
  }

  .hero h1 {
    font-size: clamp(35px, 12vw, 48px);
    line-height: 1.02;
  }

  .hero .role {
    font-size: 15px;
    line-height: 1.55;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-row .btn {
    width: 100%;
  }

  .titleblock {
    grid-template-columns: 1fr 1fr;
    font-size: 10px;
  }

  .titleblock div {
    padding: 9px;
  }

  .titleblock .lbl {
    font-size: 8px;
  }

  .titleblock .val {
    font-size: 10px;
  }

  .callouts {
    width: 100%;
  }

  .hero-photo {
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
  }

  .section-head {
    margin-bottom: 30px;
  }

  .section-head h2 {
    font-size: 27px;
  }

  .section-head p.sub {
    font-size: 14px;
  }

  .about-grid p {
    font-size: 14.5px;
  }

  .status-card {
    padding: 15px;
    font-size: 10.5px;
  }

  .status-card .row {
    gap: 10px;
  }

  .stack-layer h3 {
    font-size: 15px;
  }

  .stack-layer .layer-tag {
    font-size: 10px;
  }

  .tag {
    font-size: 10px;
    padding: 4px 8px;
  }

  .project-card {
    padding: 18px;
  }

  .project-body h3 {
    font-size: 19px;
  }

  .project-body ul {
    font-size: 13.5px;
    padding-left: 17px;
  }

  .project-sheet {
    font-size: 10px;
  }

  .timeline {
    padding-left: 25px;
  }

  .t-item::before {
    left: -25px;
  }

  .timeline::before {
    left: 5px;
  }

  .t-item h3 {
    font-size: 15px;
  }

  .t-item .school {
    font-size: 13px;
  }

  .t-item .range {
    font-size: 10px;
  }

  footer {
    padding: 50px 0 30px;
  }

  footer h2 {
    font-size: 34px;
  }

  .contact-list a {
    font-size: 13px;
  }

  .contact-list .k {
    width: 58px;
    font-size: 9px;
  }

  .fine {
    font-size: 9px;
  }
}

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

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