/* ==========================================================
   TOKENS
   Primary scale derived from #D0EBFF · Gray scale from #F1F3F5
   ========================================================== */
:root {
  --primary-50: #f5fafe;
  --primary-100: #e6f3fd;
  --primary-200: #d0ebff;
  --primary-300: #a8d9fb;
  --primary-400: #7cc2f0;
  --primary-500: #4ea8e0;
  --primary-600: #2f8bc7;
  --primary-700: #1f6ea3;
  --primary-800: #17567f;
  --primary-900: #123f5c;

  --gray-50: #fafbfc;
  --gray-100: #f1f3f5;
  --gray-200: #e4e8eb;
  --gray-300: #d3d9de;
  --gray-400: #b0b8bf;
  --gray-500: #8a939b;
  --gray-600: #656e76;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;

  --white: #ffffff;

  --font-display: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --maxw: 1100px;

  --shadow-sm: 0 2px 8px rgba(18, 63, 92, 0.07);
  --shadow-md: 0 12px 28px rgba(18, 63, 92, 0.12);

  --transition-theme:
    background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ---- Dark mode: same tokens, inverted scale ---- */
[data-theme="dark"] {
  --white: #0e1318;

  --gray-50: #151b21;
  --gray-100: #1b222a;
  --gray-200: #262e37;
  --gray-300: #333d47;
  --gray-400: #4b5661;
  --gray-500: #6b7680;
  --gray-600: #8b96a0;
  --gray-700: #c3cbd1;
  --gray-800: #dbe1e5;
  --gray-900: #f4f6f8;

  --primary-50: #16324a;
  --primary-100: #123f5c;
  --primary-200: #17567f;
  --primary-300: #1f6ea3;
  --primary-400: #2f8bc7;
  --primary-500: #4ea8e0;
  --primary-600: #7cc2f0;
  --primary-700: #a8d9fb;
  --primary-800: #d0ebff;
  --primary-900: #e6f3fd;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 32px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--gray-700);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: var(--transition-theme);
}

img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--gray-900);
  margin: 0 0 16px;
  line-height: 1.2;
  transition: var(--transition-theme);
}

p {
  margin: 0 0 12px;
}

:focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 3px;
}

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

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-600);
  margin-bottom: 10px;
}
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--white) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  transition: var(--transition-theme);
}
.navbar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.navbar .logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--gray-900);
}

.navbar .logo span {
  color: var(--primary-600);
}
.navbar ul {
  display: flex;
  gap: 30px;
}
.navbar ul li a {
  font-weight: 500;
  font-size: 15px;
  color: var(--gray-700);
  position: relative;
  padding: 4px 2px;
  transition: color 0.2s ease;
}
.navbar ul li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--primary-500);
  transition: width 0.25s ease;
}
.navbar ul li a:hover,
.navbar ul li a:focus-visible,
.navbar ul li a.active {
  color: var(--primary-700);
}

.navbar ul li a:hover::after,
.navbar ul li a:focus-visible::after,
.navbar ul li a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.nav-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  cursor: pointer;
  transition:
    var(--transition-theme),
    transform 0.2s ease,
    border-color 0.2s ease;
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle img {
  width: 18px;
  height: 18px;
}
.icon-sun {
  display: none;
}
[data-theme="dark"] .icon-moon {
  display: none;
}
[data-theme="dark"] .icon-sun {
  display: block;
}

.theme-toggle:hover,
.nav-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--primary-400);
}

.nav-toggle {
  display: none;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  height: 3px;
  border-radius: 999px;
  background: var(--gray-800);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    background 0.2s ease,
    width 0.2s ease,
    left 0.2s ease;
}
/* middle bar — full width, centered */
.nav-toggle span {
  top: 18px;
  left: 9px;
  width: 22px;
}
/* top bar — shorter, centered */
.nav-toggle span::before {
  top: -7px;
  left: 4px;
  width: 14px;
}
/* bottom bar — medium, centered */
.nav-toggle span::after {
  top: 7px;
  left: 2px;
  width: 18px;
}
.nav-toggle.open span {
  background: transparent;
}
.nav-toggle.open span::before {
  left: 9px;
  width: 22px;
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span::after {
  left: 9px;
  width: 22px;
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 780px) {
  .nav-toggle {
    display: block;
  }
  .navbar ul {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 0;
    overflow: hidden;
    transition:
      max-height 0.3s ease,
      var(--transition-theme);
    box-shadow: var(--shadow-md);
  }

  .navbar ul.open {
    max-height: 340px;
  }
  .navbar ul li {
    border-top: 1px solid var(--gray-200);
  }
  .navbar ul li a {
    display: block;
    padding: 16px 24px;
  }
  .navbar ul li a::after {
    display: none;
  }
}

.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 88px 32px 100px;
  display: flex;
  align-items: center;
  gap: 64px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -120px;
  right: -80px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--primary-200) 0%, transparent 70%);
  opacity: 0.6;
  filter: blur(10px);
  z-index: -1;
  animation: floatGlow 8s ease-in-out infinite;
}

@keyframes floatGlow {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-20px, 24px) scale(1.08);
  }
}

.hero-image {
  flex: 0 0 auto;
  position: relative;
  text-align: center;
  animation: fadeInLeft 0.7s ease both;
}

.profilepic {
  width: 250px;
  height: 250px;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid var(--primary-100);
  box-shadow: var(--shadow-md);
  background: var(--gray-100);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  transform: scale(1.05);
  height: clamp(220px, 22vw, 340px);
  width: clamp(220px, 22vw, 340px);
}

.profilepic {
  animation: floatPic 4s ease-in-out infinite;
}

@keyframes floatPic {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-800);
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  padding: 7px 14px;
  border-radius: 999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a8f5e;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(26, 143, 94, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(26, 143, 94, 0);
  }
}

.hero-text {
  flex: 1 1 auto;
  animation: fadeInRight 0.7s ease both;
  animation-delay: 0.1s;
}

.hero-text h1 {
  font-size: clamp(32px, 4.6vw, 50px);
  letter-spacing: -0.01em;
}

.hero-text h1 .accent {
  color: var(--primary-600);
}

.role {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 19px;
  color: var(--gray-600);
  margin-bottom: 22px;
  min-height: 28px;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 20px;
  background: var(--primary-500);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.lede {
  max-width: 50ch;
  font-size: 16.5px;
  color: var(--gray-600);
}

.cta-row {
  display: flex;
  gap: 14px;
  margin: 26px 0 28px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.2s ease;
}

.btn-primary {
  background: var(--primary-600);
  color: #fff;
  box-shadow: 0 4px 0 var(--primary-800);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--primary-500);
}

.btn-ghost {
  border: 1px solid var(--gray-300);
  color: var(--gray-800);
  background: var(--gray-50);
}

.btn-ghost:hover {
  border-color: var(--primary-400);
  color: var(--primary-700);
}

.social-row {
  display: flex;
  gap: 12px;
}

.social-row a {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #2f8bc7;

  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.social-row a:hover,
.social-row a:focus-visible {
  border-color: var(--primary-400);
  background: var(--primary-100);
  transform: translateY(-3px);
}

@media (max-width: 760px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 56px 24px 64px;
  }
  .cta-row,
  .social-row {
    justify-content: center;
  }
  .lede {
    margin-left: auto;
    margin-right: auto;
  }
}

.block {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 32px;
  border-top: 1px solid var(--gray-200);
  transition: var(--transition-theme);
}

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

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 820px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}
.about-grid p {
  max-width: 62ch;
  font-size: 16.5px;
}
.stat-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stat-card {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  transition:
    var(--transition-theme),
    transform 0.2s ease,
    border-color 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-300);
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--primary-700);
}
.stat-label {
  display: block;
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 2px;
}

.skills-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 820px) {
  .skills-groups {
    grid-template-columns: 1fr;
  }
}
.skill-card {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition-theme);
}
.skill-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-800);
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  padding: 7px 14px;
  border-radius: 999px;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    var(--transition-theme);
}

.tag-list li:hover {
  background: var(--primary-100);
  transform: translateY(-2px);
}

.tag-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

@media (max-width: 800px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

.project-box {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}
.project-box:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-300);
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.project-box h3 {
  font-size: 19px;
  margin: 0;
}
.status-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--gray-200);
  color: var(--gray-700);
}
.status-pill.status-front {
  background: var(--primary-100);
  color: var(--primary-800);
}
.status-pill.status-db {
  background: #fbeed0;
  color: #8a5b0a;
}
.project-box p {
  font-size: 15px;
  color: var(--gray-700);
}
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 14px;
}

.project-stack span {
  background: var(--gray-200);
  padding: 3px 9px;
  border-radius: 6px;
}

.project-link {
  font-weight: 600;
  color: var(--primary-700);
  border-bottom: 1px solid var(--primary-300);
}

.project-link:hover,
.project-link:focus-visible {
  color: var(--primary-900);
  border-color: var(--primary-600);
}

.project-grid .project-box:nth-child(1) {
  animation-delay: 0.05s;
}
.project-grid .project-box:nth-child(2) {
  animation-delay: 0.15s;
}
.project-grid .project-box:nth-child(3) {
  animation-delay: 0.25s;
}
.project-grid .project-box:nth-child(4) {
  animation-delay: 0.35s;
}

/* ---- Contact ---- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 820px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

.contact-intro p {
  max-width: 46ch;
  color: var(--gray-600);
}

.contact-direct {
  margin-top: 22px;
}
.contact-direct li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.contact-direct .k {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-500);
  width: 60px;
  flex-shrink: 0;
}
.contact-direct a {
  font-weight: 600;
  color: var(--gray-900);
  border-bottom: 1px solid var(--gray-300);
}
.contact-direct a:hover {
  color: var(--primary-700);
  border-color: var(--primary-500);
}

.contact-form {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-theme);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--gray-900);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  resize: vertical;
  transition:
    var(--transition-theme),
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.btn-submit {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: var(--primary-600);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 26px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--primary-800);
  transition:
    transform 0.15s ease,
    background 0.2s ease;
}

.btn-submit:hover {
  background: var(--primary-500);
  transform: translateY(-2px);
}
.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 0 var(--primary-800);
}
.btn-submit.sending {
  opacity: 0.7;
  cursor: wait;
}

.form-status {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 500;
  min-height: 20px;
}

.form-status.success {
  color: #1a8f5e;
}
.form-status.error {
  color: #d64545;
}

@media (max-width: 600px) {
  .contact-form {
    padding: 24px;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  transition: var(--transition-theme);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 32px 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 700px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.footer-brand p {
  margin-top: 12px;
  max-width: 34ch;
  color: var(--gray-600);
  font-size: 14.5px;
}

@media (max-width: 700px) {
  .footer-brand p {
    margin-left: auto;
    margin-right: auto;
  }
}

.footer h4 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  margin-bottom: 14px;
}

.footer-links ul li {
  margin-bottom: 10px;
}
.footer-links a {
  color: var(--gray-700);
  font-size: 14.5px;
}
.footer-links a:hover {
  color: var(--primary-700);
}

.footer-connect .social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .footer-connect .social {
    justify-content: center;
  }
}

.footer-connect .social a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: #2f8bc7;
  border: 1px solid var(--gray-200);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.footer-connect .social a:hover {
  transform: translateY(-3px);
  border-color: var(--primary-400);
  background: var(--primary-100);
}

.footer-bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 32px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--gray-500);
}
#footer-bottom-note {
  text-align: center;
  flex: 1;
}
.back-to-top {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  font-size: 16px;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.back-to-top:hover {
  transform: translateY(-3px);
  border-color: var(--primary-400);
  background: var(--primary-100);
}
