:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-strong: #ffffff;
  --text: #111317;
  --muted: #5f6671;
  --soft: #eef0f4;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --line: rgba(17, 19, 23, 0.12);
  --shadow: 0 24px 70px rgba(22, 27, 34, 0.14);
  --shadow-soft: 0 16px 44px rgba(22, 27, 34, 0.1);
  --accent-blue: #0a84ff;
  --accent-green: #30d158;
  --accent-amber: #ff9f0a;
  --accent-red: #ff453a;
  --ink: #05070a;
  --white: #ffffff;
  --radius: 8px;
  --max: 1180px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090b0e;
  --bg-strong: #101318;
  --text: #f7f8fa;
  --muted: #a8b0bd;
  --soft: #171b22;
  --panel: rgba(19, 23, 29, 0.78);
  --panel-solid: #11151b;
  --line: rgba(247, 248, 250, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 16px 44px rgba(0, 0, 0, 0.32);
  --ink: #05070a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(238, 240, 244, 0.88) 42%, rgba(255, 255, 255, 0.92)),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  letter-spacing: 0;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

html[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(13, 16, 21, 0.92), rgba(9, 11, 14, 0.96) 46%, rgba(16, 19, 24, 0.96)),
    var(--bg);
}

body.no-scroll {
  overflow: hidden;
}

img,
svg {
  display: block;
}

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

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

button {
  font: inherit;
}

svg {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
}

svg path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.quick-dock a:nth-child(3) svg path,
.quick-dock a:nth-child(4) svg path {
  fill: currentColor;
  stroke: none;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  transform: translateY(-140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  color: var(--text);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease;
}

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

.site-header {
  position: fixed;
  top: 0.85rem;
  left: 50%;
  z-index: 50;
  display: grid;
  width: min(calc(100vw - 2rem), var(--max));
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(245, 247, 250, 0.68);
  box-shadow: 0 12px 36px rgba(5, 7, 10, 0.1);
  padding: 0.55rem;
  backdrop-filter: blur(22px) saturate(150%);
}

html[data-theme="dark"] .site-header {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(10, 12, 16, 0.68);
}

.site-header.is-scrolled {
  box-shadow: 0 16px 42px rgba(5, 7, 10, 0.16);
}

.brand,
.primary-nav,
.header-actions,
.hero-actions,
.quick-dock,
.filter-wrap,
.contact-actions,
.text-link {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.65rem;
  min-width: 0;
  padding-right: 0.25rem;
}

.brand-mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg-strong);
  font-size: 0.8rem;
  font-weight: 800;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
}

html[data-theme="dark"] .brand-mark {
  background: #ffffff;
  color: #090b0e;
}

.brand-text {
  font-size: 0.95rem;
  font-weight: 750;
  white-space: nowrap;
}

.primary-nav {
  justify-content: center;
  gap: 0.25rem;
  min-width: 0;
}

.primary-nav a {
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  padding: 0.65rem 0.78rem;
  transition: background 180ms ease, color 180ms ease;
  white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a.is-active {
  background: rgba(10, 132, 255, 0.12);
  color: var(--text);
}

.header-actions {
  gap: 0.4rem;
  justify-content: flex-end;
}

.icon-button,
.quick-dock a {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .quick-dock a {
  background: rgba(255, 255, 255, 0.08);
}

.icon-button:hover,
.quick-dock a:hover {
  transform: translateY(-2px);
  border-color: rgba(10, 132, 255, 0.45);
}

.hero {
  position: relative;
  display: grid;
  min-height: min(860px, 86svh);
  align-items: center;
  overflow: hidden;
  padding: 7rem 1.25rem 5rem;
  isolation: isolate;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(3, 5, 7, 0.84) 0%, rgba(3, 5, 7, 0.58) 39%, rgba(3, 5, 7, 0.16) 69%, rgba(3, 5, 7, 0.34) 100%),
    linear-gradient(180deg, rgba(3, 5, 7, 0.42), rgba(3, 5, 7, 0.08) 45%, rgba(3, 5, 7, 0.46));
}

.hero::after {
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 14rem;
  background: linear-gradient(180deg, rgba(245, 245, 247, 0), var(--bg));
  content: "";
}

.hero-content {
  width: min(calc(100vw - 2.5rem), var(--max));
  margin: 0 auto;
  color: var(--white);
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.8rem;
  color: var(--accent-blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.86);
}

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

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

h1 {
  max-width: 13ch;
  margin-bottom: 1.25rem;
  font-size: 5.4rem;
  font-weight: 850;
}

h2 {
  margin-bottom: 1rem;
  font-size: 3.1rem;
  font-weight: 820;
}

h3 {
  margin-bottom: 0.8rem;
  font-size: 1.35rem;
  font-weight: 780;
}

.hero-lead {
  max-width: 44rem;
  margin-bottom: 1.8rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.22rem;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.2rem;
}

.button {
  min-height: 3rem;
  justify-content: center;
  gap: 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.82rem 1.05rem;
  font-weight: 780;
  line-height: 1.15;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--white);
  color: #05070a;
}

.button-secondary {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.11);
  color: var(--white);
  backdrop-filter: blur(18px);
}

.section .button-secondary,
.contact-card .button-secondary {
  border-color: var(--line);
  background: var(--panel-solid);
  color: var(--text);
}

.hero-metrics {
  display: grid;
  max-width: 45rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
}

.hero-metrics div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.85rem;
  backdrop-filter: blur(18px);
}

.hero-metrics dt {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 850;
}

.hero-metrics dd {
  margin: 0.15rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
}

.quick-dock {
  position: absolute;
  right: 50%;
  bottom: 1.15rem;
  z-index: 2;
  gap: 0.55rem;
  transform: translateX(50%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.16);
  padding: 0.45rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(24px) saturate(160%);
}

.quick-dock a {
  background: rgba(255, 255, 255, 0.76);
  color: #05070a;
}

.section {
  padding: 6rem 1.25rem;
}

.profile-section {
  padding-top: 3.5rem;
}

.section-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.section-copy p,
.section-heading p,
.contact-card p {
  color: var(--muted);
  font-size: 1.05rem;
}

.profile-grid,
.education-layout,
.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.85fr);
  gap: 2rem;
  align-items: center;
}

.desktop-window,
.project-card,
.skill-panel,
.timeline-item,
.cert-board,
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(140%);
}

.desktop-window {
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.6rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.38);
  padding: 0 0.85rem;
}

html[data-theme="dark"] .window-bar {
  background: rgba(255, 255, 255, 0.06);
}

.traffic {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
}

.traffic-red {
  background: var(--accent-red);
}

.traffic-yellow {
  background: var(--accent-amber);
}

.traffic-green {
  background: var(--accent-green);
}

.window-title {
  margin-left: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.window-body {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem;
}

.status-row {
  display: grid;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.85rem;
}

.status-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-transform: uppercase;
}

.status-row strong {
  font-size: 1rem;
}

.status-pill {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(48, 209, 88, 0.36);
  border-radius: var(--radius);
  background: rgba(48, 209, 88, 0.13);
  color: #126327;
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 800;
}

html[data-theme="dark"] .status-pill {
  color: #8ff3a8;
}

.work-section,
.education-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(238, 240, 244, 0.7) 18%, rgba(255, 255, 255, 0) 100%),
    transparent;
}

html[data-theme="dark"] .work-section,
html[data-theme="dark"] .education-section {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(20, 24, 30, 0.72) 18%, rgba(0, 0, 0, 0) 100%),
    transparent;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section-heading.compact {
  align-items: center;
}

.section-heading h2,
.section-copy h2,
.contact-card h2,
.cert-board h2 {
  max-width: 16ch;
}

.filter-wrap {
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.3rem;
}

.filter-button {
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 780;
  padding: 0.6rem 0.75rem;
  transition: background 180ms ease, color 180ms ease;
}

.filter-button.is-active {
  background: var(--text);
  color: var(--bg-strong);
}

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

.project-card {
  position: relative;
  display: flex;
  min-height: 24rem;
  flex-direction: column;
  overflow: hidden;
  padding: 1.25rem;
  transition: opacity 220ms ease, transform 220ms ease, border-color 180ms ease;
}

.project-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 132, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 159, 10, 0.12), transparent 32%);
  content: "";
  opacity: 0;
  transition: opacity 180ms ease;
}

.project-card:hover {
  border-color: rgba(10, 132, 255, 0.4);
  transform: translateY(-4px);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card.is-hidden {
  display: none;
}

.card-topline,
.tag-row,
.cert-list,
.contact-list {
  display: flex;
  flex-wrap: wrap;
}

.card-topline {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.project-type,
.project-year,
.tag-row span,
.cert-list span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  padding: 0.42rem 0.55rem;
}

html[data-theme="dark"] .project-type,
html[data-theme="dark"] .project-year,
html[data-theme="dark"] .tag-row span,
html[data-theme="dark"] .cert-list span {
  background: rgba(255, 255, 255, 0.07);
}

.project-card h3,
.project-card p,
.project-card ul,
.tag-row {
  position: relative;
  z-index: 1;
}

.project-card p {
  color: var(--muted);
  font-size: 1rem;
}

.project-points {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding-left: 1.1rem;
  color: var(--text);
}

.project-points li::marker {
  color: var(--accent-blue);
}

.tag-row {
  gap: 0.45rem;
  margin-top: auto;
}

.skills-section {
  background: var(--ink);
  color: var(--white);
}

.skills-section .section-kicker {
  color: var(--accent-green);
}

.skills-section .section-heading p,
.skills-section .skill-panel p,
.skills-section .text-link {
  color: rgba(255, 255, 255, 0.7);
}

.skills-section .section-heading h2 {
  color: var(--white);
}

.text-link {
  gap: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease;
}

.text-link:hover {
  transform: translateY(-2px);
  border-color: rgba(48, 209, 88, 0.46);
}

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

.skill-panel {
  min-height: 11rem;
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
  padding: 1.15rem;
}

.skill-panel h3 {
  margin-bottom: 0.65rem;
  font-size: 1.08rem;
}

.skill-panel p {
  margin-bottom: 0;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0.8rem;
}

.timeline-item {
  padding: 1rem;
}

.timeline-date {
  display: inline-flex;
  margin-bottom: 0.55rem;
  border-radius: var(--radius);
  background: rgba(10, 132, 255, 0.12);
  color: var(--accent-blue);
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 850;
}

.timeline-item h3 {
  margin-bottom: 0.45rem;
  font-size: 1.1rem;
}

.timeline-item p {
  margin-bottom: 0;
  color: var(--muted);
}

.cert-board {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  padding: 1.35rem;
}

.cert-list {
  align-content: start;
  gap: 0.55rem;
}

.cert-list span {
  color: var(--text);
}

.contact-card {
  padding: 1.5rem;
}

.contact-card h2 {
  max-width: 15ch;
}

.contact-actions {
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.contact-card .button-primary {
  background: var(--text);
  color: var(--bg-strong);
}

.contact-list {
  grid-column: 1 / -1;
  gap: 0.65rem;
  font-style: normal;
}

.contact-list a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  padding: 0.58rem 0.7rem;
  font-size: 0.92rem;
  font-weight: 720;
}

html[data-theme="dark"] .contact-list a {
  background: rgba(255, 255, 255, 0.07);
}

.site-footer {
  display: flex;
  width: min(calc(100vw - 2rem), var(--max));
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 1.4rem 0 2rem;
  font-size: 0.92rem;
}

.site-footer a {
  font-weight: 800;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

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

.hero [data-reveal] {
  opacity: 1;
  transform: none;
}

.profile-section [data-reveal] {
  opacity: 1;
  transform: none;
}

@media (max-width: 980px) {
  .site-header {
    display: flex;
    flex-wrap: wrap;
    width: min(calc(100vw - 1rem), var(--max));
  }

  .brand {
    order: 1;
  }

  .header-actions {
    order: 2;
    width: auto;
    margin-left: auto;
  }

  .primary-nav {
    order: 3;
    flex: 1 0 100%;
    justify-content: start;
    overflow-x: auto;
    padding-top: 0.2rem;
    scrollbar-width: none;
  }

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

  h1 {
    font-size: 4.2rem;
  }

  h2 {
    font-size: 2.4rem;
  }

  .profile-grid,
  .education-layout,
  .cert-board,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .project-grid,
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .contact-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .site-header {
    top: 0.5rem;
  }

  .brand-text {
    display: inline;
  }

  .header-actions {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 8.5rem 1rem 1.75rem;
  }

  .hero-image {
    object-position: 58% center;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(3, 5, 7, 0.88), rgba(3, 5, 7, 0.58)),
      linear-gradient(180deg, rgba(3, 5, 7, 0.34), rgba(3, 5, 7, 0.72));
  }

  h1 {
    max-width: 10ch;
    font-size: 3.2rem;
  }

  h2 {
    font-size: 2rem;
  }

  .hero-lead {
    max-width: 20.5rem;
    font-size: 1.03rem;
  }

  .hero-actions .button,
  .contact-actions .button {
    width: min(100%, 20.5rem);
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    max-width: 20.5rem;
  }

  .quick-dock {
    position: relative;
    right: auto;
    bottom: auto;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin: 1.5rem auto 0;
    transform: none;
  }

  .section {
    padding: 4.2rem 1rem;
  }

  .profile-section {
    padding-top: 2.75rem;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .filter-wrap {
    width: 100%;
    overflow-x: auto;
  }

  .filter-button {
    flex: 1 0 auto;
  }

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

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

@media (max-width: 430px) {
  .site-header {
    padding: 0.45rem;
  }

  .primary-nav a {
    padding: 0.58rem 0.65rem;
  }

  h1 {
    font-size: 2.7rem;
  }

  .quick-dock {
    width: 100%;
  }

  .quick-dock a {
    flex: 1 1 0;
  }

  .desktop-window,
  .project-card,
  .skill-panel,
  .timeline-item,
  .cert-board,
  .contact-card {
    box-shadow: none;
  }
}

@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;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
