/* 1. DESIGN SYSTEM */
:root {
  --bg: #ffffff;
  --surface: #f6f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #657087;
  --primary: #6254e8;
  --primary-hover: #4c3ed0;
  --border: #e4e7ef;
  --shadow: 0 14px 40px rgba(25, 35, 70, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.25s, color 0.25s;
}

body.dark {
  --bg: #111522;
  --surface: #191f30;
  --card: #20273a;
  --text: #f1f3fb;
  --muted: #b2bad0;
  --primary: #a49aff;
  --primary-hover: #b9b1ff;
  --border: #353d52;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

button {
  cursor: pointer;
}

.container {
  width: min(1120px, 90%);
  margin-inline: auto;
}

section[id] {
  scroll-margin-top: 90px;
}

/* 2. NAVIGATION */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.navbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-size: 1.8rem;
  font-weight: 850;
  letter-spacing: -1px;
}

.logo span,
.hero h1 span,
.section-title span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links > a {
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links > a:hover {
  color: var(--primary);
}

.menu-toggle,
.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  min-width: 42px;
  min-height: 42px;
}

.menu-toggle {
  display: none;
  font-size: 1.3rem;
}

.theme-toggle {
  font-size: 1.3rem;
}

/* 3. BUTTONS */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.94rem;
  transition: transform 0.2s, background 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

body.dark .btn-primary {
  color: #17142a;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  border-color: var(--border);
  background: var(--card);
  color: var(--text);
}

/* 4. HERO SECTION */
.hero {
  min-height: 620px;
  padding-block: 90px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 65px;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.12;
  letter-spacing: -2px;
  margin-bottom: 18px;
}

.hero h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  line-height: 1.4;
  margin-bottom: 18px;
}

.hero-description,
.section-intro {
  max-width: 600px;
  color: var(--muted);
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.availability {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 25px;
  font-size: 0.88rem;
  color: var(--muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  background: #22b879;
  border-radius: 50%;
}

.hero-visual {
  position: relative;
  padding: 30px 0;
}

.visual-card {
  background: #191d30;
  color: #f3f3ff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(1deg);
}

.visual-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 18px;
  background: #252a40;
}

.visual-top > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fa7777;
}

.visual-top > span:nth-child(2) {
  background: #f5c65e;
}

.visual-top > span:nth-child(3) {
  background: #55d6a3;
}

.visual-top small {
  margin-left: 12px;
  color: #c0c5d8;
}

.code-art {
  padding: 28px;
  font: 0.88rem/2 monospace;
  overflow-wrap: anywhere;
}

.indent {
  padding-left: 18px;
}

.code-purple {
  color: #b9a4ff;
}

.code-green {
  color: #8ee4b3;
}

.code-comment {
  margin-top: 14px;
  color: #8d97b4;
}

.floating-tag {
  position: absolute;
  padding: 10px 15px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 700;
}

.tag-one {
  top: 8px;
  right: -15px;
}

.tag-two {
  bottom: 8px;
  left: -25px;
}

/* 5. SHARED SECTIONS */
.section {
  padding-block: 90px;
}

.section-soft {
  background: var(--surface);
  padding-block: 90px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 18px;
}

.section-intro {
  margin-bottom: 32px;
}

/* 6. ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 55px;
  align-items: start;
}

.about-grid h3 {
  font-size: 1.45rem;
  margin-bottom: 14px;
}

.about-grid p {
  color: var(--muted);
  margin-bottom: 15px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.stat-card {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-card strong {
  display: block;
  font-size: 1.65rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-card span {
  font-size: 0.87rem;
  color: var(--muted);
}

/* 7. SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.skill-card {
  padding: 24px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.2s, box-shadow 0.2s;
}

.skill-card:hover,
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.skill-icon {
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.skill-card h3 {
  margin-bottom: 8px;
}

.skill-card p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.skill-label {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
}

/* 8. PROJECTS */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.filter-btn {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 0.87rem;
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

body.dark .filter-btn.active {
  color: #17142a;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: start;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card[hidden] {
  display: none;
}

.project-art {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 12px;
  font-size: 2.5rem;
}

.food-art {
  background: #fff0dc;
}

.quiz-art {
  background: #e9e6ff;
  color: #6254e8;
}

.todo-art {
  background: #dff7ed;
  color: #167a58;
}

.quiz-art > span,
.todo-art > span {
  font-size: 5rem;
  font-weight: 900;
}

.project-art small {
  position: absolute;
  bottom: 14px;
  left: 18px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #45465c;
}

.project-info {
  padding: 22px;
}

.project-type {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.project-info h3 {
  margin-bottom: 9px;
  font-size: 1.18rem;
}

.project-info > p:not(.project-type) {
  font-size: 0.9rem;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-block: 18px;
}

.tag-list span {
  background: var(--surface);
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 0.73rem;
}

.project-link {
  display: inline-block;
  color: var(--primary);
  font-weight: 750;
  font-size: 0.9rem;
  margin-top: 5px;
}

.project-link:hover {
  text-decoration: underline;
}

.project-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.84rem;
}

/* 9. CONTACT */
.contact-panel {
  max-width: 760px;
  margin-inline: auto;
}

.contact-form {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-field label {
  font-weight: 700;
  font-size: 0.9rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
}

.form-field textarea {
  resize: vertical;
  min-height: 130px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.form-status {
  margin-top: 15px;
  font-size: 0.9rem;
  color: var(--primary);
  overflow-wrap: anywhere;
}

.form-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* 10. FOOTER */
.footer {
  padding-block: 28px;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.footer-content p {
  color: var(--muted);
  font-size: 0.83rem;
}

/* 11. RESPONSIVE DESIGN */
@media (max-width: 900px) {
  .hero {
    gap: 35px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    gap: 16px;
  }
}

@media (max-width: 650px) {
  .container {
    width: min(100% - 36px, 540px);
  }

  .navbar {
    min-height: 68px;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    padding: 22px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links > a {
    padding: 5px 0;
  }

  .theme-toggle {
    align-self: flex-start;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: 65px;
    gap: 35px;
  }

  .hero h1 {
    letter-spacing: -1.2px;
  }

  .hero-visual {
    margin-inline: 10px;
  }

  .tag-one {
    right: -5px;
  }

  .tag-two {
    left: -8px;
  }

  .section,
  .section-soft {
    padding-block: 65px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-art {
    min-height: 180px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .contact-form {
    padding: 20px;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Respect visitors who prefer less animation. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}