:root{
  --bg: #ffffff;
  --card: #ffffff;
  --text: #000000;
  --muted: #666666;
  --accent: #000000;
  --radius: 2px;
  --glass: rgb(255, 255, 255);
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --max-width: 1100px;
  --gap: 2rem;
  --project-card-bg: #ffffff;

  --header-bg: rgba(255, 255, 255, 0.98);
  --header-h: 72px; 
  --avatar: #000000;

  --about-bg: #fafafa;
  --about-text: #000000;
  --about-card-bg: #ffffff;
  --about-card-border: rgba(0,0,0,0.08);

  --projects-bg: #ffffff;

  --contact-bg: #fafafa; 
  --contact-text: var(--text);
  --contact-muted: var(--muted);

  --contact-card-bg: #ffffff;
  --contact-card-border: rgba(0,0,0,0.08);
  --contact-card-radius: 2px;
  --contact-card-padding: 48px;
  --contact-card-max-width: 980px;
  --contact-card-shadow: 0 1px 3px rgba(0,0,0,0.08);

  --contact-input-bg: #ffffff;
  --contact-input-border: #cccccc;
  --contact-input-text: var(--text);
  --contact-input-placeholder: #999999;
  --contact-input-radius: 12px;
  --contact-input-focus-border: #000000;
  --contact-input-focus-shadow: 0 0 0 1px rgba(0,0,0,0.1);

  --contact-button-bg: #000000;
  --contact-button-color: #ffffff;
  --contact-button-border-radius: 12px;
  --contact-button-padding: 12px 24px;
  --contact-button-hover-bg: #333333;
  --contact-button-hover-color: #ffffff;

  --contact-link-color: #000000;
  --contact-info-bg: transparent;

  --contact-grid-gap: var(--gap);

  --footer-bg: transparent;                
  --footer-text: var(--muted);             
  --footer-border: rgba(0,0,0,0.08);

  --anim-fast: 160ms;
  --anim-medium: 320ms;
  --anim-slow: 600ms;
  --anim-ease: cubic-bezier(.2,.9,.2,1);

  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}


@media (prefers-reduced-motion: reduce){
  :root{ --anim-fast: 50ms; --anim-medium: 80ms; --anim-slow: 120ms; }
}


html {
  scroll-behavior: smooth;
}


*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;

font-variant-ligatures: common-ligatures;
font-feature-settings: "liga" 1;
}


.container{
  width:90%;
  max-width:var(--max-width);
  margin:0 auto;
}


@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}


@keyframes elasticPop {
  0% { transform: scale(.96); }
  40% { transform: scale(1.08); }
  60% { transform: scale(.985); }
  100% { transform: scale(1); }
}


@keyframes sheenSweep {
  0% { transform: translateX(-120%) skewX(-18deg); opacity: 0; }
  40% { opacity: .9; }
  100% { transform: translateX(220%) skewX(-18deg); opacity: 0; }
}


@keyframes blobDrift {
  0% { transform: translate(-20%, -10%) scale(.9); opacity: .18; }
  50%{ transform: translate(10%, -20%) scale(1.05); opacity:.24; }
  100%{ transform: translate(-20%, -10%) scale(.95); opacity:.18; }
}


@keyframes ringPulse {
  0% { transform: scale(.8); opacity:.0; filter: blur(0px); }
  40% { transform: scale(1.18); opacity:.6; filter: blur(6px); }
  100% { transform: scale(1.6); opacity:0; filter: blur(12px); }
}

@keyframes borderSpin {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes microTilt {
  0% { transform: perspective(600px) rotateX(0) rotateY(0) translateZ(0); }
  100% { transform: perspective(600px) rotateX(2deg) rotateY(-2deg) translateZ(6px); }
}

@keyframes popIn {
  0% { opacity:0; transform: scale(.98) translateY(6px); }
  60% { opacity:1; transform: scale(1.02) translateY(-2px); }
  100% { transform: scale(1) translateY(0); }
}
@keyframes floaty {
  0% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
  100% { transform: translateY(0) rotate(-1deg); }
}
@keyframes ripplePulse {
  0% { box-shadow: 0 0 0 0 rgba(37,99,235,0.12); }
  70% { box-shadow: 0 12px 40px 12px rgba(37,99,235,0.06); }
  100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}
@keyframes slideDown {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.site-header{
  background: var(--header-bg);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 0;
}
.brand{
  font-weight:700;
  color:var(--text);
  text-decoration:none;
  font-size:1.05rem;
  transform-origin:left center;
  position: relative;
}

.brand::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .22s cubic-bezier(.2,.9,.2,1);
  opacity: 1;
  border-radius: 0;
}

.brand:hover::after {
  transform: scaleX(1);
}

.dark .brand:hover {
  color: var(--text) !important;
}


.nav{ display:flex; gap:1rem; }
.nav a{
  color:var(--muted);
  text-decoration:none;
  padding:8px 16px;
  border-radius:12px;
  position:relative;
  overflow:visible;
  -webkit-tap-highlight-color: transparent;
  transition: color .14s ease, background .14s ease, transform .14s ease;
}
.nav a:hover{ 
  color: #999999; 
  background: rgba(59, 130, 246, 0.08);
  transform: translateY(-1px);
}

.dark .nav a:hover{
  color: #cccccc !important;
}

.nav a::after{
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .22s cubic-bezier(.2,.9,.2,1);
  opacity:1;
  border-radius:0;
}
.nav a:hover::after,
.nav a:focus::after{
  transform: scaleX(1);
}


.header-controls{ display:flex; gap:0.5rem; align-items:center; }
.nav-toggle{ display:none; background:transparent; border:0; font-size:1.2rem; }
#theme-toggle{ background:transparent; border:0; font-size:1.1rem; }

.theme-toggle {
  width: 64px;
  height: 34px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer; 
  -webkit-tap-highlight-color: transparent;
  position: relative;
  transition: background .25s ease, border-color .25s ease;
  transform-origin:center;
}


.theme-toggle .knob{
  width:26px;
  height:26px;
  border-radius:50%;
  background: #ffffff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform .18s ease, background .18s ease;
}


.theme-toggle .icon{
  position:absolute;
  width:14px;
  height:14px;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%) scale(.9);
  transition: opacity .22s ease, transform .22s ease;
  color: currentColor;
  opacity: 0;
  pointer-events: none;
}
.theme-toggle .icon.sun{ opacity: 1; transform: translate(-50%, -50%) scale(1); }
.theme-toggle .icon.moon{ opacity: 0; transform: translate(-50%, -50%) scale(.8); }
.dark .theme-toggle .icon.sun{ opacity: 0; transform: translate(-50%, -50%) scale(.8); }
.dark .theme-toggle .icon.moon{ opacity: 1; transform: translate(-50%, -50%) scale(1); }

.dark .theme-toggle{
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.dark .theme-toggle .knob{
  background: #000000;
  color:#ffffff;
  box-shadow: 0 2px 4px rgba(255,255,255,0.1);
}


main {
  padding-top: var(--header-h);
  transition: padding-top .12s linear;
}


.hero{
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
  background: linear-gradient(135deg, var(--bg) 0%, rgba(59, 130, 246, 0.02) 50%, var(--bg) 100%);
  overflow: hidden;
}

.hero-bg{
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("Contour Line.svg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  opacity: 0.08;
  transform: scale(1.02);
  transition: transform var(--anim-slow) var(--anim-ease), opacity var(--anim-medium);
}

.hero-inner{
  position: relative;
  z-index: 1;
  width:100%;
  max-width:1200px;
  margin:0 auto;
  display:grid;
  grid-template-columns: 1fr 420px;
  gap: var(--gap);
  align-items:center;
}
.hero-text{
  padding-right: 12px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
  text-align:left;
  min-height:100%;
}

.hero-text1{
  font-size:1.2rem;
  font-weight:400;
  color:var(--muted);
  margin:0;
  letter-spacing: 0.02em;
}
.hero-text2{
  font-size:3.5rem;
  font-weight:700;
  color:var(--text);
  margin-bottom:24px;
  margin:0;
  display: inline-block;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.lead{ 
  color:var(--muted); 
  margin:24px 0 32px; 
  width: fit-content;
  font-size: 1.1rem;
  line-height: 1.6;
}
.hero-cta .btn{ 
  margin-right:12px; 
  margin-top: 0;
}

.hero-cta .btn:first-child,
.hero-cta .btn[href="#projects"],
.hero-cta .btn[href*="projects"] {
  background: #3b82f6;
  color: #000000;
  border: none;
  border-radius: 24px;
  display: inline-block;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.hero-cta .btn:first-child:hover,
.hero-cta .btn:first-child:focus,
.hero-cta .btn[href="#projects"]:hover,
.hero-cta .btn[href="#projects"]:focus,
.hero-cta .btn[href*="projects"]:hover,
.hero-cta .btn[href*="projects"]:focus {
  background: #2563eb;
  color: #ffffff;
  transform: translateY(-2px);
}

:not(.dark) .hero-cta .btn:first-child:hover,
:not(.dark) .hero-cta .btn:first-child:focus,
:not(.dark) .hero-cta .btn[href="#projects"]:hover,
:not(.dark) .hero-cta .btn[href="#projects"]:focus,
:not(.dark) .hero-cta .btn[href*="projects"]:hover,
:not(.dark) .hero-cta .btn[href*="projects"]:focus {
  color: #ffffff !important;
}

.dark .hero-cta .btn:first-child:hover,
.dark .hero-cta .btn:first-child:focus,
.dark .hero-cta .btn[href="#projects"]:hover,
.dark .hero-cta .btn[href="#projects"]:focus,
.dark .hero-cta .btn[href*="projects"]:hover,
.dark .hero-cta .btn[href*="projects"]:focus {
  color: #000000 !important;
}

.hero-cta .btn.btn-outline,
.hero-cta .btn[href="#contact"] {
  background: #000000;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  display: inline-block;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.hero-cta .btn.btn-outline:hover,
.hero-cta .btn.btn-outline:focus,
.hero-cta .btn[href="#contact"]:hover,
.hero-cta .btn[href="#contact"]:focus {
  background: #000000 !important;
  color: #ffffff !important;
  transform: translateY(-2px);
}

.dark .hero-cta .btn.btn-outline,
.dark .hero-cta .btn[href="#contact"] {
  background: transparent;
  color: #ffffff;
  border: 1px solid #ffffff;
}

.dark .hero-cta .btn.btn-outline:hover,
.dark .hero-cta .btn.btn-outline:focus,
.dark .hero-cta .btn[href="#contact"]:hover,
.dark .hero-cta .btn[href="#contact"]:focus {
  background: #ffffff !important;
  color: #000000 !important;
  transform: translateY(-2px);
}

.email-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(30, 30, 35, 0.4) 0%, 
    rgba(45, 45, 50, 0.7) 50%, 
    rgba(35, 35, 40, 0.5) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50000;
  padding: 20px;
  backdrop-filter: blur(15px) saturate(120%);
  -webkit-backdrop-filter: blur(15px) saturate(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.email-modal-content {
  background: rgba(248, 248, 250, 0.95);
  border-radius: 28px;
  padding: 2.5rem;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid rgba(200, 200, 205, 0.4);
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.12),
    0 16px 32px rgba(0, 0, 0, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px) saturate(110%);
  -webkit-backdrop-filter: blur(20px) saturate(110%);
  transform: translateY(30px) scale(0.9);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.email-modal.show {
  opacity: 1;
}

.email-modal.show .email-modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.dark .email-modal {
  background: linear-gradient(135deg, 
    rgba(15, 15, 20, 0.6) 0%, 
    rgba(25, 25, 30, 0.8) 50%, 
    rgba(20, 20, 25, 0.7) 100%);
}

.dark .email-modal-content {
  background: rgba(32, 32, 36, 0.95);
  border: 1px solid rgba(80, 80, 85, 0.3);
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.35),
    0 16px 32px rgba(0, 0, 0, 0.25),
    0 8px 16px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.email-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--contact-card-border);
}

.email-modal-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.3rem;
}

.close-modal {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 300;
}

.close-modal:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.dark .close-modal {
  background: rgba(255, 255, 255, 0.05);
}

.dark .close-modal:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.email-modal .contact-form label {
  display: block;
  margin-bottom: 1rem;
  color: var(--text);
  font-weight: 500;
}

.email-modal .contact-form input,
.email-modal .contact-form textarea {
  width: 100%;
  margin-top: 0.5rem;
  border-radius: 16px !important;
  transition: all 0.3s ease;
}

.email-modal .contact-form input:focus,
.email-modal .contact-form textarea:focus {
  transform: scale(1.01);
  border-radius: 18px !important;
}

.email-modal .form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.email-modal .form-actions .btn[type="submit"] {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid #000000 !important;
  border-radius: 16px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.email-modal .form-actions .btn[type="submit"]:hover {
  background: #000000 !important;
  color: #ffffff !important;
  border-radius: 20px !important;
  transform: translateY(-2px) !important;
}

.email-modal .form-actions .btn[type="reset"],
.email-modal .form-actions .btn.btn-outline {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid #000000 !important;
  border-radius: 16px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.email-modal .form-actions .btn[type="reset"]:hover,
.email-modal .form-actions .btn.btn-outline:hover {
  background: #000000 !important;
  color: #ffffff !important;
  border-radius: 20px !important;
  transform: translateY(-2px) !important;
}

.dark .email-modal .form-actions .btn[type="submit"] {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid #000000 !important;
}

.dark .email-modal .form-actions .btn[type="submit"]:hover {
  background: #000000 !important;
  color: #ffffff !important;
}

.dark .email-modal .form-actions .btn[type="reset"],
.dark .email-modal .form-actions .btn.btn-outline {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid #000000 !important;
}

.dark .email-modal .form-actions .btn[type="reset"]:hover,
.dark .email-modal .form-actions .btn.btn-outline:hover {
  background: #000000 !important;
  color: #ffffff !important;
}

.email-modal-content:hover {
  transform: translateY(0) scale(1.01);
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.15),
    0 20px 40px rgba(0, 0, 0, 0.12),
    0 10px 20px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.dark .email-modal-content:hover {
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.45),
    0 20px 40px rgba(0, 0, 0, 0.35),
    0 10px 20px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@media (max-width: 600px) {
  .email-modal {
    padding: 15px;
  }
  
  .email-modal-content {
    padding: 2rem 1.5rem;
    margin: 0;
    border-radius: 24px;
    max-height: 95vh;
  }
  
  .email-modal-header h3 {
    font-size: 1.2rem;
  }
  
  .email-modal .form-actions {
    flex-direction: column;
  }
  
  .close-modal {
    width: 32px;
    height: 32px;
    font-size: 1.3rem;
  }
}

.hero-card{ 
  background: transparent; 
  padding:0; 
  border-radius:0; 
  box-shadow:none; 
  text-align:center; 
  display:flex; 
  align-items:center; 
  justify-content:center;
}
.avatar{
  width: 1000px;
  height:1000px;
  display:grid;
  place-items:center;
  color: var(--avatar);
  border-radius:999px;
  transition: transform var(--anim-slow) var(--anim-ease);
}
.avatar svg{ width:100%; height:100%; display:block; }


@media (max-width:1100px){
  .hero-inner{ grid-template-columns: 1fr 320px; }
  .avatar{ width:180px; height:180px; }
}
@media (max-width:900px){
  .hero{ padding-left: 2rem; }
  .hero-inner{ grid-template-columns:1fr; text-align:left; padding:40px 0; }
  .avatar{ width:140px; height:140px; margin:16px 0 0 0; }
  .hero-text{ align-items:flex-start; text-align:left; padding-right:0; }
}

.section{ 
  padding:80px 0; 
  position: relative;
}
.section.alt{ 
  background: linear-gradient(135deg, var(--projects-bg) 0%, rgba(59, 130, 246, 0.01) 50%, var(--projects-bg) 100%);
  transition: background .18s ease; 
}
h2{ margin-top:0; }

.section h2{
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
  line-height: 1.2;
  position: relative;
  display: inline-block;
}

.section h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -12px;
  width: 100%;
  height: 3px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 2px;
}

#about{
  background: var(--about-bg);
  color: var(--about-text);
  transition: background .18s ease, color .18s ease;
}
#about .container {
  background: var(--about-card-bg);
  border-radius: 24px;
  padding: 48px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08), 0 2px 10px rgba(0,0,0,0.04);
  border: 1px solid var(--about-card-border);
  transition: background .18s ease, box-shadow .3s ease, border-color .18s ease, transform .3s ease;
}

#about .container:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.12), 0 5px 15px rgba(0,0,0,0.08);
}

.about-grid{ display:grid; grid-template-columns:1fr 300px; gap:var(--gap); align-items:start; }
@media (max-width:900px){
  .about-grid{ grid-template-columns:1fr; }
}

.skill{ margin:8px 0; color:var(--muted); }
.skill-level{ display:inline-block; width:60%; height:8px; background:#e6eefc; border-radius:999px; position:relative; vertical-align:middle; margin-left:8px; }
.skill-level::after{ content:''; position:absolute; left:0; top:0; bottom:0; width:var(--lvl,50%); background:var(--accent); border-radius:999px; }

.projects-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:var(--gap); }
.project-card{
  background: var(--project-card-bg);
  padding:32px;
  border-radius:20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.project-card:hover{
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.15);
}

#contact {
  background: var(--contact-bg);
  color: var(--contact-text);
  transition: background .18s ease, color .18s ease;
  padding: 56px 0;
}
#contact .container {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  max-width: var(--max-width);
}

.contact-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items:start;
}

@media (min-width: 900px) {
  .contact-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .contact-grid > *:nth-child(1) { grid-column: 1 / 3; }
  .contact-grid > *:nth-child(2) { grid-column: 3 / 5; }
  .contact-grid > *:nth-child(3) { grid-column: 5 / 7; }
  
  .contact-grid > *:nth-child(4) { grid-column: 2 / 4; }
  .contact-grid > *:nth-child(5) { grid-column: 4 / 6; }
}

.contact-card {
  background: var(--contact-card-bg);
  border: 1px solid var(--contact-card-border);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: transform .3s ease, box-shadow .3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.contact-card::after {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .4s cubic-bezier(.2,.9,.2,1);
  opacity: 1;
  border-radius: 0;
}

.contact-card:hover::after {
  transform: scaleX(1);
}

.contact-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);
  border-color: rgba(59, 130, 246, 0.2);
}

.dark .contact-card:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.2);
  border-color: rgba(59, 130, 246, 0.3);
}

.contact-card-icon {
  width: 48px;
  height: 48px;
  background: #000000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: #ffffff;
  font-size: 1.5rem;
}

.dark .contact-card-icon {
  background: #ffffff;
  color: #000000;
}

.contact-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.contact-card p {
  color: var(--muted);
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
}

.contact-card .contact-value {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  margin: 0;
}

.contact-form input,
.contact-form textarea {
  width:100%;
  padding:12px 16px;
  border-radius: var(--contact-input-radius);
  border: 1px solid var(--contact-input-border);
  background: var(--contact-input-bg);
  color: var(--contact-input-text);
  font:inherit;
  transition: border-color .2s ease;
  outline: none;
  box-shadow: none;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--contact-input-placeholder);
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--contact-input-focus-border);
  box-shadow: var(--contact-input-focus-shadow);
}

.contact-form .btn {
  background: var(--contact-button-bg);
  color: var(--contact-button-color);
  padding: var(--contact-button-padding);
  border-radius: var(--contact-button-border-radius);
  border: 0;
  cursor: pointer; 
  transition: background .2s ease, transform .2s ease;
  position:relative;
  overflow:hidden;
}
.contact-form .btn:hover,
.contact-form .btn:focus {
  background: var(--contact-button-hover-bg);
  color: var(--contact-button-hover-color);
  transform: translateY(-2px);
}

.contact-form .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.contact-form .btn.btn-outline {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.2);
  color: var(--contact-text);
}

.form-status {
  margin-top: 8px;
  color: var(--contact-muted);
}

.contact-info {
  background: var(--contact-info-bg);
  color: var(--contact-text);
}
.contact-info a { color: var(--contact-link-color); text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }

.socials{ display:flex; gap:10px; margin-top:8px; }
.socials a{ 
  color: var(--contact-link-color); 
  padding:8px; 
  border-radius:0; 
  text-decoration:none; 
  display:inline-grid; 
  place-items:center; 
  transition: transform .2s ease, background .2s ease;
  background: transparent;
  border: 1px solid transparent;
}
.socials a:hover{ 
  transform: translateY(-2px); 
  border-color: rgba(0,0,0,0.1);
}

@media (max-width:900px){
  .contact-grid{ 
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .contact-card {
    padding: 1.5rem;
  }
}


.btn{
  display:inline-block;
  background:var(--accent);
  color:white;
  padding:12px 24px;
  border-radius:0;
  text-decoration:none;
  border:0;
  cursor: pointer; 
  position:relative;
  overflow:hidden;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease, background .2s ease;
}

.btn::after{
  display: none;
}

.btn > *{ position: relative; z-index: 1; }
.btn:active{ transform: translateY(1px); transition-duration:120ms; }
.btn:focus-visible{ outline: 2px solid #000000; outline-offset: 4px; }


a, .card-links a{
  position: relative;
  transition: color .16s ease;
}
a::after, .card-links a::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  bottom: 0;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform .28s cubic-bezier(.2,.9,.2,1);
  opacity: 1;
  border-radius: 0;
}
.card-links a:hover::after, a:focus::after, .card-links a:hover::after{ transform: scaleX(1); }

.external-link-icon {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0.7;
  transition: all 0.2s ease;
  transform: translateY(-1px);
}

.card-links a:hover .external-link-icon {
  opacity: 1;
  transform: translateY(-1px) scale(1.1);
}

.card-links a:focus {
  outline: none;
}

.card-links a:focus:not(:hover)::after {
  transform: scaleX(0);
}

.contact-card:focus {
  outline: none;
}

.contact-card:focus:not(:hover)::after {
  transform: scaleX(0);
}

a:active{ transform: translateY(1px); }

.site-footer{
  padding: 48px 0;
  color: var(--footer-text);
  background: linear-gradient(135deg, var(--footer-bg) 0%, rgba(59, 130, 246, 0.01) 100%);
  border-top: 1px solid var(--footer-border);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
  position: relative;
  z-index: 99999;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 2px;
}

.footer-inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 5%;
}

.site-footer p{
  margin: 0;
  text-align: center;
  color: var(--footer-text);
  font-size: 0.95rem;
  font-weight: 500;
}

.site-footer p:first-child {
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
}

.site-footer p:last-child {
  opacity: 0.8;
  font-size: 0.9rem;
}

@media (max-width:700px){
  .footer-inner{ flex-direction:column; gap:8px; text-align:center; }
}

.section + .section{ margin-top:0; }

.dark{
  --bg: #1a1a1a;
  --card: #1a1a1a;
  --text: #ffffff;
  --muted: #999999;
  --accent: #ffffff;
  --glass: rgba(255,255,255,0.04);
  --shadow: 0 1px 3px rgba(255,255,255,0.08);

  --avatar: white;
  --header-bg: rgba(26,26,26,0.98);
  --about-bg: #242424;
  --about-text: #ffffff;

  --projects-bg: #242424;
  --project-card-bg: #1a1a1a;

  --about-card-bg: #1a1a1a;
  --about-card-border: rgba(255,255,255,0.1);

  --contact-bg: #1a1a1a;
  --contact-text: var(--text);
  --contact-card-bg: #242424;
  --contact-card-border: rgba(255,255,255,0.1);
  --contact-card-shadow: 0 8px 20px rgba(0,0,0,0.3);

  --contact-input-bg: rgba(255,255,255,0.05);
  --contact-input-border: rgba(255,255,255,0.2);
  --contact-input-text: var(--text);
  --contact-input-placeholder: rgba(255,255,255,0.5);
  --contact-input-focus-border: rgba(255,255,255,0.8);
  --contact-input-focus-shadow: 0 0 0 1px rgba(255,255,255,0.1);

  --contact-button-bg: var(--accent);
  --contact-button-hover-bg: #cccccc;
  --contact-button-color: #000000;

  --footer-bg: #1a1a1a;
  --footer-text: #999999;
  --footer-border: rgba(255,255,255,0.1);
}

html, body, html * {
  cursor: default;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input,
textarea,
select,
input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="password"],
[contenteditable="true"] {
  cursor: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

:focus {
  outline: auto 2px Highlight;
}
:focus:not(:focus-visible) {
  outline: none;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   Modern Scroll Reveal Animation System
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --sr-offset: 20px;
  --sr-duration: 700ms;
  --sr-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sr-stagger-step: 80ms;
  --sr-scale: 0.96;
  --sr-blur: 8px;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(var(--sr-offset)) scale(var(--sr-scale));
  filter: blur(var(--sr-blur));
  transition:
    opacity var(--sr-duration) var(--sr-ease),
    transform var(--sr-duration) var(--sr-ease),
    filter var(--sr-duration) var(--sr-ease);
  will-change: opacity, transform, filter;
  backface-visibility: hidden;
}

.animate-on-scroll.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.animate-on-scroll.heading {
  --sr-offset: 12px;
  --sr-duration: 600ms;
  --sr-scale: 0.98;
  --sr-blur: 4px;
}

.animate-on-scroll.card {
  --sr-offset: 24px;
  --sr-duration: 800ms;
  --sr-scale: 0.94;
  --sr-blur: 6px;
  --sr-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-on-scroll.btn-reveal {
  --sr-offset: 16px;
  --sr-duration: 650ms;
  --sr-scale: 0.92;
  --sr-blur: 5px;
}

.animate-on-scroll.stagger > * {
  opacity: 0;
  transform: translateY(calc(var(--sr-offset) * 0.7)) scale(var(--sr-scale));
  filter: blur(calc(var(--sr-blur) * 0.8));
  transition:
    opacity var(--sr-duration) var(--sr-ease),
    transform var(--sr-duration) var(--sr-ease),
    filter var(--sr-duration) var(--sr-ease);
  transition-delay: var(--sr-delay, 0ms);
  will-change: opacity, transform, filter;
}

.animate-on-scroll.stagger.in-view > * {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .animate-on-scroll.stagger > * {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    animation: none !important;
  }
}
.site-header { z-index: 99999; }

.nav-toggle {
  display: none; 
  background: transparent;
  border: 0;
  font-size: 1.35rem;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0,0,0,0.06);
  transition: background .14s ease, transform .12s ease;
}
.nav-toggle:focus { outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 4px; }
.nav-toggle:hover { background: rgba(0,0,0,0.04); transform: translateY(-1px); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }

  .nav {
    display: flex;                
    flex-direction: column;
    gap: 0;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--header-h));
    background: var(--header-bg);
    border-bottom: 1px solid rgba(15,23,42,0.06);
    padding: 8px 12px;
    transform-origin: top center;
    transform: translateY(-6px) scaleY(.98);
    opacity: 0;
    pointer-events: none;
    transition: transform .18s var(--anim-ease), opacity .18s var(--anim-ease);
    box-shadow: 0 8px 30px rgba(2,6,23,0.12);
    border-radius: 0 0 10px 10px;
  }

  .nav a {
    display: block;
    padding: 10px 14px;
    margin: 2px 0;
    border-radius: 8px;
    color: var(--text);
  }

  .nav.open {
    transform: translateY(0) scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .header-controls { gap: 0.5rem; align-items:center; }

  .nav a::after { display: none; } 
}

#nav-toggle[aria-expanded="true"] {
  transform: rotate(90deg);
  transition: transform .18s ease;
}
a:link,
a:visited {
  color: inherit !important;
  text-decoration: none !important;
}

.card-links a:link,
.card-links a:visited {
 color: #000000 !important;
  text-decoration: none !important;
}

a:hover,
a:focus,
a:active,
.card-links a:hover,
.card-links a:focus,
.card-links a:active {
  color: #000000 !important;
  text-decoration: none !important;
  outline: none;
}

.dark .card-links a:link,
.dark .card-links a:visited {
  color: #ffffff !important; 
}

.dark .card-links a:hover,
.dark .card-links a:focus,
.dark .card-links a:active {
  color: #ffffff !important;
}
.hero-cta .btn.btn-outline[href="#contact"] {
  background: transparent;
  color: var(--text);
  border: 1px solid #000000;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.hero-cta .btn.btn-outline[href="#contact"]:hover,
.hero-cta .btn.btn-outline[href="#contact"]:focus {
  background: #000000;
  color: #ffffff;
  transform: translateY(-2px);
}

.dark .hero-cta .btn.btn-outline[href="#contact"] {
  background: transparent;
  color: #ffffff;
  border-color: #ffffff;
}

.dark .hero-cta .btn.btn-outline[href="#contact"]:hover,
.dark .hero-cta .btn.btn-outline[href="#contact"]:focus {
  background: #ffffff;
  color: #000000;
  transform: translateY(-2px);
}
