:root{
  --bg: #f4f1ec;
  --bg-alt: #e9eef0;
  --surface: #fffaf3;
  --surface-strong: #ffffff;
  --text: #15171a;
  --muted: #626a73;
  --border: rgba(21, 23, 26, 0.12);
  --accent: #d94f2b;
  --accent-dark: #9f341f;
  --accent-soft: rgba(217, 79, 43, 0.12);
  --accent-two: #127c76;
  --accent-two-soft: rgba(18, 124, 118, 0.12);
  --shadow: 0 24px 70px rgba(21, 23, 26, 0.12);
  --radius: 8px;
}

body.dark-theme{
  --bg: #101114;
  --bg-alt: #171a1f;
  --surface: #18191d;
  --surface-strong: #202126;
  --text: #f6f3ee;
  --muted: #b8bec6;
  --border: rgba(246, 243, 238, 0.13);
  --accent: #ff7a57;
  --accent-dark: #ffb09a;
  --accent-soft: rgba(255, 122, 87, 0.15);
  --accent-two: #40c9bd;
  --accent-two-soft: rgba(64, 201, 189, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

*{
  box-sizing: border-box;
}

html{
  scroll-behavior: smooth;
}

body{
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(21, 23, 26, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 23, 26, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  background-size: 64px 64px, 64px 64px, auto;
  line-height: 1.6;
  animation: pageFade 0.45s ease;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-theme{
  background:
    linear-gradient(90deg, rgba(246, 243, 238, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(246, 243, 238, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  background-size: 64px 64px, 64px 64px, auto;
}

a{
  color: inherit;
}

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

.container{
  width: min(1160px, calc(100% - 44px));
  margin: 0 auto;
}

.main-header{
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 0;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.logo::before{
  content: "";
  width: 11px;
  height: 11px;
  background: var(--accent);
  box-shadow: 7px 7px 0 var(--accent-two);
}

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

.nav-links a{
  text-decoration: none;
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 700;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

.theme-toggle{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 9px 14px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.theme-toggle:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(21, 23, 26, 0.1);
}

.hero-section{
  padding: 56px 0 44px;
}

.content-wrapper{
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.82fr);
  gap: 48px;
  align-items: center;
}

.text-content h1{
  margin: 18px 0;
  max-width: 14ch;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.7rem, 5.8vw, 4.85rem);
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--text);
}

.eyebrow,
.section-tag,
.card-label{
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow::before,
.section-tag::before{
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-two);
}

.intro-text{
  max-width: 680px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 600;
}

.supporting-text,
.section-heading p,
.card-content p,
.skill-description,
.contact-form label{
  color: var(--muted);
}

.supporting-text{
  max-width: 680px;
  margin-top: 12px;
}

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

.primary-btn,
.secondary-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  min-width: 148px;
  padding: 13px 18px;
  border-radius: 999px;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
}

.primary-btn{
  border: none;
  color: var(--surface);
  background: var(--text);
  box-shadow: 0 16px 34px rgba(21, 23, 26, 0.18);
}

.primary-btn:hover{
  transform: translateY(-3px);
  background: var(--accent);
  box-shadow: 0 18px 38px rgba(217, 79, 43, 0.24);
}

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

.secondary-btn:hover{
  transform: translateY(-3px);
  background: var(--surface-strong);
  box-shadow: 0 16px 30px rgba(21, 23, 26, 0.1);
}

.quick-stats{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  width: min(620px, 100%);
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}

.quick-stats div{
  padding: 18px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.quick-stats strong{
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  color: var(--accent-dark);
  line-height: 1;
}

.quick-stats span{
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.stack-row{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.stack-row span{
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-two-soft);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.image-content{
  position: relative;
  min-height: 520px;
}

.image-frame{
  position: absolute;
  inset: 0 0 0 34px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.image-frame::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(21, 23, 26, 0.32));
}

.image-content img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 72%;
  filter: saturate(0.98) contrast(1.02);
  transition: transform 0.5s ease;
}

.image-frame:hover img{
  transform: scale(1.035);
}

.status-card{
  position: absolute;
  top: 18px;
  right: 18px;
  left: auto;
  bottom: auto;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(300px, calc(100% - 36px));
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  box-shadow: 0 18px 44px rgba(21, 23, 26, 0.16);
  backdrop-filter: blur(16px);
  font-weight: 800;
}

.status-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-two);
  box-shadow: 0 0 0 6px var(--accent-two-soft);
}

.main-section{
  padding: 72px 0;
}

.section-shell{
  display: grid;
  gap: 28px;
}

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

.section-heading h2{
  margin: 12px 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

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

.skill{
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
  box-shadow: 0 12px 34px rgba(21, 23, 26, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.skill:hover{
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 22px 42px rgba(21, 23, 26, 0.1);
}

.skill-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 48px;
}

.skill-top p,
.skill-top span{
  margin: 0;
  font-weight: 800;
}

.skill-top p{
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.skill-top i{
  color: var(--accent);
  font-size: 1.25rem;
}

.skill-bar{
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 16%, transparent);
  overflow: hidden;
}

.skill-fill{
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-two));
  transform-origin: left;
  animation: growBar 1s ease both;
}

.skill-fill.html{
  width: 70%;
}

.skill-fill.css{
  width: 60%;
}

.skill-fill.js{
  width: 50%;
}

.skill-description{
  display: block;
  margin-top: 14px;
  font-size: 0.94rem;
}

.project-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-btn{
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 8px 14px;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.filter-btn:hover,
.filter-btn.active{
  transform: translateY(-2px);
  background: var(--text);
  color: var(--surface);
}

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

.card{
  display: flex;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 12px 34px rgba(21, 23, 26, 0.08);
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

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

.card:hover{
  transform: translateY(-7px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 24px 54px rgba(21, 23, 26, 0.14);
}

.card img{
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: transform 0.4s ease;
}

.card:hover img{
  transform: scale(1.035);
}

.card-content{
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.card-content h3{
  margin: 14px 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  line-height: 1.1;
}

.card-content p{
  margin: 0;
  font-size: 0.95rem;
}

.card-footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 22px;
}

.card-footer span{
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.project-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  text-decoration: none;
  transition: transform 0.22s ease, background-color 0.22s ease;
}

.project-link:hover{
  transform: translateY(-3px);
  background: var(--accent);
}

.contact-shell{
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  gap: 38px;
  align-items: start;
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  box-shadow: var(--shadow);
}

.contact-copy{
  margin: 0;
}

.contact-links{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.contact-links a{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.contact-links a:hover{
  transform: translateY(-3px);
  background: var(--accent-soft);
}

.contact-links i{
  color: var(--accent);
}

.contact-form{
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.contact-form label{
  display: grid;
  gap: 8px;
  font-weight: 800;
}

input,
textarea{
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder{
  color: color-mix(in srgb, var(--muted) 82%, transparent);
}

input:focus,
textarea:focus{
  border-color: var(--accent-two);
  box-shadow: 0 0 0 4px var(--accent-two-soft);
}

textarea{
  min-height: 155px;
  resize: vertical;
}

footer{
  padding: 0 0 34px;
}

footer p{
  width: min(1160px, calc(100% - 44px));
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.back-to-top{
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(21, 23, 26, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
  z-index: 30;
}

.back-to-top:hover{
  background: var(--accent);
}

.back-to-top.show{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

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

.reveal.show{
  opacity: 1;
  transform: translateY(0);
}

.hero-section .reveal{
  opacity: 1;
  transform: none;
}

@keyframes pageFade{
  from{
    opacity: 0;
  }

  to{
    opacity: 1;
  }
}

@keyframes growBar{
  from{
    transform: scaleX(0);
  }

  to{
    transform: scaleX(1);
  }
}

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

@media (max-width: 980px){
  .content-wrapper,
  .contact-shell{
    grid-template-columns: 1fr;
  }

  .text-content h1{
    max-width: 12ch;
  }

  .image-content{
    min-height: 620px;
  }

  .image-frame{
    inset: 0;
  }

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

@media (max-width: 760px){
  .container{
    width: min(100% - 28px, 1160px);
  }

  .nav{
    align-items: stretch;
    flex-wrap: wrap;
  }

  .logo{
    flex: 1;
  }

  .nav-links{
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .theme-toggle span{
    display: none;
  }

  .hero-section{
    padding: 46px 0 34px;
  }

  .main-section{
    padding: 54px 0;
  }

  .quick-stats,
  .skills-grid,
  .cards{
    grid-template-columns: 1fr;
  }

  .image-content{
    min-height: 500px;
  }

  .contact-shell{
    padding: 24px;
  }
}

@media (max-width: 520px){
  .text-content h1{
    font-size: clamp(2.8rem, 18vw, 4.3rem);
  }

  .hero-actions,
  .contact-form .primary-btn{
    width: 100%;
  }

  .primary-btn,
  .secondary-btn{
    width: 100%;
  }

  .image-content{
    min-height: 410px;
  }

  .status-card{
    top: 14px;
    right: 14px;
    width: calc(100% - 28px);
  }

  .contact-form{
    padding: 18px;
  }
}
