:root {
  --ink: #0d1b2a;
  --ink-soft: #1c3348;
  --paper: #efe8d8;
  --sheet: #f7f3ea;
  --line: rgba(13, 27, 42, 0.14);
  --line-strong: rgba(13, 27, 42, 0.28);
  --muted: #5b6773;
  --steel: #3d7ea6;
  --steel-bright: #8ec4e0;
  --brass: #b08d4a;
  --good: #2f6b4f;
  --danger: #8a3b32;
  --shadow: 0 18px 40px rgba(13, 27, 42, 0.08);
  --radius: 18px;
  --max: 1180px;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 1px 1px, rgba(13, 27, 42, 0.06) 1px, transparent 0) 0 0 / 22px 22px,
    var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
}

a {
  color: inherit;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 0.9rem;
  z-index: 20;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(247, 243, 234, 0.88);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 68px;
  min-width: 0;
}

.mark {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  min-width: 0;
  text-decoration: none;
  letter-spacing: 0.08em;
}

.mark-id {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--steel);
}

.mark-name {
  font-weight: 700;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem 1.25rem;
}

.nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.hero {
  background: var(--ink);
  color: #e8eef4;
  margin: 1rem auto 0;
  width: min(calc(100% - 2rem), var(--max));
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(142, 196, 224, 0.18);
  border-radius: 14px;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 0.92fr) minmax(18rem, 1.18fr);
  min-height: min(88vh, 940px);
}

.hero-copy {
  padding: clamp(2rem, 5vw, 3.6rem);
  min-width: 0;
}

.hero-gallery-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel-bright);
  margin: 0 0 1rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 8vw, 6.4rem);
  line-height: 0.92;
  font-weight: 400;
  margin: 0;
  color: var(--steel-bright);
  overflow-wrap: anywhere;
}

.hero h1 span {
  display: block;
  color: #f4f7fa;
}

.lede {
  margin: 1.4rem 0 0;
  max-width: 34rem;
  font-size: 1.12rem;
  color: rgba(232, 238, 244, 0.84);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.6rem;
}

.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(142, 196, 224, 0.35);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: var(--steel-bright);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  font-weight: 600;
  font-size: 0.95rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

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

.btn-ghost {
  border: 1px solid rgba(232, 238, 244, 0.28);
  color: #f4f7fa;
}

.btn-secondary {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: #fffdf8;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.hero-gallery {
  background: linear-gradient(180deg, #12263a, #0d1b2a);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: clamp(0.55rem, 1.2vw, 0.9rem);
  align-content: stretch;
  flex: 1;
  min-height: 0;
  min-width: 0;
  height: 100%;
  padding: clamp(1rem, 2.4vw, 1.6rem);
  scrollbar-width: none;
}

.hero-gallery::-webkit-scrollbar {
  display: none;
}

.thumb {
  background: #f7f3ea;
  border-radius: 14px;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  text-decoration: none;
  color: inherit;
}

.thumb img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  background: #ece7dc;
}

.thumb span {
  font-family: var(--mono);
  font-size: clamp(0.68rem, 0.9vw, 0.78rem);
  padding: 0.5rem 0.7rem 0.65rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-dots {
  display: none;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 0 1rem;
  background: linear-gradient(180deg, #12263a, #0d1b2a);
}

.gallery-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(232, 238, 244, 0.28);
  cursor: pointer;
}

.gallery-dots button[aria-current="true"] {
  background: var(--steel-bright);
  width: 18px;
}

.section {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.8rem;
  min-width: 0;
}

.section-head h2,
.page-title h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
  margin: 0;
  font-weight: 400;
}

.section-head p,
.page-title p {
  margin: 0;
  color: var(--muted);
  max-width: 34rem;
}

.profile-grid,
.skills-grid,
.work-grid,
.workflow-grid,
.stats,
.figure-grid,
.compare,
.setup-grid,
.split,
.metrics {
  display: grid;
  gap: 1rem;
}

.split,
.profile-grid,
.work-grid,
.figure-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.figure-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.skills-grid,
.workflow-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.card {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow-wrap: break-word;
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
  margin-top: 1rem;
}

.stat {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  min-width: 0;
}

.stat b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 3.4vw, 1.85rem);
  line-height: 1.05;
  color: var(--steel);
  overflow-wrap: anywhere;
}

.stat span {
  color: var(--muted);
  font-size: 0.88rem;
}

.work-card {
  text-decoration: none;
  overflow: hidden;
  padding: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.work-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #ece7dc;
}

.work-card .body {
  padding: 1.15rem 1.25rem 1.3rem;
}

.num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--steel);
  letter-spacing: 0.12em;
}

.work-card h3 {
  margin: 0.25rem 0 0.4rem;
  font-size: 1.25rem;
  text-wrap: balance;
}

.work-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.skills-grid h3,
.workflow-grid h3,
.card h3 {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
}

.skills-grid ul,
.card ul {
  margin: 0;
  padding: 0 0 0 1.1rem;
}

.skills-grid li + li,
.card li + li {
  margin-top: 0.28rem;
}

.contact-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.contact-panel a {
  color: var(--steel);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0 2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.host-mark {
  letter-spacing: 0.04em;
  color: var(--muted);
}

.page-title {
  padding: 2.4rem 0 0.4rem;
}

.page-title .num {
  display: block;
  margin-bottom: 0.5rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
}

.hero-figure {
  margin: 1.4rem auto 0;
  width: min(calc(100% - 2rem), var(--max));
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.hero-figure img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #f3eee4;
}

.hero-figure figcaption,
.figure figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.85rem 1rem 1rem;
  overflow-wrap: anywhere;
}

.figure {
  margin: 0;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f3eee4;
}

.metrics {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  gap: 0.8rem;
}

.metrics.three,
.metrics.five {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
}

.takeaway {
  background: var(--ink);
  color: #e8eef4;
  border: 0;
}

.takeaway h2,
.takeaway h3 {
  color: var(--steel-bright);
}

.pager {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 3rem;
}

.pager a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--sheet);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  min-width: 0;
  flex: 1 1 14rem;
}

.pager small {
  display: block;
  font-family: var(--mono);
  color: var(--steel);
  margin-bottom: 0.2rem;
}

.result {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.6rem);
  color: var(--steel);
  line-height: 0.95;
  margin: 0.2rem 0;
  overflow-wrap: anywhere;
}

.takeaway a {
  color: var(--steel-bright);
}

.takeaway .good,
.good {
  color: #8fd0b0;
}

.skill-board,
.process {
  display: grid;
  gap: 1rem;
}

.skill-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.25rem;
}

.skill-board div {
  min-width: 0;
  padding: 1.05rem 1.15rem;
}

.skill-board div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.skill-board div:nth-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.skill-board h3 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--steel);
}

.skill-board p {
  margin: 0;
  color: var(--muted);
}

.process {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}

.process li {
  min-width: 0;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow);
}

.process li::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--steel);
  margin-bottom: 0.45rem;
}

.process strong {
  display: block;
  margin-bottom: 0.35rem;
}

.process p {
  margin: 0;
  color: var(--muted);
}

.resume-sheet {
  margin-top: 1.4rem;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.resume-page {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  vertical-align: top;
}

.resume-page + .resume-page {
  border-top: 1px solid var(--line);
}

.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.page-title h1 {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

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

@media (max-width: 980px) {
  .contact-panel {
    grid-template-columns: 1fr;
  }

  .skill-board,
  .process {
    grid-template-columns: 1fr;
  }

  .skill-board div,
  .skill-board div:nth-child(odd),
  .skill-board div:nth-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .skill-board div:last-child {
    border-bottom: 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero::after {
    display: none;
  }

  .hero-gallery-wrap {
    min-height: 0;
  }

  .hero-gallery {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    gap: 0;
    height: auto;
    padding: 0;
    grid-template-columns: none;
    grid-template-rows: none;
  }

  .hero-gallery .thumb {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    scroll-snap-align: start;
    height: min(62vw, 22rem);
    border-radius: 0;
  }

  .gallery-dots {
    display: flex;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }

  .nav {
    display: none;
    position: absolute;
    right: 1rem;
    top: 68px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.8rem;
    min-width: min(12rem, calc(100vw - 2rem));
    z-index: 12;
  }

  .nav.open {
    display: flex;
  }

  .contact-panel,
  .skills-grid,
  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .pager {
    flex-direction: column;
  }

  .pager a {
    flex-basis: auto;
  }

  .hero {
    width: min(calc(100% - 1rem), var(--max));
    margin-top: 0.65rem;
    border-radius: 16px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.35rem;
  }
}

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

  .hero-gallery {
    scroll-snap-type: none;
  }
}

.blank-sheet {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
}

.blank-mark {
  font-family: var(--mono);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.8rem;
}
