:root {
  color-scheme: light;
  --bg: #f7f9f4;
  --surface: #ffffff;
  --surface-strong: #eef4ed;
  --ink: #17211d;
  --muted: #5d6962;
  --line: #d8e2d9;
  --accent: #0f7a50;
  --accent-strong: #075c3b;
  --accent-soft: #dff1e6;
  --blue: #315f7d;
  --warm: #9a5a22;
  --gold: #e2b84b;
  --shadow: 0 18px 42px rgba(23, 33, 29, 0.11);
  --radius: 8px;
  --max: 1180px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101511;
  --surface: #171f1a;
  --surface-strong: #1f2a22;
  --ink: #f2f7ef;
  --muted: #b8c4bb;
  --line: #314037;
  --accent: #62c991;
  --accent-strong: #8ee0af;
  --accent-soft: #173522;
  --blue: #87b6d4;
  --warm: #d09a5f;
  --gold: #e6c567;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(49, 95, 125, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 95, 125, 0.08) 1px, transparent 1px),
    var(--bg);
  background-size: 40px 40px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(247, 249, 244, 0.94), var(--bg));
  content: "";
}

:root[data-theme="dark"] body::before {
  background: linear-gradient(180deg, rgba(16, 21, 17, 0.94), var(--bg));
}

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

h1,
h2,
h3,
p,
a,
strong {
  overflow-wrap: break-word;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}

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

.brand,
.nav-actions,
.nav-links,
.hero-actions,
.card-actions,
.filter-bar {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  flex: 0 0 auto;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.78rem;
  font-weight: 900;
}

.nav-actions {
  gap: 12px;
  min-width: 0;
}

.nav-links {
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a,
.theme-toggle,
.filter-button,
.button {
  min-height: 42px;
  border-radius: var(--radius);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.nav-links a {
  flex: 0 0 auto;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--surface-strong);
  color: var(--ink);
}

.theme-toggle,
.filter-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.theme-toggle {
  flex: 0 0 auto;
  padding: 0 12px;
}

.theme-toggle:hover,
.filter-button:hover {
  border-color: var(--accent);
}

.hero,
.section,
.site-footer {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

.hero {
  position: relative;
  display: grid;
  align-content: center;
  grid-template-columns: minmax(0, 0.98fr) minmax(320px, 0.72fr);
  gap: 32px;
  min-height: 74vh;
  padding: 90px 0 42px;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
  align-self: center;
  max-width: 760px;
}

.hero-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-self: center;
  justify-self: end;
  width: 100%;
}

.hero-media img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  object-position: top;
  box-shadow: 0 14px 34px rgba(23, 33, 29, 0.12);
}

.mosaic-large {
  grid-column: 1 / -1;
  height: 230px;
}

.mosaic-small {
  height: 170px;
}

.mosaic-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  box-shadow: 0 14px 34px rgba(23, 33, 29, 0.12);
}

.mosaic-card span {
  color: var(--accent-strong);
  font-weight: 900;
}

.mosaic-card strong {
  color: var(--ink);
  font-size: 1.65rem;
  line-height: 1.1;
}

.mosaic-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 900;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 10px;
  font-size: 4.6rem;
  line-height: 0.95;
}

h2 {
  margin-bottom: 14px;
  font-size: 2.35rem;
  line-height: 1.08;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.28rem;
  line-height: 1.2;
}

.hero-subtitle {
  max-width: 760px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 800;
}

.hero-copy,
.section-heading p,
.about-copy p,
.project-card p,
.timeline p,
.skills-grid p {
  color: var(--muted);
}

.hero-copy {
  max-width: 700px;
  margin-bottom: 28px;
  font-size: 1.08rem;
}

.hero-actions,
.card-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 15px;
  box-shadow: 0 1px 0 rgba(23, 33, 29, 0.05);
  font-weight: 850;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(23, 33, 29, 0.1);
}

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

.hero-proof {
  grid-column: 1 / -1;
  display: grid;
  align-self: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 0;
}

.hero-proof div,
.skills-grid article,
.timeline article,
.contact-link {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 12px 30px rgba(23, 33, 29, 0.06);
}

.hero-proof div {
  padding: 16px;
}

.hero-proof dt {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 900;
}

.hero-proof dd {
  margin: 2px 0 0;
  color: var(--muted);
}

.section {
  padding: 76px 0 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 26px;
}

.project-section {
  padding-top: 42px;
}

.filter-bar {
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-button {
  padding: 0 14px;
}

.filter-button.active {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-card:hover,
.project-card:focus-within {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
}

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

.project-card.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 20px;
  margin-bottom: 18px;
  padding: 22px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, var(--accent-soft)), var(--surface)),
    var(--surface);
}

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

.project-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.featured .project-copy {
  padding: 0;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius);
  background: var(--accent-strong);
  color: #ffffff;
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.secondary {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--ink);
}

.project-subtitle {
  color: var(--ink);
  font-size: 1.14rem;
  font-weight: 850;
}

.highlight-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--muted);
}

.technical-note {
  margin-top: auto;
  padding-top: 4px;
  font-size: 0.95rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0;
}

.tag-list span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  padding: 5px 8px;
  font-size: 0.82rem;
  font-weight: 800;
}

.project-image {
  width: 100%;
  height: 190px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  object-fit: cover;
  object-position: top;
}

.tabshare-preview,
.code-preview,
.app-preview,
.clock-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.tabshare-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-height: 360px;
  padding: 22px;
}

.preview-header,
.preview-grid,
.settlement-row,
.mini-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preview-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.preview-header span,
.preview-grid span,
.settlement-row span,
.code-preview span,
.clock-preview p {
  color: var(--muted);
}

.preview-header strong {
  color: var(--accent-strong);
  font-size: 1.65rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.settlement-line {
  flex: 1;
  height: 8px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.settlement-line.short {
  flex: 0.65;
  background: linear-gradient(90deg, var(--warm), var(--gold));
}

.code-preview,
.app-preview,
.clock-preview {
  min-height: 190px;
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 22px;
}

.code-preview {
  display: grid;
  align-content: end;
  background: #14201a;
  color: #eef8ee;
}

.code-preview strong {
  font-size: 1.7rem;
}

.app-preview {
  display: grid;
  align-content: center;
  gap: 12px;
}

.mini-toolbar span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 7px 10px;
  font-weight: 850;
}

.workout-line {
  height: 13px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--blue) 44%, var(--surface));
}

.workout-line.done {
  background: var(--accent);
}

.workout-line.short {
  width: 62%;
  background: var(--warm);
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: var(--radius);
  background: var(--surface);
}

.progress-track span {
  display: block;
  width: 72%;
  height: 100%;
  background: var(--gold);
}

.clock-preview {
  display: grid;
  place-items: center;
  text-align: center;
  background:
    linear-gradient(rgba(20, 32, 26, 0.68), rgba(20, 32, 26, 0.68)),
    url("https://images.unsplash.com/photo-1519682337058-a94d519337bc?auto=format&fit=crop&w=900&q=70");
  background-position: center;
  background-size: cover;
  color: #ffffff;
}

.clock-preview span {
  font-size: 2.5rem;
  font-weight: 900;
}

.clock-preview p {
  max-width: 320px;
  color: rgba(255, 255, 255, 0.86);
}

.supporting {
  box-shadow: none;
}

.skills-grid,
.timeline,
.contact-grid {
  display: grid;
  gap: 16px;
}

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

.skills-grid article,
.timeline article {
  padding: 20px;
}

.skills-grid h3,
.timeline h3 {
  color: var(--ink);
}

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

.timeline {
  position: relative;
}

.timeline article {
  background: var(--surface);
}

.timeline-date {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-weight: 900;
}

.timeline ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.55fr);
  gap: 28px;
  align-items: center;
}

.about-copy {
  max-width: 760px;
}

.about-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-stack span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 9px 11px;
  box-shadow: 0 8px 18px rgba(23, 33, 29, 0.06);
  font-weight: 850;
}

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

.contact-link {
  padding: 20px;
}

.contact-link span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 800;
}

.contact-link strong {
  overflow-wrap: anywhere;
}

.contact-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 48px 0 34px;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

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

@media (max-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    padding-top: 64px;
  }

  .hero-media {
    justify-self: start;
    max-width: 560px;
  }

  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .project-card.featured,
  .split-section,
  .about-section {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .nav-shell {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    width: min(100% - 24px, var(--max));
  }

  .nav-actions {
    align-items: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }

  .nav-links {
    flex: 1;
    flex-wrap: wrap;
    overflow: visible;
  }

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

  .hero {
    padding-top: 42px;
  }

  h1 {
    font-size: 2.55rem;
  }

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

  .hero-proof,
  .project-grid,
  .skills-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .project-card.featured {
    padding: 16px;
  }

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

  .mosaic-large,
  .mosaic-small {
    height: 180px;
  }

  .tabshare-preview {
    min-height: 280px;
  }

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

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

@media print {
  .site-header,
  .filter-bar,
  .theme-toggle,
  .site-footer {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .section,
  .hero {
    width: 100%;
    padding: 24px 0;
  }

  .project-card,
  .skills-grid article,
  .timeline article,
  .contact-link {
    box-shadow: none;
    break-inside: avoid;
  }
}
