:root{
  --bg: #0b0d12;
  --bg-2:#0f1320;
  --surface: rgba(255,255,255,.06);
  --surface-2: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.12);

  --text: #e9ecf1;
  --muted:#b8c0cc;

  --brand: #a78bfa;      /* purple */
  --brand-2:#ec4899;     /* pink */
  --accent:#22d3ee;      /* cyan accent (used sparingly) */

  /* Responsive radii */
  --radius: clamp(14px, 2vw, 18px);
  --radius-lg: clamp(18px, 2.6vw, 24px);

  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --shadow-soft: 0 12px 32px rgba(0,0,0,.35);

  --max: 1200px;

  /* Responsive layout helpers */
  --pad: clamp(16px, 3vw, 24px);
  --section-y: clamp(72px, 10vw, 110px);
  --header-h: clamp(64px, 9vw, 86px);
}

/* Reset */
*{ margin:0; padding:0; box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 800px at 20% 10%, rgba(167,139,250,.16), transparent 60%),
              radial-gradient(900px 700px at 85% 30%, rgba(236,72,153,.12), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x:hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: clamp(15px, 1.6vw, 16.5px);
}

/* Turn off the heavy background effects (keep elements but hide them) */
.neural-background,
.geometric-shapes,
.neural-lines{ display:none !important; }

/* Focus */
:focus-visible{
  outline: 2px solid rgba(34,211,238,.9);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Selection */
::selection{ background: rgba(34,211,238,.22); }

/* Utilities */
.section-title{
  text-align:center;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height:1.15;
  letter-spacing: -0.02em;
  margin: 0 auto clamp(34px, 6vw, 56px);
  color: var(--text);
  max-width: 24ch;
}
.section-title::after{
  content:"";
  display:block;
  width:72px;
  height:3px;
  border-radius:999px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  opacity:.9;
}

/* Glass -> calmer */
.glass{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}
.glass-strong{
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

/* Header */
header{
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(96%, var(--max));
  padding: clamp(10px, 2vw, 14px) clamp(12px, 3vw, 22px);
  border-radius: 999px;
  background: rgba(15,19,32,.72);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
header.scrolled{
  background: rgba(15,19,32,.86);
  border-color: rgba(255,255,255,.14);
}

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

.logo{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color: var(--text);
  font-weight: 800;
  letter-spacing:-0.02em;
  font-size: 1.05rem;

  min-width: 0;
  max-width: 60vw;
}
.logo span{
  background: linear-gradient(90deg, var(--text), rgba(233,236,241,.82));
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color: transparent;

  display: inline-block;
  max-width: 52vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logo-icon{
  width: 34px;
  height: 34px;
  filter: none;
}

/* Desktop nav */
.nav-links{
  list-style:none;
  display:flex;
  align-items:center;
  gap:8px;
}
.nav-links a{
  text-decoration:none;
  color: rgba(233,236,241,.85);
  font-weight: 600;
  font-size: .95rem;
  padding: 10px 14px;
  border-radius: 999px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-links a:hover{
  background: rgba(255,255,255,.06);
  color: var(--text);
  transform: translateY(-1px);
}
.nav-links a.active{
  background: rgba(167,139,250,.16);
  color: var(--text);
  border: 1px solid rgba(167,139,250,.22);
}
.nav-links a.external-link::after{
  content:" ↗";
  font-size:.85em;
  opacity:.85;
}

/* Mobile menu */
.mobile-menu-toggle{
  display:none;
  flex-direction:column;
  gap:5px;
  cursor:pointer;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}
.hamburger-line{
  width: 24px;
  height: 2px;
  border-radius:999px;
  background: rgba(233,236,241,.9);
  transition: transform .2s ease, opacity .2s ease;
}
.mobile-menu-toggle.active .hamburger-line:nth-child(1){ transform: rotate(45deg) translate(6px, 6px); }
.mobile-menu-toggle.active .hamburger-line:nth-child(2){ opacity: 0; }
.mobile-menu-toggle.active .hamburger-line:nth-child(3){ transform: rotate(-45deg) translate(6px, -6px); }

.mobile-nav{
  position: fixed;
  top: calc(var(--header-h) + 26px);
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 420px);
  display:none;
  flex-direction:column;
  gap: 10px;
  padding: 16px;
  background: rgba(15,19,32,.92);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);

  max-height: calc(100vh - (var(--header-h) + 46px));
  overflow: auto;
}
.mobile-nav.active{ display:flex; }
.mobile-nav a{
  text-decoration:none;
  color: rgba(233,236,241,.9);
  font-weight: 650;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}
.mobile-nav a:hover{ background: rgba(255,255,255,.08); }
.mobile-nav a.active{
  background: rgba(167,139,250,.18);
  border-color: rgba(167,139,250,.22);
}

/* Hero */
.hero{
  min-height: min(92vh, 820px);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding: calc(var(--header-h) + 28px) var(--pad) clamp(44px, 6vw, 60px);
}
.hero-content{
  max-width: 980px;
  margin: 0 auto;
  padding: 0;
}
.hero-subtitle{
  display:inline-block;
  font-size: .85rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(233,236,241,.75);
  margin-bottom: 16px;
}
.hero-subtitle::before,
.hero-subtitle::after{ display:none; }

.hero h1{
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing:-0.03em;
  margin-bottom: 18px;
  background: linear-gradient(90deg, var(--text), rgba(233,236,241,.78));
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color: transparent;
}

.hero-description{
  max-width: 68ch;
  margin: 0 auto 28px;
}
.hero-description p{
  color: rgba(233,236,241,.78);
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  font-weight: 400;
}

.hero-stats{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 14px;
  max-width: 720px;
  margin: 26px auto 28px;
}
.hero-stat{
  padding: 16px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
}
.hero-stat-number{
  display:block;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.hero-stat-label{
  font-size: .78rem;
  letter-spacing:.12em;
  text-transform:uppercase;
  color: rgba(233,236,241,.62);
}

.cta-buttons{
  display:flex;
  justify-content:center;
  gap: clamp(10px, 2.2vw, 12px);
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Buttons */
.cta-button,
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  padding: clamp(11px, 2.2vw, 12px) clamp(14px, 3vw, 18px);
  border-radius: 999px;
  text-decoration:none;
  font-weight: 750;
  font-size: clamp(.92rem, 1.6vw, 1rem);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  border: 1px solid transparent;
}
.cta-button{
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #0b0d12;
  box-shadow: 0 12px 26px rgba(167,139,250,.18);
}
.cta-button:hover{ transform: translateY(-2px); box-shadow: 0 18px 34px rgba(167,139,250,.25); }
.cta-button.secondary{
  background: transparent;
  color: rgba(233,236,241,.92);
  border-color: rgba(255,255,255,.18);
}
.cta-button.secondary:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.22);
}

/* Sections spacing */
.features,
.projects,
.timeline,
.contact{
  padding: var(--section-y) 0;
  scroll-margin-top: calc(var(--header-h) + 40px);
}

/* Containers (consistent padding) */
.features-container{
  width: min(100%, calc(var(--max) + 40px));
  margin: 0 auto;
  padding: 0 var(--pad);
}
.projects-grid{
  width: min(100%, calc(var(--max) + 40px));
  margin: 0 auto;
  padding: 0 var(--pad);
}
.timeline-container{
  width: min(100%, calc(var(--max) + 40px));
  margin: 0 auto;
  padding: 0 var(--pad);
  position: relative;
}
.contact-container{
  width: min(100%, calc(var(--max) + 40px));
  margin: 0 auto;
  padding: 0 var(--pad);
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.diagonal-grid{ display:flex; flex-direction:column; gap: 22px; }

/* Features */
.feature-row{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(14px, 2.5vw, 18px);
  align-items: stretch;
}
.feature-row:nth-child(even){ grid-template-columns: .9fr 1.1fr; }
.feature-content{
  padding: clamp(18px, 3vw, 26px);
  transform: none;
}
.feature-content:hover{ transform:none; box-shadow: var(--shadow-soft); }
.feature-icon{
  font-size: 2.2rem;
  margin-bottom: 12px;
  color: var(--text);
  -webkit-text-fill-color: initial;
  background: none;
}
.feature-content h3{
  font-size: 1.45rem;
  margin-bottom: 10px;
  color: var(--text);
}
.feature-content p{
  color: rgba(233,236,241,.74);
  font-size: 1.02rem;
}
.feature-visual{
  border-radius: var(--radius-lg);
  overflow:hidden;
  min-height: 240px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,.10);
}
.feature-visual::before{ display:none; }

/* Projects */
.projects{ position:relative; }
.projects-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.project-card {
  grid-column: span 12;
  overflow: hidden;
  padding: clamp(18px, 3vw, 22px);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.project-card:hover{
  transform: translateY(-4px);
  border-color: rgba(167,139,250,.22);
  box-shadow: var(--shadow);
}

@media (min-width: 720px){
  .project-card{ grid-column: span 6; }
}
@media (min-width: 1024px){
  .project-card{ grid-column: span 4; }
}

.project-header{
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 10px;
  min-width: 0;
}
.project-icon{ font-size: 1.6rem; }
.project-title{
  flex: 1 1 auto;
  min-width: 0;              /* KEY for flex overflow */
  overflow-wrap: anywhere;   /* breaks long words/strings */
  word-break: normal;
  hyphens: auto;
  line-height: 1.2;
}
.project-summary{
  margin: 10px 0 12px;
  margin-top: clamp(10px, 3vw, 16px);
  color: rgba(233,236,241,.72);
  line-height: 1.7;
  padding-top: 55px;
}
.project-highlights{
  margin: 0 0 12px 1.05rem;
  color: rgba(233,236,241,.74);
  display:grid;
  gap: 6px;
}
.project-tech{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.project-tech span{
  font-size: .78rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(167,139,250,.12);
  border: 1px solid rgba(167,139,250,.16);
  color: rgba(233,236,241,.86);
}

.project-actions{ display:flex; gap: 10px; flex-wrap:wrap; }
.btn{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(233,236,241,.92);
  box-shadow: none;
}
.btn:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}
.project-note{
  margin-top: 10px;
  color: rgba(233,236,241,.62);
  font-size: .92rem;
}

/* Timeline */
.timeline-line{
  position:absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(255,255,255,.10);
  border-radius: 999px;
  box-shadow: none;
}
.timeline-item{
  display:flex;
  justify-content:flex-end;
  padding-right: 54px;
  position:relative;
  margin-bottom: 26px;
}
.timeline-item:nth-child(even){
  justify-content:flex-start;
  padding-left: 54px;
  padding-right: 0;
}
.timeline-dot{
  position:absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border: 2px solid rgba(15,19,32,.9);
  box-shadow: none;
}
.timeline-content{
  max-width: min(520px, 100%);
  padding: clamp(18px, 3vw, 22px);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  transform:none;
}
.timeline-item:nth-child(even) .timeline-content{ transform:none; }
.timeline-content:hover{ transform:none; box-shadow: var(--shadow-soft); }
.timeline-year{
  font-size: 1.05rem;
  font-weight: 850;
  color: rgba(233,236,241,.9);
  margin-bottom: 8px;
}
.timeline-content h4{
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.timeline-content p{ color: rgba(233,236,241,.74); }

/* Contact */
.contact-info{ padding: clamp(18px, 3vw, 26px); }
.contact-info::before{ display:none; }

.contact-info h3{
  font-size: 1.8rem;
  margin-bottom: 12px;
}
.contact-info p{
  color: rgba(233,236,241,.74);
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.social-links{
  display:flex;
  gap: 10px;
  margin-top: 12px;
}
.social-links a{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  color: rgba(233,236,241,.88);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow:none;
}
.social-links a::before{ display:none; }
.social-links a:hover{
  transform: translateY(-2px);
  border-color: rgba(167,139,250,.18);
  background: rgba(255,255,255,.08);
}

.contact-form{ padding: clamp(18px, 3vw, 26px); }
.form-group{ margin-bottom: 12px; }
.form-group input,
.form-group textarea{
  width:100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(233,236,241,.92);
  font-size: 1rem;
}
.form-group input::placeholder,
.form-group textarea::placeholder{ color: rgba(233,236,241,.45); }

.form-group input:focus,
.form-group textarea:focus{
  outline:none;
  border-color: rgba(34,211,238,.55);
  box-shadow: 0 0 0 4px rgba(34,211,238,.12);
  background: rgba(255,255,255,.06);
}

.submit-btn{
  width:100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #0b0d12;
  font-weight: 850;
  cursor:pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 12px 26px rgba(167,139,250,.18);
}
.submit-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(167,139,250,.24);
}

/* Footer */
footer{
  padding: 44px var(--pad) 34px;
  border-top: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
}
.footer-content{
  width: min(100%, var(--max));
  margin: 0 auto;
}
.footer-links{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.footer-links a{
  color: rgba(233,236,241,.70);
  text-decoration:none;
  font-size: .92rem;
}
.footer-links a:hover{ color: rgba(233,236,241,.92); }
.footer-links a::after{ display:none; }

.footer-copyright{
  color: rgba(233,236,241,.55);
  font-size: .9rem;
}

/* Responsive */
@media (max-width: 1000px){
  .nav-links{ display:none; }
  .mobile-menu-toggle{ display:flex; }
}

@media (max-width: 900px){
  .feature-row,
  .feature-row:nth-child(even){
    grid-template-columns: 1fr;
  }
  .contact-container{
    grid-template-columns: 1fr;
  }

  .timeline-line{ left: 18px; transform:none; }
  .timeline-item,
  .timeline-item:nth-child(even){
    justify-content:flex-start;
    padding-left: 46px;
    padding-right: 0;
  }
  .timeline-dot{ left: 18px; transform:none; }

  .hero-stat{ padding: 14px 12px; }
}

@media (max-width: 640px){
  header{ top: 12px; border-radius: 18px; }

  .cta-buttons{
    flex-direction: column;
    align-items: center;
  }
  .cta-button{ width: min(100%, 420px); }

  .feature-visual{ min-height: 200px; }

  .social-links a{
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 380px){
  .hero-subtitle{ letter-spacing: .18em; }
  .mobile-menu-toggle{ padding: 8px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation:none !important; transition:none !important; scroll-behavior:auto !important; }
}
/* =========================
   Mobile fixes (paste LAST)
   ========================= */

/* Stop accidental horizontal clipping from big text */
html, body { overflow-x: clip; }

/* HERO: give real side padding + prevent headline clipping */
.hero { padding-inline: var(--pad); }

.hero-content{
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
  padding-inline: clamp(10px, 4vw, 18px); /* key: keeps text away from edges */
}

/* Make the headline wrap nicely instead of overflowing */
.hero h1{
  max-width: 18ch;
  margin-inline: auto;
  text-wrap: balance;          /* modern browsers */
  overflow-wrap: anywhere;     /* safety */
  word-break: normal;
  hyphens: auto;
}

/* Subtitle letter spacing is too wide on phones */
@media (max-width: 480px){
  .hero-subtitle{ letter-spacing: .18em; }
}

/* STATS: never force 3 tiny columns on mobile */
.hero-stats{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 640px){
  .hero-stats{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 420px){
  .hero-stats{
    grid-template-columns: 1fr;
    max-width: 420px;
  }
  .project-title{ 
    font-size: 1.05rem; 
  }
  .project-card {
    padding-top: 20%;
  }
}

/* Cards: make them feel less cramped */
.hero-stat{
  padding: clamp(14px, 3.5vw, 16px);
}
.hero-stat-number{
  font-size: clamp(1.1rem, 4vw, 1.25rem);
}

/* Buttons: stack cleanly and full width on small screens */
@media (max-width: 640px){
  .cta-buttons{
    flex-direction: column;
    align-items: stretch;
    max-width: 420px;
    margin-inline: auto;
  }
  .cta-button, .btn{
    width: 100%;
  }
}

/* Header: slightly tighter on small screens */
@media (max-width: 640px){
  header{
    width: min(96%, var(--max));
    padding: 10px 12px;
    border-radius: 18px;
    top: 12px;
  }
}
