:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef5f7;
  --ink: #102033;
  --muted: #66758a;
  --line: #dce6ee;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --warm: #d99a2b;
  --shadow: 0 22px 60px rgba(16, 32, 51, 0.12);
  --radius: 8px;
}

body.dark-theme {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0e1b2d;
  --surface-soft: #12253a;
  --ink: #eef6ff;
  --muted: #a8b8ca;
  --line: #244058;
  --accent: #2dd4bf;
  --accent-2: #60a5fa;
  --warm: #f6c453;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 42%, var(--bg) 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.65;
  transition: background-color 220ms ease, color 220ms ease;
}

body.dark-theme {
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.12), transparent 30%),
    linear-gradient(180deg, #07111f 0%, var(--bg) 100%);
}

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

button,
input,
textarea {
  font: inherit;
}

.icon-sprite {
  display: none;
}

.icon,
.icon-card {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.icon-card {
  width: 34px;
  height: 34px;
  stroke-width: 1.8;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid transparent;
  background: rgba(244, 247, 251, 0.78);
  backdrop-filter: blur(18px);
  transition: box-shadow 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

body.dark-theme .site-header {
  background: rgba(7, 17, 31, 0.78);
}

.site-header.is-scrolled {
  border-color: var(--line);
  box-shadow: 0 12px 34px rgba(16, 32, 51, 0.12);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 900;
  letter-spacing: 0;
}

.brand span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-size: 0.86rem;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.site-nav a {
  padding: 9px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--accent);
  background: rgba(15, 118, 110, 0.1);
  transform: translateY(-1px);
}

.theme-toggle,
.nav-toggle,
.back-to-top {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(16, 32, 51, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.theme-toggle,
.nav-toggle {
  width: 44px;
  height: 44px;
}

.nav-toggle {
  display: none;
}

.theme-toggle:hover,
.nav-toggle:hover,
.back-to-top:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.icon-sun {
  display: none;
}

body.dark-theme .icon-moon {
  display: none;
}

body.dark-theme .icon-sun {
  display: block;
}

.section {
  padding: clamp(78px, 9vw, 118px) clamp(18px, 5vw, 72px);
  scroll-margin-top: 86px;
}

.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.55fr);
  gap: clamp(30px, 6vw, 82px);
  align-items: center;
  padding-top: 120px;
}

.hero__content {
  max-width: 840px;
}

.eyebrow {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  border-radius: 999px;
  background: var(--warm);
}

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

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(3.2rem, 8vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(2.1rem, 4vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.12rem;
  line-height: 1.25;
}

.hero__title {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--accent-2);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 900;
}

.hero__text,
.section__header {
  max-width: 760px;
}

.hero__text {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

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

.button--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.24);
}

.button--secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(16, 32, 51, 0.08);
}

.profile-card {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72)),
    var(--surface);
  box-shadow: var(--shadow);
}

body.dark-theme .profile-card {
  background: linear-gradient(180deg, rgba(14, 27, 45, 0.94), rgba(18, 37, 58, 0.82));
}

.profile-photo {
  display: grid;
  width: min(280px, 100%);
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 7px solid var(--surface);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--warm));
  box-shadow: 0 24px 54px rgba(16, 32, 51, 0.22);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.profile-photo span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #ffffff;
  font-size: 3rem;
  font-weight: 900;
}

.profile-card__body {
  display: grid;
  gap: 4px;
  justify-items: center;
  margin-top: 22px;
  text-align: center;
}

.profile-card__body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-card__body strong {
  font-size: 1.2rem;
}

.profile-card__body span {
  color: var(--muted);
}

.section__header {
  margin-bottom: 34px;
}

.about-grid,
.project-grid,
.service-grid,
.contact-grid {
  display: grid;
  gap: 20px;
}

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

.project-grid,
.service-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.about-card,
.project-card,
.service-card,
.skill,
.contact-info,
.contact-form,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(16, 32, 51, 0.08);
}

.about-card,
.project-card,
.service-card {
  min-width: 0;
  padding: 24px;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.about-card:hover,
.project-card:hover,
.service-card:hover {
  border-color: rgba(15, 118, 110, 0.36);
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.icon-card {
  display: block;
  margin-bottom: 18px;
  color: var(--accent);
}

.about-card p,
.project-card p,
.service-card p,
.timeline-item p {
  margin: 0;
  color: var(--muted);
}

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

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

.skill {
  padding: 18px;
}

.skill > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 900;
}

.skill > span::after {
  content: attr(data-value);
  color: var(--accent);
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(102, 117, 138, 0.18);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--warm));
  transition: width 1100ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tags span {
  padding: 7px 10px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.section--dark {
  background:
    linear-gradient(135deg, #0d1b2f 0%, #0f3b3a 58%, #0b1320 100%);
  color: #ffffff;
}

.section--dark .eyebrow,
.section--dark .timeline-item span {
  color: #7dd3c7;
}

.section--dark .timeline-item {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.section--dark .timeline-item p {
  color: #c9d8e7;
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
  max-width: 900px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 14px;
  width: 2px;
  background: rgba(125, 211, 199, 0.5);
}

.timeline-item {
  position: relative;
  padding: 22px 22px 22px 54px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 6px;
  width: 18px;
  height: 18px;
  border: 4px solid #7dd3c7;
  border-radius: 50%;
  background: #0d1b2f;
}

.timeline-item span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-grid {
  grid-template-columns: minmax(0, 0.85fr) minmax(300px, 1.15fr);
  align-items: start;
}

.contact-info,
.contact-form {
  padding: 24px;
}

.contact-info {
  display: grid;
  gap: 14px;
  font-style: normal;
}

.contact-info a,
.contact-info > span {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-weight: 800;
}

.contact-info .icon {
  color: var(--accent);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.socials a {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 900;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.socials a:hover {
  border-color: var(--accent);
  background: rgba(15, 118, 110, 0.1);
  transform: translateY(-2px);
}

.contact-form {
  display: grid;
  gap: 12px;
}

.contact-form label {
  color: var(--ink);
  font-weight: 900;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.contact-form textarea {
  min-height: 138px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--accent);
  font-weight: 800;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  width: 48px;
  height: 48px;
  opacity: 0;
  pointer-events: none;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 24px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.footer p {
  margin: 0;
  font-weight: 900;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 700ms ease, transform 700ms ease;
}

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

@media (max-width: 1100px) {
  .project-grid,
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .nav-toggle {
    display: inline-grid;
    justify-self: end;
  }

  .theme-toggle {
    justify-self: end;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 18px;
    right: 18px;
    display: none;
    flex-direction: column;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
  }

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

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

@media (max-width: 680px) {
  .section {
    padding-inline: 16px;
  }

  .hero {
    padding-top: 112px;
  }

  .hero__actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

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

  .footer {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
