:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-soft: #efebe1;
  --ink: #17201c;
  --muted: #4b5a53;
  --line: #ddd7c8;
  --accent: #0b7a5a;
  --accent-strong: #075a43;
  --accent-soft: #dff3ea;
  --gold: #b8862c;
  --shadow: 0 18px 50px rgba(38, 45, 40, 0.12);
  --header-bg: rgba(247, 245, 239, 0.86);
  --max-width: 1180px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101411;
  --surface: #171d19;
  --surface-soft: #202720;
  --ink: #f2f1ea;
  --muted: #c6cec6;
  --line: #303930;
  --accent: #76d5ab;
  --accent-strong: #9ae8c4;
  --accent-soft: #17382c;
  --gold: #f2c96f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(16, 20, 17, 0.86);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(11, 122, 90, 0.08), transparent 340px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(94, 107, 100, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 107, 100, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 58%);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 900;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  letter-spacing: 0;
}

.brand-text {
  font-size: 0.98rem;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.nav-links a {
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.nav-links a:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.nav-actions,
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.lang-btn,
.icon-btn {
  cursor: pointer;
  border: 0;
  color: var(--muted);
  font-weight: 850;
}

.lang-btn {
  min-width: 42px;
  border-radius: 6px;
  background: transparent;
  padding: 8px 10px;
  font-size: 0.84rem;
}

.lang-btn.is-active {
  background: var(--ink);
  color: var(--bg);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
}

.section {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  padding: 96px 0;
}

.hero-copy,
.section-header,
.builder-panel,
.project-card,
.skill-card,
.timeline article,
.quick-facts article,
.contact-card {
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.72fr);
  gap: clamp(32px, 6vw, 76px);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding-top: 72px;
}

.hero-copy,
.section-header,
.achievement-copy,
.contact-section > div:first-child {
  animation: fade-up 0.7s ease both;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  max-width: 790px;
  font-size: clamp(3.8rem, 9vw, 7.6rem);
  font-weight: 950;
}

h2 {
  max-width: 820px;
  font-size: clamp(2rem, 4.3vw, 4rem);
  font-weight: 920;
}

h3 {
  font-size: 1.25rem;
  font-weight: 900;
}

.hero-mantra {
  display: grid;
  gap: 4px;
  margin: 22px 0 20px;
  color: var(--gold);
  font-size: clamp(1.25rem, 2.3vw, 2rem);
  font-weight: 920;
  line-height: 1.18;
}

.hero-lead,
.section-header p,
.contact-section p {
  max-width: 690px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-badges,
.hero-actions,
.tag-row,
.quick-facts,
.project-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-badges {
  margin: 28px 0 0;
}

.hero-badges span,
.tag-row span,
.status {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 0.82rem;
  font-weight: 780;
}

.hero-actions {
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 880;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover,
.text-link:hover,
.contact-card a:hover {
  transform: translateY(-2px);
}

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

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

.btn.ghost {
  color: var(--accent-strong);
}

.quick-facts {
  margin-top: 38px;
}

.quick-facts article {
  flex: 1 1 160px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  padding: 18px;
}

.quick-facts strong {
  display: block;
  color: var(--accent-strong);
  font-size: 1.85rem;
  line-height: 1;
}

.quick-facts span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 720;
}

.hero-visual {
  position: relative;
  align-self: stretch;
  min-height: 620px;
}

.builder-visual {
  display: grid;
  align-items: center;
}

.builder-panel {
  position: sticky;
  top: 104px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--accent-soft) 52%, transparent)),
    var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 34px);
  animation: fade-up 0.75s ease 0.12s both;
}

.builder-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(rgba(94, 107, 100, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 107, 100, 0.11) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.5;
  pointer-events: none;
}

.builder-panel::after {
  position: absolute;
  top: 0;
  right: -45%;
  width: 45%;
  height: 100%;
  content: "";
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  animation: scan-panel 7s ease-in-out infinite;
  pointer-events: none;
}

.panel-topline,
.build-loop,
.code-window,
.signal-grid {
  position: relative;
  z-index: 1;
}

.panel-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.panel-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  animation: pulse-dot 2.8s ease-out infinite;
}

.build-loop {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.loop-step {
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 16px;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.loop-step:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.loop-step span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.loop-step strong {
  display: block;
  margin-top: 18px;
  font-size: 1.08rem;
}

.loop-step.is-active {
  background: var(--ink);
  color: var(--bg);
}

.loop-line {
  display: none;
}

.code-window {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 92%, #000000);
  color: #eaf3ee;
  padding: 18px;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.code-window-bar {
  display: flex;
  gap: 7px;
  margin-bottom: 16px;
}

.code-window-bar span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #f2c96f;
}

.code-window-bar span:nth-child(2) {
  background: #76d5ab;
}

.code-window-bar span:nth-child(3) {
  background: #8bb7ff;
}

.code-window p {
  margin: 9px 0;
  color: #dbe8e2;
  overflow-wrap: anywhere;
}

.code-window span {
  color: #76d5ab;
}

.code-window strong {
  color: #f2c96f;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.signal-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 14px;
}

.signal-grid strong {
  display: block;
  color: var(--accent-strong);
  font-size: 1.35rem;
  line-height: 1;
}

.signal-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.split-section {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: 34px;
  align-items: start;
}

.section-header.centered {
  display: grid;
  justify-items: center;
  text-align: center;
}

.about-grid {
  display: grid;
  gap: 18px;
}

.story-card,
.principle-card,
.project-card,
.skill-card,
.achievement-list article,
.timeline article,
.contact-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.story-card:hover,
.principle-card:hover,
.project-card:hover,
.skill-card:hover,
.achievement-list article:hover,
.timeline article:hover,
.contact-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: var(--shadow);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease var(--reveal-delay, 0ms), transform 0.65s ease var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.large-card {
  padding: clamp(24px, 4vw, 42px);
}

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

.story-card p + p {
  margin-top: 18px;
}

.principle-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.principle-card,
.skill-card,
.timeline article {
  padding: 20px;
}

.principle-card span,
.timeline article > span {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--accent-strong);
  font-weight: 920;
}

.principle-card p,
.skill-card p,
.timeline p,
.project-card p,
.achievement-list p {
  color: var(--muted);
}

.project-group {
  margin-top: 42px;
}

.compact-group {
  margin-top: 28px;
}

.group-label {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(220px, 1fr);
  align-items: baseline;
  gap: 18px;
  margin-bottom: 18px;
}

.group-label span {
  font-size: 1.1rem;
  font-weight: 900;
}

.group-label small {
  justify-self: end;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 680;
  line-height: 1.5;
  text-align: right;
}

.project-grid,
.skills-grid,
.timeline {
  display: grid;
  gap: 18px;
}

.featured-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3vw, 32px);
}

.featured-card {
  min-height: 430px;
}

.project-topline {
  justify-content: space-between;
  margin-bottom: 24px;
}

.project-card h3 + p {
  margin-top: 16px;
}

.project-card p {
  line-height: 1.72;
  font-weight: 520;
}

.status {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status.progress {
  border-color: color-mix(in srgb, var(--gold) 42%, var(--line));
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--gold);
}

.status.muted {
  background: var(--surface-soft);
  color: var(--muted);
}

.project-year {
  color: var(--muted);
  font-weight: 850;
}

.project-details {
  display: grid;
  gap: 20px;
  margin: 30px 0 26px;
}

.project-details div {
  display: grid;
  gap: 8px;
}

.project-details dt {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-details dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 520;
}

.tag-row {
  margin-top: 20px;
  margin-bottom: 26px;
}

.tag-row span {
  padding: 6px 9px;
  font-size: 0.78rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 44px;
  margin-top: auto;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 16px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(11, 122, 90, 0.16);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-link::after {
  content: "->";
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.text-link:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 14px 30px rgba(11, 122, 90, 0.22);
}

.text-link:hover::after {
  transform: translateX(3px);
}

.skills-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 42px;
}

.achievements-section {
  display: grid;
  grid-template-columns: 0.78fr 1fr;
  gap: 34px;
  align-items: center;
}

.achievement-summary {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 72%, transparent), color-mix(in srgb, var(--surface) 92%, transparent)),
    var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 38px);
}

.achievement-summary h3 {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.summary-metrics {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.summary-metrics span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 14px;
  color: var(--accent-strong);
  font-weight: 900;
}

.achievement-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.achievement-list article {
  padding: 18px;
}

.achievement-list span {
  display: block;
  color: var(--ink);
  font-weight: 900;
}

.achievement-list p {
  margin: 8px 0 0;
}

.timeline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 42px;
}

.contact-section {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px);
  gap: 32px;
  align-items: start;
}

.contact-card {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.contact-card a {
  display: flex;
  min-height: 48px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px 14px;
  color: var(--accent-strong);
  font-weight: 850;
  transition: transform 0.2s ease, background 0.2s ease;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-weight: 820;
}

.site-footer a {
  color: var(--accent-strong);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  }
  70% {
    box-shadow: 0 0 0 12px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

@keyframes scan-panel {
  0%,
  45% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-320%);
  }
}

@media (max-width: 1040px) {
  .nav-shell {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow: visible;
  }

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

  .hero {
    min-height: 0;
  }

  .hero-visual {
    min-height: 0;
  }

  .builder-panel {
    position: relative;
    top: auto;
  }

  .build-loop {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .principle-list,
  .skills-grid,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    background: var(--bg);
  }

  .nav-shell,
  .section,
  .site-footer {
    width: min(100% - 24px, var(--max-width));
  }

  .brand-text {
    display: none;
  }

  .nav-actions {
    margin-left: auto;
  }

  .nav-links a {
    padding: 8px 6px;
    text-align: center;
    white-space: normal;
  }

  .nav-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section {
    padding: 72px 0;
  }

  .hero {
    padding-top: 46px;
  }

  h1 {
    font-size: clamp(3.1rem, 17vw, 4.6rem);
  }

  .hero-mantra {
    font-size: 1.22rem;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }

  .builder-panel {
    padding: 20px;
  }

  .build-loop,
  .signal-grid {
    grid-template-columns: 1fr;
  }

  .loop-step {
    min-height: 92px;
  }

  .hero-badges {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-badges span {
    width: 100%;
  }

  .quick-facts {
    display: grid;
    grid-template-columns: 1fr;
  }

  .featured-grid,
  .compact-grid,
  .principle-list,
  .skills-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .group-label {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
  }

  .group-label small {
    justify-self: start;
    text-align: left;
  }

  .featured-card {
    min-height: 0;
  }

  .contact-card a {
    font-size: 0.94rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .lang-switch {
    gap: 4px;
  }

  .lang-btn {
    min-width: 38px;
    padding: 7px 8px;
  }

  .icon-btn {
    min-width: 44px;
    height: 44px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
