:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #eef3ee;
  --ink: #1e2528;
  --muted: #687176;
  --line: #d8ded8;
  --accent: #176b5b;
  --accent-dark: #0e4238;
  --warm: #b46a39;
  --blue: #285c7f;
  --shadow: 0 18px 45px rgba(26, 37, 42, 0.12);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1f1e;
  --surface: #242a28;
  --surface-soft: #2a322f;
  --ink: #e8ebe6;
  --muted: #8a9a94;
  --line: #3a4541;
  --accent: #2a9d82;
  --accent-dark: #4dd4b5;
  --warm: #d48a5a;
  --blue: #5a9ec4;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: inherit;
}

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

.visually-hidden:focus {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  width: auto;
  height: auto;
  padding: 8px 16px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
  background: var(--accent);
  color: #ffffff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 24px;
  align-items: center;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(246, 247, 244, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

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

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.main-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--accent-dark);
}

.language-switcher {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.lang-button {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.lang-button.active {
  background: var(--accent);
  color: white;
}

.lang-link {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  min-height: 34px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.lang-link.active {
  background: var(--accent);
  color: white;
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(44px, 8vw, 104px) clamp(18px, 6vw, 88px) 56px;
}

.hero-copy {
  max-width: 790px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--warm);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 850px;
  margin-bottom: 22px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.06;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 21px;
  line-height: 1.25;
}

.hero-summary,
.section-head p {
  color: var(--muted);
  font-size: 18px;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

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

.button.secondary {
  background: transparent;
  color: var(--ink);
}

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  background: var(--surface-soft);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  background: var(--line);
}

.proof-grid div {
  padding: 18px;
  background: var(--surface);
}

.proof-grid dt {
  color: var(--blue);
  font-size: 31px;
  font-weight: 800;
  line-height: 1;
}

.proof-grid dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.section {
  padding: 76px clamp(18px, 6vw, 88px);
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 860px;
  margin-bottom: 34px;
}

.section-head.compact {
  max-width: 620px;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.case-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.case-card.featured {
  grid-column: 1 / -1;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
}

.case-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-soft);
}

.case-card,
.experience-card,
.archive-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.case-card:hover,
.experience-card:hover,
.archive-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.button {
  transition: background 0.2s ease, transform 0.15s ease;
}

.button:active {
  transform: scale(0.98);
}

.case-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-kicker {
  margin-bottom: 8px;
  color: var(--warm);
  font-size: 13px;
  font-weight: 800;
}

.case-points {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.case-points li {
  padding: 10px 14px 10px 18px;
  background: transparent;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.5;
}

.archive-callout,
.cv-callout {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 18px 18px 18px 21px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  color: var(--ink);
}

.cv-callout {
  margin-top: 0;
}

.archive-callout span,
.cv-callout span {
  color: var(--muted);
  font-size: 15px;
}

.archive-callout a,
.cv-callout a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.archive-callout a:hover,
.cv-callout a:hover {
  text-decoration: underline;
}

.archive-section {
  background: var(--surface-soft);
}

.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.archive-filter {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.archive-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.archive-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.archive-card[hidden] {
  display: none;
}

.archive-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface-soft);
}

.archive-card div {
  padding: 16px;
}

.archive-card h3 {
  font-size: 19px;
}

.archive-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.archive-meta {
  margin-bottom: 8px;
  color: var(--warm);
  font-size: 12px;
  font-weight: 800;
}

.archive-note {
  max-width: 780px;
  margin: 24px 0 0;
  color: var(--muted);
}

.archive-page {
  background: var(--bg);
}

.archive-page .main-nav a[href*="project_archive"] {
  color: var(--accent-dark);
}

.archive-hero {
  padding: 76px clamp(18px, 6vw, 88px) 34px;
}

.archive-hero h1 {
  max-width: 960px;
  margin-bottom: 18px;
  font-size: clamp(42px, 6vw, 74px);
}

.archive-hero p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

.archive-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.archive-jump-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.archive-shell {
  padding: 0 clamp(18px, 6vw, 88px) 76px;
}

.legacy-project-archive {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.legacy-project-archive table {
  width: 100% !important;
  border-collapse: collapse;
}

.legacy-project-archive td[width="310"] {
  width: auto;
}

.legacy-project-archive h2 {
  margin: 36px 0 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--accent-dark);
  font-size: 32px;
  text-align: left;
}

.legacy-project-archive h2:empty,
.legacy-project-archive h2:first-child {
  display: none;
}

.legacy-project-archive td {
  padding: 12px;
  vertical-align: top;
}

.legacy-project-archive tr:has(hr) td {
  padding: 12px 0;
}

.legacy-project-archive hr {
  border: 0;
  border-top: 1px solid var(--line);
}

.legacy-project-archive p {
  color: var(--ink);
}

.legacy-project-archive a {
  color: var(--accent);
  font-weight: 700;
}

.legacy-project-archive img {
  height: auto;
  border-radius: 6px;
}

.project-screenshots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  justify-items: center;
}

.project-screenshots a {
  display: block;
  line-height: 0;
}

.project-screenshots img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.legacy-project-archive td[width="29"],
.legacy-project-archive td[width="18"] {
  color: var(--warm);
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline article,
.process-grid article,
.stack-grid div {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timeline span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--warm);
  font-weight: 800;
}

.section-subtitle {
  color: var(--muted);
  font-size: 18px;
  margin-top: 8px;
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.experience-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 12px;
}

.card-header h3 {
  margin: 0;
  font-size: 19px;
}

.date-range {
  color: var(--warm);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.roles {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 14px;
}

.experience-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.experience-card p:last-child {
  margin-bottom: 0;
}



.process-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stack-grid strong,
.stack-grid span {
  display: block;
}

.stack-grid strong {
  margin-bottom: 8px;
}

.stack-grid span {
  color: var(--muted);
}

.cv-section {
  background: var(--surface-soft);
}

.cv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.cv-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  position: relative;
  min-height: 0;
}

.cv-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--warm);
  border-radius: 8px 8px 0 0;
}

.cv-card[data-type="TeamLead"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
  border-radius: 8px 8px 0 0;
}

.cv-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 30px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-weight: 800;
}

.cv-card h3 {
  margin-bottom: 0;
}

.cv-card a {
  margin-top: auto;
  align-self: end;
  color: var(--accent);
  font-weight: 800;
}

.cv-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 0.75fr);
  gap: 28px;
  align-items: center;
  padding: 76px clamp(18px, 6vw, 88px);
  background: var(--accent-dark);
  color: white;
}

.contact-section .eyebrow {
  color: #e7b77a;
}

.contact-section h2 {
  max-width: 760px;
  margin-bottom: 16px;
}

.contact-copy p:not(.eyebrow) {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.76);
}

.contact-section .button.secondary {
  border-color: rgba(255, 255, 255, 0.6);
  color: white;
}

.contact-card {
  display: grid;
  gap: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
}

.contact-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.contact-label {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-value {
  color: white;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}

a.contact-value[href]:hover {
  text-decoration: underline;
}

.reveal-contact {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  cursor: pointer;
  font-weight: 800;
}

.reveal-contact:disabled {
  cursor: default;
  opacity: 0.62;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 34px;
  padding: 0;
  border: none;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .sun { display: block; }
.theme-toggle .moon { display: none; }

html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: block; }

[data-theme="dark"] .site-header {
  background: rgba(26, 31, 30, 0.94);
}

[data-theme="dark"] .contact-section {
  background: #0f2e26;
/*  background: var(--accent-dark); */
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 56px);
  color: var(--muted);
  font-size: 14px;
}

.archive-footer-note {
  flex: 1 1 320px;
  text-align: center;
}

@media print {
  .site-header,
  .theme-toggle,
  .reveal-contact,
  .language-switcher {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .case-card {
    break-inside: avoid;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero,
  .split,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .case-grid,
  .archive-grid,
  .process-grid,
  .experience-grid,
  .stack-grid,
  .cv-grid {
    grid-template-columns: 1fr;
  }

  .contact-section {
    display: grid;
  }
}

@media (min-width: 981px) and (max-width: 1240px) {
  .archive-grid,
  .cv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 660px) {
  .site-header {
    padding: 12px 14px;
  }

  .brand small {
    display: none;
  }

  .main-nav {
    gap: 14px;
  }

  .hero {
    min-height: auto;
    padding-top: 38px;
  }

  h1 {
    font-size: 41px;
    overflow-wrap: break-word;
  }

  .case-card,
  .case-card.featured {
    grid-template-columns: 1fr;
  }

  .case-card img {
    width: auto;
    max-width: 180px;
  }

  .proof-grid {
    grid-template-columns: 1fr;
  }

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

  .archive-callout,
  .cv-callout {
    display: grid;
  }

  .legacy-project-archive {
    padding: 10px;
  }

  .legacy-project-archive table,
  .legacy-project-archive tbody,
  .legacy-project-archive tr {
    display: block;
  }

  .legacy-project-archive table {
  }

  .legacy-project-archive td {
    display: block;
    height: auto !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .legacy-project-archive td[width="18"] {
    display: none;
  }

  .legacy-project-archive td[width="29"] {
    width: auto;
    padding: 4px 0;
    text-align: center;
  }

  .legacy-project-archive img {
    height: auto;
  }

  .project-screenshots {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .legacy-project-archive h4 p {
    display: inline-block;
    margin: 4px 8px 4px 0;
  }

  .legacy-project-archive h4 a {
    display: inline-block;
    padding: 6px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    text-decoration: none;
  }
}
