/* ==========================================================================
   DESIGN TOKENS
   One place to tweak color, type, and spacing for the whole site.
   ========================================================================== */
:root {
  /* Surfaces — a layering system so panels read as "closer" to the viewer */
  --bg-base: #0b1526;       /* page background */
  --bg-elevated: #10203a;   /* nav, section dividers */
  --bg-floating: #16284a;   /* cards, highlighted panels */

  /* Text */
  --text: #edf1f8;
  --text-muted: #91a4c4;
  --text-faint: #5f7295;

  /* The one accent color, used sparingly for emphasis and interaction */
  --accent: #f2a33c;
  --accent-soft: rgba(242, 163, 60, 0.14);
  --accent-dim: #c98331;

  --border: rgba(237, 241, 248, 0.09);
  --border-strong: rgba(237, 241, 248, 0.16);

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;

  /* Spacing scale (8px base) */
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  --space-8: 6rem;

  --container-width: 920px;
  --radius: 14px;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Visible keyboard focus everywhere — accessibility floor */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 21, 38, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  gap: var(--space-5);
}

.nav__links a {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav__links a:hover {
  color: var(--text);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav__toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Mobile nav */
@media (max-width: 640px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav__links a {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
  }

  body.nav-open .nav__links {
    max-height: 320px;
  }

  body.nav-open .nav__toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  body.nav-open .nav__toggle span:nth-child(2) {
    opacity: 0;
  }
  body.nav-open .nav__toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(5rem, 14vw, 9rem) 0 clamp(4rem, 10vw, 6rem);
}

/* Layered radial gradients + a subtle noise filter for depth, per brief */
.hero__glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 50% at 18% 10%, rgba(242, 163, 60, 0.16), transparent 70%),
    radial-gradient(40% 40% at 85% 30%, rgba(90, 130, 200, 0.14), transparent 70%);
  pointer-events: none;
}

.hero__glow::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero__content {
  position: relative;
  z-index: 1;
  animation: hero-in 0.7s ease both;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__name {
  font-size: clamp(2.75rem, 8vw, 4.75rem);
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.hero__tagline {
  margin-top: var(--space-3);
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--text-muted);
  max-width: 34ch;
}

.hero__status {
  margin-top: var(--space-2);
  font-size: 0.9rem;
  color: var(--accent);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* ==========================================================================
   BUTTONS
   Only transform/opacity animate — never transition-all.
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn--primary {
  background: var(--accent);
  color: #1a1206;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 24px -10px rgba(242, 163, 60, 0.55);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 32px -12px rgba(242, 163, 60, 0.65);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--secondary:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn--secondary:active {
  transform: translateY(0);
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  border-top: 1px solid var(--border);
}

.section__heading {
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
  letter-spacing: -0.02em;
}

.section__intro {
  margin-top: var(--space-2);
  color: var(--text-muted);
  max-width: 56ch;
}

.about__text {
  margin-top: var(--space-4);
  max-width: 62ch;
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* ==========================================================================
   EXPERIENCE TIMELINE
   ========================================================================== */
.timeline {
  position: relative;
  margin-top: var(--space-6);
  padding-left: var(--space-5);
  border-left: 1px solid var(--border-strong);
}

.timeline__item {
  position: relative;
  margin-bottom: var(--space-6);
}

.timeline__item:last-child {
  margin-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: calc(var(--space-5) * -1 - 5px);
  top: 0.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 2px solid var(--text-faint);
}

.timeline__item--highlight .timeline__dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline__card {
  padding: var(--space-4);
  border-radius: var(--radius);
}

.timeline__card--highlight {
  background: var(--bg-floating);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  padding: var(--space-5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 24px 48px -28px rgba(0, 0, 0, 0.6);
}

.timeline__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}

.timeline__role {
  font-size: 1.15rem;
}

.timeline__org {
  margin-top: 0.25rem;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
}

.timeline__dates {
  color: var(--text-faint);
  font-size: 0.85rem;
  white-space: nowrap;
}

.timeline__bullets {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.timeline__bullets li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.timeline__bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}

/* ==========================================================================
   PROJECTS
   ========================================================================== */
.projects {
  margin-top: var(--space-6);
  display: grid;
  grid-template-columns: 1fr; /* mobile: cards stack */
  gap: var(--space-4);
}

/* Wider screens: two cards side by side; grid rows stretch them to equal height */
@media (min-width: 720px) {
  .projects {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  background: var(--bg-floating);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  /* Column flex so the buttons sit at the bottom of every card (equal-height cards) */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 20px 40px -24px rgba(0, 0, 0, 0.55);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Lift + warm accent glow on hover, and when a link inside has keyboard focus */
.project-card:hover,
.project-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(242, 163, 60, 0.35);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25), 0 28px 48px -24px rgba(0, 0, 0, 0.6), 0 18px 40px -28px rgba(242, 163, 60, 0.35);
}

.project-card:active {
  transform: translateY(-2px);
}

.project-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

/* Small dot that marks a project as live */
.project-card__badge--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 163, 60, 0.2);
}

/* Tech stack tags */
.project-card__tags {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.project-card__tags li {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: auto; /* push to the bottom of the card */
  padding-top: var(--space-4);
}

/* Smaller button size for use inside cards */
.btn--small {
  padding: 0.6rem 1.15rem;
  font-size: 0.875rem;
}

.project-card__title {
  margin-top: var(--space-3);
  font-size: 1.15rem;
}

.project-card__desc {
  margin-top: var(--space-2);
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   SKILLS
   ========================================================================== */
.skills {
  margin-top: var(--space-6);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 640px) {
  .skills {
    grid-template-columns: 1fr;
  }
}

/* Languages reads as a different kind of list (proficiency, not tools),
   so it breaks out of the 3-column grid as its own full-width row. */
.skills__languages {
  grid-column: 1 / -1;
  margin-top: var(--space-2);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
}

.skills__languages .skills__label {
  width: 100%;
  border-bottom: none;
  padding-bottom: 0;
}

.skills__lang-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.skills__lang-item span:first-child {
  color: var(--text);
}

.skills__level {
  color: var(--text-faint);
  font-size: 0.85rem;
}

.skills__label {
  font-size: 0.95rem;
  color: var(--text-faint);
  font-weight: 600;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.skills__list {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skills__list li {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-links {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem var(--space-3);
  padding: var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--border);
  transition: transform 0.2s ease, color 0.2s ease;
}

.contact-link:hover {
  transform: translateX(6px);
  color: var(--accent);
}

.contact-link__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.contact-link__value {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contact-link:hover .contact-link__value {
  color: var(--accent);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-5) 0;
}

.footer__inner {
  color: var(--text-faint);
  font-size: 0.85rem;
}
