:root {
  --bg: #e9e3d6;
  --bg-elevated: #f7f2e7;
  --bg-elevated-alt: #d5d0c4;
  --keycap: #1d2023;
  --text-main: #202124;
  --text-muted: #555555;
  --accent: #4fa7a0;
  --accent-soft: #c4dedb;
  --accent-strong: #c0392b;
  --border-subtle: #c2bbad;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "IBM Plex Serif", "Iowan Old Style", "Georgia", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  position: relative;
  border-bottom: none;
  background-color: transparent;
}

.top-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: -1px;
  background-color: var(--bg-elevated-alt);
  border-bottom-left-radius: 50% 25%;
  border-bottom-right-radius: 50% 25%;
  box-shadow: 0 1px 0 var(--border-subtle);
  z-index: -1;
}

.top-bar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background-color: var(--accent);
  color: #f7f2e7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}
/* red accent moved off the keycap to the page margin; this pseudo-element is intentionally empty now */

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

 .toggles {
  /* Hide design controls in production; controls still exist in markup for future tweaking */
  display: none;
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.75rem;
}

.toggle-group label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.toggle-group select {
  appearance: none;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
  font-family: var(--font-body);
  background-color: var(--bg-elevated);
  color: var(--text-main);
}

.page {
  flex: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.5rem;
  position: relative;
}

/* vertical margin line that visually connects into the curved header */
.page::before {
  content: "";
  position: absolute;
  left: 0;
  top: -2px; /* meets the header curve without visibly intruding */
  bottom: 0;
  border-left: 1px solid var(--border-subtle);
}

/* red margin stop, rendered on top of the line */
.page::after {
  content: "";
  position: absolute;
  left: -2px;
  top: 4.5rem;
  width: 6px;
  height: 18px;
  border-radius: 3px;
  background-color: var(--accent-strong);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.1fr);
  gap: 1rem;
  margin-bottom: 0rem; /* slightly smaller gap before the Work section */
}

.hero-main h1 {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0 0 0.9rem;
}

.hero-lede {
  margin: 0 0 1.1rem;
  font-size: 0.98rem;
  line-height: 1.6;
}

.hero-actions {
  display: none; /* hide About & CV / Get in touch buttons for now */
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  border-radius: 4px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

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

.button-secondary {
  background-color: transparent;
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.button-primary:focus-visible,
.button-secondary:focus-visible,
.toggle-group select:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.hero-aside {
  align-self: stretch;
  display: flex;
  justify-content: right; /* center the snapshot card in its column */
}

.card {
  background-color: var(--bg-elevated);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  padding: 1rem 1.1rem;
}

.card.key-stats {
  display: inline-block;
  max-width: 300px;
  width: 100%;
  padding: 0.15rem .22rem 0.75rem; /* tighter left/right padding */
}

.key-stats-body {
  margin-top: 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.snapshot-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.snapshot-row {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.snapshot-row--bottom {
  /* slight keyboard stagger is no longer needed; keep rows centered */
}

.snapshot-key {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;          /* 75% of 52px */
  height: 50px;         /* keep keys perfectly square */
  border-radius: 6px;
  border: none;
  background-color: #2E363B; /* dedicated snapshot key color */
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  cursor: default;
}

.snapshot-key--blank {
  background-color: var(--bg-elevated);
  box-shadow: none;
}

.snapshot-emoji {
  font-size: 1rem; /* scale emoji with smaller keys */
}

.snapshot-image {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.snapshot-image {
  display: block;
  width: 28px;
  height: 28px;
}

/* tooltip visuals now handled by .snapshot-tooltip element */

.headshot-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.headshot-image {
  display: block;
  max-height: 165px; /* 75% of 220px */
  width: auto;
  max-width: 195px;  /* 75% of 260px */
  border-radius: 6px;
  border: none;
  background-color: transparent;
}

.snapshot-tooltip {
  position: fixed;
  transform: translateZ(0);
  max-width: 260px;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.72rem;
  line-height: 1.4;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  pointer-events: none;
  z-index: 40;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}

.stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 3fr);
  gap: 0.35rem 0.65rem;
  font-size: 0.83rem;
  padding: 0.18rem 0;
}

.stat-row dd {
  margin: 0;
  font-size: 0.86rem;
}

.stat-row dt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-elevated-alt);
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.stat-row dd {
  margin: 0;
}

.section {
  margin-bottom: 2.3rem;
}

/* Base text-link reset */
.text-link {
  position: relative;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.text-link:hover {
  text-decoration: none;
}

/* Link style 1: ink underline (accent color, slightly offset) */
.link-style-ink-underline .text-link {
  color: var(--accent);
}

.link-style-ink-underline .text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.12em;
  height: 1px;
  background-color: currentColor;
}

.link-style-ink-underline .text-link:hover::after {
  height: 2px;
}

/* Link style 2: quiet (subtle grey, underline on hover only) */
.link-style-quiet .text-link {
  color: var(--text-muted);
}

.link-style-quiet .text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.1em;
  height: 0;
  background-color: currentColor;
  transition: height 120ms ease-out;
}

.link-style-quiet .text-link:hover {
  color: var(--accent);
}

.link-style-quiet .text-link:hover::after {
  height: 1px;
}

/* Link style 3: capsule (tiny rounded background tag) */
.link-style-capsule .text-link {
  padding: 0.04rem 0.28rem;
  border-radius: 999px;
  background-color: var(--accent-soft);
  color: var(--accent);
}

.link-style-capsule .text-link:hover {
  background-color: var(--accent);
  color: #ffffff;
}

.section-header {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.6rem; /* bring header closer to section content */
  padding-bottom: 0.2rem; /* remove extra space previously used for underline */
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.section h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0;
  color: var(--accent);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.section p {
  font-size: 0.86rem;
  line-height: 1.6;
}

.simple-list,
.role-list,
.edu-list,
.bullet-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
}

.simple-list li {
  font-size: 0.82rem;
  line-height: 1.55;
  padding-left: 0.9rem;
  position: relative;
}

.simple-list li::before {
  content: "—";
  font-weight: 600;
  position: absolute;
  left: 0;
  color: var(--accent-strong);
}

.role-list li + li,
.edu-list li + li,
.bullet-list li + li {
  margin-top: 0.7rem;
}

.role-heading {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.role-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.role-org {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.role-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.role-body {
  font-size: 0.82rem;
  margin-top: 0.3rem;
}

.edu-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.82rem;
}

.edu-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.cv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.cv-column {
  background-color: var(--bg-elevated);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  padding: 1rem 1.1rem;
}

/* Small red download key on CV Highlights card */
.card--cv-highlights {
  position: relative;
}

.download-key {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  height: 30px;
  border-radius: 6px;
  border: none;
  background-color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0 0.45rem;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;
}

.download-key-image {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.download-key-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: #ffffff;
}

.cv-subheading {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  margin: 0 0 0.6rem;
}

.bullet-list li {
  font-size: 0.82rem;
  line-height: 1.55;
  padding-left: 0.8rem;
  position: relative;
}

.bullet-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.35rem 0;
  font-size: 0.82rem;
}

.contact-label {
  min-width: 60px;
  font-weight: 500;
  color: var(--text-muted);
}

.contact-value {
  color: inherit;
  text-decoration: none;
}

.contact-value:hover {
  text-decoration: underline;
}

.contact-note {
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-elevated-alt);
}

.site-footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-note {
  opacity: 0.9;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-aside {
    order: -1;
    justify-content: center;
  }

  .section-grid,
  .cv-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-bar-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .page {
    padding-inline: 1rem;
  }

  .hero-main h1 {
    font-size: 1.7rem;
  }

  .brand-subtitle {
    max-width: 20rem;
  }
}
