/* Root variables keep the dark blue theme consistent across the page. */
:root {
  --color-bg: #06111f;
  --color-bg-soft: #0b1d33;
  --color-surface: #102843;
  --color-surface-light: #15395f;
  --color-primary: #38bdf8;
  --color-primary-strong: #0ea5e9;
  --color-text: #f8fafc;
  --color-text-muted: #b7c6d8;
  --color-border: rgba(148, 163, 184, 0.22);
  --shadow-card: 0 1.5rem 4rem rgba(0, 0, 0, 0.28);
  --container-width: 72rem;
  --header-height: 4.5rem;
  --mouse-x: 50vw;
  --mouse-y: 50vh;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.16), transparent 26rem),
    linear-gradient(135deg, #06111f 0%, #07182b 48%, #0b1d33 100%);
  color: var(--color-text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* The glow is visual only and follows CSS variables updated in JavaScript. */
.background-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    circle 18rem at var(--mouse-x) var(--mouse-y),
    rgba(56, 189, 248, 0.18),
    rgba(14, 165, 233, 0.08) 36%,
    transparent 70%
  );
  transition: opacity 180ms ease;
}

.container {
  width: min(100% - 2rem, var(--container-width));
  margin-inline: auto;
}

.section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.section-muted {
  background: rgba(5, 17, 32, 0.42);
  border-block: 1px solid var(--color-border);
}

.section-label,
.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.12;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.7rem, 9vw, 5.4rem);
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 5vw, 3rem);
}

h3 {
  margin-bottom: 0.7rem;
  font-size: 1.25rem;
}

p {
  margin-top: 0;
  color: var(--color-text-muted);
}

/* Header and navigation are mobile-first, with desktop rules below. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
  background: rgba(6, 17, 31, 0.84);
  backdrop-filter: blur(1rem);
}

.navbar {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
}

.logo-mark {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: 0.7rem;
  background: rgba(56, 189, 248, 0.12);
  color: var(--color-primary);
  font-size: 0.85rem;
}

.nav-toggle {
  display: inline-flex;
  width: 2.8rem;
  height: 2.8rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  border: 1px solid var(--color-border);
  border-radius: 0.8rem;
  background: rgba(16, 40, 67, 0.86);
  cursor: pointer;
}

.nav-toggle span {
  width: 1.2rem;
  height: 0.12rem;
  border-radius: 999px;
  background: var(--color-text);
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.nav-toggle.is-active span:nth-child(1) {
  transform: translateY(0.44rem) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active span:nth-child(3) {
  transform: translateY(-0.44rem) rotate(-45deg);
}

.nav-links {
  position: fixed;
  inset: var(--header-height) 1rem auto;
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 1rem;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: rgba(8, 24, 42, 0.97);
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.8rem);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

.nav-links a {
  display: block;
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 700;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(56, 189, 248, 0.1);
  color: var(--color-text);
}

.hero {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  align-items: center;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero-role {
  max-width: 42rem;
  color: var(--color-text);
  font-size: clamp(1.18rem, 4vw, 1.6rem);
  font-weight: 700;
}

.hero-text {
  max-width: 42rem;
  font-size: 1.05rem;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font-weight: 800;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-0.12rem);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
  color: #03111f;
}

.btn-secondary {
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
}

.hero-card,
.contact-card {
  border: 1px solid var(--color-border);
  border-radius: 1.5rem;
  background:
    linear-gradient(145deg, rgba(21, 57, 95, 0.82), rgba(10, 29, 51, 0.88)),
    rgba(16, 40, 67, 0.8);
  box-shadow: var(--shadow-card);
}

.hero-card {
  padding: clamp(1.4rem, 5vw, 2rem);
}
.profile-photo{
  width: 60%;
  height: auto;
  border-radius: 10%;
}

.profile-orbit {
  display: grid;
  width: min(100%, 17rem);
  aspect-ratio: 1;
  place-items: center;
  margin: 0 auto 1.5rem;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(56, 189, 248, 0.18), transparent 56%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05) 0 1px,
      transparent 1px 2rem
    );
}

.profile-avatar {
  display: grid;
  width: 8.4rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.7);
  border-radius: 2rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(14, 165, 233, 0.35));
  color: #03111f;
  font-size: 2.4rem;
  font-weight: 900;
  box-shadow: 0 1rem 3rem rgba(56, 189, 248, 0.2);
}

.profile-list {
  display: grid;
  gap: 0.8rem;
  margin: 1.3rem 0 0;
  padding: 0;
  list-style: none;
}

.profile-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--color-border);
}

.profile-list span {
  color: var(--color-text-muted);
}

.profile-list strong {
  color: var(--color-text);
}

.section-grid,
.learning-layout {
  display: grid;
  gap: 2rem;
}

.section-text {
  max-width: 45rem;
}

.section-heading {
  max-width: 46rem;
  margin-bottom: 2.2rem;
}

.skills-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.skill-card,
.project-card {
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: rgba(16, 40, 67, 0.58);
}

.skill-card {
  padding: 1.25rem;
}

.skill-card h3 {
  color: var(--color-primary);
}

.project-card {
  display: flex;
  min-height: 18rem;
  flex-direction: column;
  padding: 1.35rem;
}

.project-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card a {
  width: fit-content;
  margin-top: auto;
  color: var(--color-primary);
  font-weight: 800;
}

.project-card a:hover,
.project-card a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--color-text);
}

.timeline {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: rgba(16, 40, 67, 0.58);
}

.timeline span {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 0.7rem;
  background: rgba(56, 189, 248, 0.12);
  color: var(--color-primary);
  font-weight: 900;
}

.timeline p {
  margin-bottom: 0;
}

.contact-card {
  padding: clamp(1.6rem, 5vw, 3rem);
  text-align: center;
}

.contact-card p {
  max-width: 46rem;
  margin-inline: auto;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  margin-top: 2rem;
  text-align: left;
}

.contact-link {
  display: flex;
  min-height: 6.5rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.15rem;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: rgba(6, 17, 31, 0.5);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.contact-link:hover,
.contact-link:focus-visible {
  border-color: rgba(56, 189, 248, 0.75);
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-0.15rem);
}

.contact-link span {
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-link strong {
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  background: rgba(4, 12, 24, 0.8);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.footer-content p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.site-footer a {
  color: var(--color-primary);
  font-weight: 800;
}

/* The legal page reuses the portfolio theme with a compact reading width. */
.legal-page {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
}

.legal-header {
  border-bottom: 1px solid var(--color-border);
  background: rgba(6, 17, 31, 0.84);
}

.legal-navigation {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.legal-navigation > a:last-child {
  color: var(--color-primary);
  font-weight: 800;
}

.legal-content {
  width: min(100% - 2rem, 48rem);
  margin-inline: auto;
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.legal-content > h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
}

.legal-card {
  padding: clamp(1.4rem, 5vw, 2.5rem);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: rgba(16, 40, 67, 0.58);
}

.legal-card section + section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.legal-card address {
  color: var(--color-text-muted);
  font-style: normal;
}

.legal-card a {
  color: var(--color-primary);
}

.legal-card a:hover,
.legal-card a:focus-visible {
  color: var(--color-text);
}

/* Mobile phones: extra compact spacing and full-width touch targets. */
@media (max-width: 600px) {
  .container {
    width: min(100% - 1.25rem, var(--container-width));
  }

  .section {
    padding: 3.5rem 0;
  }

  .hero-actions .btn,
  .contact-actions .btn {
    width: 100%;
  }

  .hero-card {
    border-radius: 1.15rem;
  }

  .project-card {
    min-height: auto;
  }
}

/* Tablets: keep content spacious while reducing multi-column density. */
@media (min-width: 601px) and (max-width: 1024px) {
  .container {
    width: min(100% - 2.5rem, var(--container-width));
  }

  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .section-grid,
  .learning-layout {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

/* Desktop: horizontal navigation and wider two-column hero layout. */
@media (min-width: 1025px) {
  .nav-toggle {
    display: none;
  }

  .nav-links {
    position: static;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav-links a {
    padding: 0.55rem 0.8rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
  }

  .section-grid,
  .learning-layout {
    grid-template-columns: minmax(16rem, 0.8fr) minmax(0, 1.2fr);
  }
}

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