/* ==========================================================================
   magnesh.com — design tokens
   ========================================================================== */

:root {
  /* Surfaces */
  --bg:        #0b0d12;
  --bg-alt:    #10131a;
  --surface:   #151922;
  --surface-2: #1b2029;
  --border:    #262c38;
  --border-2:  #333b4a;

  /* Text */
  --text:      #e9edf5;
  --text-mute: #9aa4b8;
  --text-dim:  #6b7688;

  /* Accent */
  --accent:     #5b8cff;
  --accent-2:   #9d7bff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(91, 140, 255, 0.12);

  --success: #3ddc97;

  /* Shape */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;

  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.22);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 18px 48px rgba(0,0,0,.35);

  --wrap: 1120px;
  --nav-h: 68px;
}

:root[data-theme="light"] {
  --bg:        #ffffff;
  --bg-alt:    #f6f7fb;
  --surface:   #ffffff;
  --surface-2: #f2f4f9;
  --border:    #e3e7ef;
  --border-2:  #d2d8e4;

  --text:      #131722;
  --text-mute: #566076;
  --text-dim:  #7b869b;

  --accent:     #2f5fe0;
  --accent-2:   #7a4dea;
  --accent-soft: rgba(47, 95, 224, 0.09);

  --shadow:    0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.06);
  --shadow-lg: 0 2px 4px rgba(16,24,40,.06), 0 18px 48px rgba(16,24,40,.10);
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.022em;
  font-weight: 700;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

svg {
  width: 1em; height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  text-decoration: none;
}
.skip-link:focus { left: 16px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Nav
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--bg); /* fallback where color-mix is unsupported */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background-color .2s ease;
}
.nav.is-stuck { border-bottom-color: var(--border); }

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

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav__mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav__links a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-mute);
  text-decoration: none;
  transition: color .16s ease, background-color .16s ease;
}
.nav__links a:hover { color: var(--text); background: var(--surface-2); }
.nav__links a.is-active { color: var(--text); background: var(--accent-soft); }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  padding: 0;
  font-size: 18px;
  color: var(--text-mute);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}
.iconbtn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-2); }

.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun  { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

.nav__burger { display: none; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .14s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn svg { font-size: 17px; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -6px rgba(91,140,255,.5);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 65%, transparent);
}
.btn--primary:hover { box-shadow: 0 10px 26px -6px color-mix(in srgb, var(--accent) 75%, transparent); }

.btn--ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-2); }

.btn--block { display: flex; width: 100%; margin-top: 18px; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.link svg { font-size: 15px; transition: transform .16s ease; }
.link:hover svg { transform: translate(2px, -2px); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 11vw, 120px) 0 clamp(56px, 8vw, 88px);
}

.hero__glow {
  position: absolute;
  top: -340px;
  left: 50%;
  width: 900px;
  height: 640px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--accent) 26%, transparent), transparent 72%),
    radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 70%);
  background-position: 30% 50%, 72% 40%;
  background-size: 62% 100%, 58% 92%;
  background-repeat: no-repeat;
  filter: blur(18px);
  opacity: .85;
}
:root[data-theme="light"] .hero__glow { opacity: .5; }

.hero__inner { position: relative; }

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  padding: 6px 14px 6px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-mute);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
}

.hero__title {
  max-width: 17ch;
  margin: 0 0 22px;
  font-size: clamp(2.35rem, 6.4vw, 4.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 62%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lede {
  max-width: 56ch;
  margin: 0 0 32px;
  font-size: clamp(1.02rem, 1.7vw, 1.2rem);
  color: var(--text-mute);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin: 56px 0 0;
  padding: 0;
}
.stat {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.stat dt {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.stat dd {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.stat dd span { color: var(--accent); }

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: clamp(64px, 9vw, 104px) 0;
  border-top: 1px solid var(--border);
}
.section--alt { background: var(--bg-alt); }

.kicker {
  margin: 0 0 14px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.section__head { margin-bottom: 40px; }
.section__head h2 {
  margin-bottom: 12px;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
}
.section__head p {
  max-width: 58ch;
  color: var(--text-mute);
}

/* ==========================================================================
   Card
   ========================================================================== */

.card {
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

/* ==========================================================================
   About
   ========================================================================== */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.about__text h2 {
  margin-bottom: 20px;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
}
.about__text p {
  max-width: 62ch;
  font-size: 1.04rem;
  color: var(--text-mute);
}

.about__note {
  margin-top: 24px;
  padding: 14px 18px;
  font-size: .94rem;
  color: var(--text-mute);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.about__note strong { color: var(--text); }

.about__card h3 {
  margin-bottom: 18px;
  font-size: 1.06rem;
}

.deflist { margin: 0; padding: 0; list-style: none; }
.deflist li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.deflist li:last-child { border-bottom: 0; }
.deflist span { color: var(--text-dim); }
.deflist em { font-style: normal; font-weight: 600; text-align: right; }

/* ==========================================================================
   Projects
   ========================================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.proj {
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.proj:hover {
  transform: translateY(-3px);
  border-color: var(--border-2);
  box-shadow: var(--shadow-lg);
}

.proj__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.proj h3 {
  margin-bottom: 10px;
  font-size: 1.22rem;
}
.proj p {
  margin-bottom: 20px;
  font-size: .96rem;
  color: var(--text-mute);
}

.proj__links { margin-top: auto; }

.proj--empty {
  border-style: dashed;
  box-shadow: none;
  background: transparent;
}
.proj--empty:hover { transform: none; box-shadow: none; }

.tag {
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-mute);
  background: var(--surface-2);
  border-radius: 999px;
}
.tag--live {
  color: var(--success);
  background: rgba(61,220,151,.14);
  background: color-mix(in srgb, var(--success) 14%, transparent);
}
.tag--soon {
  color: var(--accent);
  background: var(--accent-soft);
}

.proj__year {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-mute);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.chips--lg { margin-bottom: 0; }
.chips--lg li { padding: 6px 13px; font-size: 13.5px; }

/* ==========================================================================
   Skills
   ========================================================================== */

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
}
.skillcard h3 {
  margin-bottom: 16px;
  font-size: 1.06rem;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact {
  padding: clamp(32px, 5vw, 52px);
  text-align: center;
}
.contact .kicker { margin-bottom: 12px; }
.contact h2 {
  margin-bottom: 14px;
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
}
.contact > p {
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: 30px;
  color: var(--text-mute);
}
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dim);
}
.footer p { margin: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 720px) {
  .nav__burger { display: grid; }

  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 12px 20px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav__links a {
    padding: 13px 14px;
    border-radius: var(--r-sm);
    font-size: 16px;
  }

  .stats { grid-template-columns: 1fr; max-width: none; margin-top: 40px; }
  .stat { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
  .stat dt { margin: 0; }

  .hero__cta .btn { flex: 1 1 auto; }
  .contact__actions .btn { width: 100%; }
}

@media (max-width: 420px) {
  .nav__name { display: none; }
}
