/* ------------------------------------------------------------
   BASE + THEME
------------------------------------------------------------ */

:root {
  /* Light theme */
  --bg: #f7f9fc;
  --bg-alt: #edf2ff;
  --surface: #ffffff;
  --surface-alt: #f3f4ff;
  --border-subtle: #e5e7eb;

  --text: #0f172a;
  --text-muted: #6b7280;

  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --primary-strong: #1d4ed8;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-subtle: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-strong: 0 20px 40px rgba(15, 23, 42, 0.14);

  --max-width: 1100px;

  --transition-fast: 150ms ease-out;
  --transition-med: 220ms ease;
}

/* Auto dark mode using system preference */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020617;
    --bg-alt: #020617;
    --surface: #020617;
    --surface-alt: #020617;
    --border-subtle: #1f2937;

    --text: #e5e7eb;
    --text-muted: #9ca3af;

    --primary: #60a5fa;
    --primary-soft: rgba(37, 99, 235, 0.2);
    --primary-strong: #3b82f6;

    --shadow-subtle: 0 4px 18px rgba(15, 23, 42, 0.6);
    --shadow-strong: 0 26px 55px rgba(15, 23, 42, 0.85);
  }
}

/* Optional manual override:
   Will add class="theme-dark" on <body> to force dark mode.
*/
body.theme-dark {
  --bg: #020617;
  --bg-alt: #020617;
  --surface: #020617;
  --surface-alt: #020617;
  --border-subtle: #1f2937;

  --text: #e5e7eb;
  --text-muted: #9ca3af;

  --primary: #60a5fa;
  --primary-soft: rgba(37, 99, 235, 0.2);
  --primary-strong: #3b82f6;

  --shadow-subtle: 0 4px 18px rgba(15, 23, 42, 0.6);
  --shadow-strong: 0 26px 55px rgba(15, 23, 42, 0.85);
}

/* Reset / global */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: radial-gradient(circle at top, var(--bg-alt), var(--bg));
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition:
    background var(--transition-med),
    color var(--transition-med);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

/* Layout containers */

.section,
.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ------------------------------------------------------------
   TYPOGRAPHY & UTILITIES
------------------------------------------------------------ */

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.9rem, 3vw, 2.3rem);
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.section {
  padding: 4.5rem 0;
}

.section__header {
  margin-bottom: 2rem;
}

.section__subtitle {
  max-width: 600px;
}

/* Subtle fade-up animation utility */

[data-animate="fade-up"] {
  opacity: 0;
  transform: translateY(18px);
  animation: fade-up 0.7s var(--transition-med) forwards;
}

[data-animate-delay="1"] {
  animation-delay: 0.1s;
}
[data-animate-delay="2"] {
  animation-delay: 0.2s;
}
[data-animate-delay="3"] {
  animation-delay: 0.3s;
}

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus styles */

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   NAVBAR
------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.8),
    rgba(15, 23, 42, 0.6),
    transparent
  );
}

body:not(.theme-dark) .site-header {
  background: linear-gradient(
    to bottom,
    rgba(247, 249, 252, 0.96),
    rgba(247, 249, 252, 0.9),
    transparent
  );
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.navbar__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11.3rem;
  height: 2.3rem;
  /* border-radius: 999px; */
  /* border: 1px solid var(--border-subtle); */
  /* background: radial-gradient(circle at top, var(--primary-soft), var(--surface)); */
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  color: var(--text);
  /* box-shadow: var(--shadow-subtle); */
}

.navbar__logo::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--primary);
}

.navbar__menu {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.95rem;
}

.navbar__link {
  position: relative;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.navbar__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
  transition: width var(--transition-fast);
}

.navbar__link:hover {
  color: var(--text);
}

.navbar__link:hover::after {
  width: 100%;
}

/* Mobile nav toggle */

.navbar__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

.navbar__toggle-line {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  display: block;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.navbar__toggle-line + .navbar__toggle-line {
  margin-top: 4px;
}

.navbar__toggle.is-open .navbar__toggle-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.navbar__toggle.is-open .navbar__toggle-line:nth-child(2) {
  opacity: 0;
}
.navbar__toggle.is-open .navbar__toggle-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ------------------------------------------------------------
   HERO
------------------------------------------------------------ */

.hero {
  padding: 6rem 0 4.5rem;
  /* height: 100vh; */
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.hero__content {
  min-width: 0;
}

.hero__kicker {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--primary-strong);
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.hero__title {
  margin-bottom: 0.75rem;
}

.hero__subtitle {
  max-width: 36rem;
  margin-bottom: 1.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero__visual {
  display: flex;
  justify-content: center;
}

.hero__placeholder {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 3;
  border-radius: 1.25rem;
  /* background: radial-gradient(
      circle at top left,
      var(--primary-soft),
      transparent 55%
    ),
    radial-gradient(circle at bottom right, var(--primary-soft), transparent 55%),
    var(--surface); */
  background-color: #fff;
  box-shadow: var(--shadow-strong);
  position: relative;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  align-items: center; /* centers horizontally */
  justify-content: center; /* centers vertically (if container has height) */
  text-align: center;
  gap: 10px;
}

.hero__placeholder img {
  max-width: 250px;
}

/* Demo "data viz" elements inside placeholder */

/* .hero__placeholder::before,
.hero__placeholder::after {
  content: "";
  position: absolute;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.6);
} */

/* .hero__placeholder::before {
  inset: 18%;
} */

/* .hero__placeholder::after {
  inset: 32%;
  border-style: dashed;
  opacity: 0.7;
} */

.hero__placeholder span {
  position: absolute;
  inset: auto 0 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary-strong);
}

/* ------------------------------------------------------------
   BUTTONS
------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.btn--primary {
  background: radial-gradient(circle at top left, #60a5fa, var(--primary-strong));
  color: #fff;
  box-shadow: var(--shadow-subtle);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-strong);
}

.btn--secondary {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.5);
  color: var(--text);
}

.btn--secondary:hover {
  border-color: var(--primary);
  background: rgba(148, 163, 184, 0.08);
}

/* ------------------------------------------------------------
   PROJECTS
------------------------------------------------------------ */

.section--projects {
  position: relative;
}

.section--projects::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top,
    rgba(37, 99, 235, 0.08),
    transparent 55%
  );
  opacity: 0.6;
  pointer-events: none;
}

.projects__grid {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  display: grid;
  gap: 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card {
  background: var(--surface);
  border-radius: 1.1rem;
  box-shadow: var(--shadow-subtle);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-med),
    background var(--transition-med);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
  border-color: rgba(37, 99, 235, 0.45);
  background: radial-gradient(circle at top, var(--primary-soft), var(--surface));
}

.thumb-placeholder {
  height: 160px;
  border-radius: 0.9rem;
  background: linear-gradient(
    135deg,
    var(--primary-soft),
    rgba(148, 163, 184, 0.16)
  );
  display: grid;
  place-items: center;
  color: var(--primary-strong);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.thumb-placeholder::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: inherit;
  border: 1px dashed rgba(148, 163, 184, 0.8);
}

.project-card__title {
  margin-bottom: 0.3rem;
}

.project-card__description {
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

.project-card__tags {
  list-style: none;
  margin: 0.3rem 0 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  background: var(--primary-soft);
  color: var(--primary-strong);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
}

.project-card__actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.project-card__link {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--primary-strong);
  position: relative;
  padding-right: 1rem;
}

.project-card__link::after {
  content: "↗";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.8rem;
}

/* ------------------------------------------------------------
   SKILLS
------------------------------------------------------------ */

.skills__grid {
  display: grid;
  gap: 1.8rem;
  margin-top: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.skills__group {
  background: var(--surface);
  border-radius: 1.1rem;
  padding: 1.3rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: var(--shadow-subtle);
}

.skills__group-title {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.skills__list {
  list-style: none;
  padding: 0;
}

.skills__list li {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0.28rem 0;
}

/* ------------------------------------------------------------
   EXPERIENCE / TIMELINE
------------------------------------------------------------ */

.timeline {
  display: grid;
  gap: 1.7rem;
  margin-top: 2rem;
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.3rem;
  bottom: 0.3rem;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(
    to bottom,
    var(--primary),
    rgba(148, 163, 184, 0.2)
  );
}

.timeline__item {
  position: relative;
  background: var(--surface);
  padding: 1.2rem 1.2rem 1.2rem 1.3rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-subtle);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -1.09rem;
  top: 1.25rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.22);
}

.timeline__org,
.timeline__dates {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.timeline__dates {
  margin-bottom: 0.4rem;
}

.timeline__details {
  margin-left: 1rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   ABOUT
------------------------------------------------------------ */

.about__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: 2.2rem;
  margin-top: 2rem;
  align-items: center;
}

.about__photo {
  display: flex;
  justify-content: center;
}

.photo-placeholder {
  width: 180px;       
  height: 180px;      
  border-radius: 50%; 
  overflow: hidden;   
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
}

.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;   
  object-position: center;
  display: block;
}

.about__content p:last-of-type {
  margin-bottom: 0.8rem;
}

.about__highlights {
  list-style: none;
  padding: 0;
  font-size: 0.95rem;
}

.about__highlights li + li {
  margin-top: 0.3rem;
}

/* ------------------------------------------------------------
   WRITING / BLOG
------------------------------------------------------------ */

.writing__list {
  margin-top: 2rem;
  display: grid;
  gap: 1.4rem;
}

.post-card {
  background: var(--surface);
  padding: 1.2rem 1.3rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-subtle);
  border-color: rgba(37, 99, 235, 0.45);
  background: radial-gradient(circle at top left, var(--primary-soft), var(--surface));
}

.post-card__title a {
  text-decoration: none;
}

.post-card__title a:hover {
  text-decoration: underline;
}

.post-card__meta {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

/* ------------------------------------------------------------
   CONTACT
------------------------------------------------------------ */

.section--contact {
  padding-bottom: 4rem;
}

.contact__layout {
  display: grid;
  gap: 2.2rem;
  margin-top: 2rem;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  align-items: flex-start;
}

.contact__info p {
  margin-bottom: 0.6rem;
}

.contact__info a {
  color: var(--primary-strong);
  text-decoration: none;
}

.contact__info a:hover {
  text-decoration: underline;
}

.contact__form .form__field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

input,
textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 0.7rem;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.02);
  color: var(--text);
  font-size: 0.95rem;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
  background: var(--surface);
}

/* ------------------------------------------------------------
   FOOTER
------------------------------------------------------------ */

.site-footer {
  padding: 2rem 1.25rem 2.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
}

.site-footer__back-to-top {
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--primary-strong);
}

/* ------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------ */

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__visual {
    order: -1;
  }

  .about__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__inner {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .navbar__menu {
    position: fixed;
    inset: 3.4rem 1rem auto;
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    box-shadow: var(--shadow-subtle);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    transform-origin: top;
    transform: scaleY(0.8);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity var(--transition-fast),
      transform var(--transition-fast);
  }

  /* Will add .is-open on the menu via JS */
  .navbar__menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: scaleY(1);
  }

  .navbar__toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.35rem;
  }

  .navbar__menu a {
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 3.2rem 0;
  }

  .hero {
    padding-top: 5rem;
  }

  .hero__actions {
    gap: 0.6rem;
  }
}
