:root {
  color-scheme: light;
  --bg: #f7f7f3;
  --paper: #ffffff;
  --ink: #181a1f;
  --muted: #626973;
  --line: #deded7;
  --soft: #efefea;
  --accent: #165a4a;
  --accent-ink: #eef8f4;
  --shadow: 0 10px 28px rgba(24, 26, 31, 0.06);
  --max: 1000px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  letter-spacing: 0;
}

body.nav-open,
body.command-open {
  overflow: hidden;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.9rem;
  font-size: clamp(2.7rem, 8vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 1rem;
  font-size: 1.45rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

p,
li {
  color: #333942;
}

ul {
  margin: 0;
  padding-left: 1.15rem;
}

li {
  margin: 0.35rem 0;
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

.narrow {
  max-width: 860px;
}

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

.nav {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  color: var(--ink);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.nav-links a,
.command-button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.42rem 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links a:hover,
.nav-links a.active,
.command-button:hover {
  background: var(--soft);
  color: var(--ink);
  text-decoration: none;
}

.command-button {
  border: 1px solid var(--line);
  margin-left: 0.35rem;
  font-size: 0.82rem;
}

.nav-toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}

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

.page {
  padding-block: 4rem 3rem;
}

.landing-grid {
  min-height: calc(100vh - 170px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
  align-content: center;
  column-gap: 4rem;
  row-gap: 1.4rem;
}

.landing-head {
  grid-column: 1 / -1;
}

.kicker {
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 720px;
  color: var(--ink);
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  line-height: 1.55;
}

.bio-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.7rem;
}

.bio-text {
  max-width: 720px;
  color: var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.6;
}

.bio-card .bio-text {
  margin-bottom: 1.1rem;
}

.bio-card .bio-text:last-child {
  margin-bottom: 0;
}

.gloss-term {
  position: relative;
  display: inline;
  cursor: help;
  font-weight: 600;
  color: #2d6a4f; /* match the site's existing accent green used in "SOFTWARE ENGINEER 1 · IMAGINE LEARNING" */
  text-decoration: underline dotted #2d6a4f 1.5px;
  text-underline-offset: 3px;
}

.gloss-term:hover,
.gloss-term:focus {
  color: #1b4332;
  outline: none;
}

.gloss-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 260px;
  max-width: 80vw;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: #1a1a1a;
  background: #ffffff;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.06);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
  text-decoration: none;
}

.gloss-term:hover .gloss-tooltip,
.gloss-term:focus .gloss-tooltip,
.gloss-term.is-active .gloss-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .gloss-tooltip {
    width: 200px;
    left: 0;
    transform: translateX(0) translateY(4px);
  }
  .gloss-term:hover .gloss-tooltip,
  .gloss-term:focus .gloss-tooltip,
  .gloss-term.is-active .gloss-tooltip {
    transform: translateX(0) translateY(0);
  }
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.8rem;
}

.button {
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.58rem 0.85rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.button:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.identity-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.identity-label {
  margin-bottom: 0.9rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dl {
  margin: 0;
}

.identity-card div {
  border-top: 1px solid var(--line);
  padding: 0.65rem 0;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

dd {
  margin: 0.12rem 0 0;
  font-size: 0.93rem;
  font-weight: 620;
}

.section {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.resume-frame {
  margin-top: 1.6rem;
  aspect-ratio: 8.5 / 11;
  max-height: 85vh;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--soft);
  box-shadow: var(--shadow);
}

.resume-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.section > h2,
.section-title-row h2,
.cv-section > h2,
.case-section > h2 {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.section-title-row a,
.section-title-row .muted {
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-title-row a::after,
.route-card > span::after,
.project-row-body strong::after {
  content: " ->";
  display: inline-block;
  margin-left: 0.2rem;
  color: var(--accent);
  font-weight: 800;
  transition: transform 160ms ease;
}

.section-title-row a:hover::after,
.route-card:hover > span::after,
.project-row:hover .project-row-body strong::after {
  transform: translateX(0.22rem);
}

.muted {
  color: var(--muted);
}

.news-list article,
.article-list article {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1.25rem;
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

.news-list article:first-child,
.article-list article:first-child {
  border-top: 0;
}

time,
small {
  color: var(--muted);
  font-size: 0.84rem;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.route-card {
  min-height: 10rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 1rem;
  color: var(--ink);
}

.route-card:hover,
.project-row:hover,
.contact-list a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.route-card span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-card strong {
  font-size: 1rem;
  line-height: 1.45;
}

.page-head {
  margin-bottom: 2.4rem;
}

.page-head p {
  max-width: 760px;
  font-size: 1.12rem;
}

.cv-section {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 1.8rem;
}

.cv-item {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 1.4rem;
  border-top: 1px solid var(--line);
  padding: 1.35rem 0;
  scroll-margin-top: 78px;
}

.cv-item:first-of-type {
  border-top: 0;
}

.cv-item.important {
  border-top: 2px solid var(--accent);
}

.project-responsibilities {
  display: grid;
  gap: 1.35rem;
}

.project-responsibilities section {
  border-left: 2px solid var(--line);
  padding-left: 1rem;
}

.project-responsibilities h4 {
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.35;
}

.project-responsibilities ul {
  padding-left: 1.1rem;
}

.cv-date {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.company-logo {
  width: 112px;
  height: 112px;
  display: block;
  margin-top: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0.45rem;
  object-fit: contain;
}

.company-rail {
  position: fixed;
  top: 50%;
  left: max(1rem, calc((100vw - var(--max)) / 2 - 92px));
  transform: translateY(-50%);
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.company-rail-item {
  position: relative;
  display: block;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.35rem;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.company-rail-item:hover {
  border-color: var(--accent);
  transform: scale(1.06);
  text-decoration: none;
}

.company-rail-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.company-rail-item::after {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  left: calc(100% + 0.6rem);
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.company-rail-item:hover::after {
  opacity: 1;
}

/* Below 1200px there is no left gutter to hold a fixed rail, so switch it
   to a horizontal scrollable logo bar that sits inline above the content. */
@media (max-width: 1200px) {
  .company-rail {
    position: static;
    transform: none;
    flex-direction: row;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    padding: 0.6rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
  }

  .company-rail-item {
    flex: 0 0 auto;
  }

  /* The hover label tooltip makes no sense in a horizontal touch bar. */
  .company-rail-item::after {
    display: none;
  }
}

.stack-list p {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 0.9rem 0;
}

.stack-list strong {
  display: block;
  color: var(--ink);
}

.project-list {
  display: grid;
  gap: 0.9rem;
}

.project-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 0.8rem;
  color: var(--ink);
}

.project-row img,
.project-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  background: var(--soft);
  filter: none;
}

.project-row img.architecture-thumb {
  object-fit: cover;
  object-position: 50% 42%;
}

.project-placeholder {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 800;
}

.project-row-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
}

.project-row-body strong {
  font-size: 1.25rem;
}

.project-row-body small {
  color: var(--accent);
  font-weight: 650;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.case-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  filter: none;
}

.architecture-figure {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 0.8rem;
}

.architecture-image {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  block-size: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.architecture-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
}

.architecture-link:hover .architecture-image {
  border-color: var(--accent);
}

.architecture-figure figcaption {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.case-section {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 1.8rem;
}

.article-list article {
  display: block;
}

.article-list h2 {
  margin-bottom: 0.4rem;
  text-transform: none;
}

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

.note-tag {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.2rem 0.6rem;
  background: var(--soft);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

.contact-list {
  display: grid;
  gap: 0.8rem;
}

.contact-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 1rem;
  color: var(--ink);
}

.contact-list span {
  color: var(--muted);
}

.footer {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.command-menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: start center;
  padding-top: 14vh;
  background: rgba(24, 26, 31, 0.22);
}

.command-panel {
  width: min(520px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

.command-panel input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: none;
  padding: 1rem;
  font: inherit;
}

.command-list {
  display: grid;
  padding: 0.5rem;
}

.command-list a {
  border-radius: 5px;
  color: var(--ink);
  padding: 0.7rem;
}

.command-list a:hover {
  background: var(--soft);
  text-decoration: none;
}

@media (max-width: 780px) {
  h1 {
    font-size: clamp(2.45rem, 14vw, 4.4rem);
    line-height: 1;
  }

  .lead {
    font-size: 1.15rem;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    inset: 62px 16px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    box-shadow: 0 14px 36px rgba(24, 26, 31, 0.14);
    padding: 0.45rem;
  }

  body.nav-open .nav-links {
    display: flex;
  }

  .nav-links a,
  .command-button {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    text-align: left;
    margin-left: 0;
  }

  .landing-grid,
  .route-grid,
  .cv-item,
  .project-row,
  .news-list article {
    grid-template-columns: 1fr;
  }

  .landing-grid {
    min-height: auto;
    gap: 1.8rem;
    align-items: start;
  }

  .identity-card {
    max-width: none;
  }

  .page {
    padding-top: 2.6rem;
  }

  .section,
  .cv-section,
  .case-section {
    padding: 1.4rem;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .contact-list a,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-menu {
    align-items: start;
    padding-top: 5.25rem;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 32px, var(--max));
  }

  .site-header {
    position: sticky;
  }

  .nav {
    min-height: 58px;
  }

  .brand {
    max-width: 68vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-links {
    inset: 58px 12px auto;
  }

  .page {
    padding-block: 1.5rem 2rem;
  }

  .landing-grid {
    gap: 1.4rem;
  }

  .kicker {
    font-size: 0.74rem;
    line-height: 1.45;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    justify-content: center;
    width: 100%;
  }

  .identity-card,
  .bio-card {
    padding: 1.1rem;
  }

  .section,
  .cv-section,
  .case-section {
    margin-top: 1rem;
    padding: 1.2rem;
    box-shadow: 0 8px 22px rgba(24, 26, 31, 0.07);
  }

  .cv-item {
    gap: 0.55rem;
    padding-block: 1.1rem;
  }

  .company-logo {
    width: 80px;
    height: 80px;
    margin-top: 0.7rem;
  }

  .article-list {
    display: grid;
    gap: 0.8rem;
  }

  .article-list article {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    box-shadow: var(--shadow);
    padding: 1.15rem;
  }

  .article-list article:first-child {
    border-top: 1px solid var(--line);
  }

  .route-card {
    min-height: 8rem;
  }

  .project-row {
    padding: 0.65rem;
  }

  .project-row img,
  .project-placeholder {
    max-height: 210px;
  }

  .architecture-figure {
    padding: 0.55rem;
  }

  .command-panel {
    width: calc(100% - 24px);
    max-height: calc(100vh - 6.5rem);
    overflow: auto;
  }

  .command-panel input {
    font-size: 1rem;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 2.35rem;
  }

  .lead {
    font-size: 1.05rem;
  }

  .contact-list strong,
  .project-row-body span,
  .cv-content p,
  .cv-content li {
    overflow-wrap: anywhere;
  }
}
