/* ==========================================================================
   Portfolio — style.css
   A minimalist, modern, single-page portfolio stylesheet.
   Uses a system font stack, Flexbox layout, and a restrained color palette.
   ========================================================================== */

/* ---------- CSS Custom Properties (Color Palette & Spacing) ---------- */
:root {
  /* Neutral palette — light */
  --color-bg: #f0f4f8;
  --color-surface: #ffffff;
  --color-border: #d1d9e0;
  --color-text: #1a1d27;
  --color-text-muted: #5a6478;

  /* Accent — blue (matches header) */
  --color-accent: #0d1f4e;
  --color-accent-hover: #0a1840;
  --color-accent-light: #dde3f0;

  /* Footer */
  --color-footer-bg: #0f172a;
  --color-footer-text: #94a3b8;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Sizing */
  --max-width: 720px;
  --radius: 8px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  /* Two-column grid: sidebar | content, with header & footer spanning both */
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header  header"
    "sidebar content"
    "footer  footer";
  min-height: 100vh;
  /* Subtle top-to-bottom gradient for depth */
  background: linear-gradient(180deg, #dbeafe 0%, var(--color-bg) 320px) no-repeat,
    var(--color-bg);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* ---------- Utility: Section Wrapper ---------- */
.container {
  width: 90%;
  max-width: var(--max-width);
  margin-inline: auto;
}

/* ---------- Card-style main content ---------- */
main.container {
  background: var(--color-surface);
  box-shadow: none;
  padding: var(--space-sm) var(--space-md);
  margin-top: 0;
  position: relative;
}

/* ---------- Section Spacing ---------- */
section {
  padding: var(--space-lg) 0;
}

/* Subtle divider between sections */
section + section {
  border-top: 1px solid var(--color-border);
}

/* ---------- Section Headings ---------- */
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

/* ---------- Burger button (hidden on desktop) ---------- */
.toc__burger {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 300;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.4rem;
  background-color: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.toc__burger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animate to X when open */
.toc__burger[aria-expanded="true"] .toc__burger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.toc__burger[aria-expanded="true"] .toc__burger-bar:nth-child(2) {
  opacity: 0;
}
.toc__burger[aria-expanded="true"] .toc__burger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Table of Contents Nav — vertical sidebar ---------- */
.toc {
  grid-area: sidebar;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  background-color: var(--color-surface);
  border-right: 1px solid var(--color-border);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
  z-index: 100;
}

.toc__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: var(--space-md) 0;
}

.toc__item {
  width: 100%;
}

.toc__link {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid transparent;
  color: var(--color-text);
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.toc__link:hover {
  background-color: var(--color-accent-light);
  border-left-color: var(--color-accent);
  text-decoration: none;
}

.toc__label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-accent);
}

.toc__link:hover .toc__label {
  color: var(--color-accent-hover);
}

.toc__desc {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
  line-height: 1.3;
}

/* Adjust main to sit in the content grid area */
main.container {
  grid-area: content;
  min-width: 0;
  margin-top: 0;
  border-radius: 0;
}

@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "content"
      "footer";
  }

  /* Burger button — always visible on mobile */
  .toc__burger {
    display: flex;
  }

  /* Nav becomes a fixed full-height drawer */
  .toc {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    border-right: 1px solid var(--color-border);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
  }

  .toc.toc--open {
    transform: translateX(0);
  }

  /* Overlay behind open drawer */
  .toc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 199;
  }

  .toc-overlay--visible {
    display: block;
  }

  .toc__list {
    flex-direction: column;
    padding: 4rem 0 var(--space-md);
  }

  .toc__item {
    flex: none;
    width: 100%;
  }

  .toc__link {
    border-left: 3px solid transparent;
    border-bottom: none;
    padding: 0.75rem 1.25rem;
  }

  .toc__link:hover {
    border-left-color: var(--color-accent);
    border-bottom-color: transparent;
  }

  .toc__desc {
    display: block;
  }

  main.container {
    margin-top: 0;
    border-radius: var(--radius);
  }
}

/* ---------- Header ---------- */
.site-header {
  grid-area: header;
  padding: var(--space-md) 0;
  color: #fff;
  background-color: #0d1f4e;
}

.site-header__inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.site-header__text {
  text-align: left;
}

.site-header__name {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: #fff;
}

.site-header__title {
  font-size: 1.4rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  margin-top: var(--space-xs);
}

/* ---------- Profile Photo ---------- */
.profile__photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile__photo:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* ---------- Introduction / Summary ---------- */
.intro p {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 600px;
}

/* ---------- CV / Career Overview ---------- */
.career p {
  color: var(--color-text-muted);
}

/* ---------- Experience Toggle Button ---------- */
.timeline__toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.25rem;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.timeline__toggle:hover .timeline__role {
  color: var(--color-accent);
}

.timeline__chevron {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--color-accent);
  transition: transform 0.25s ease;
  align-self: center;
}

.timeline__toggle[aria-expanded="true"] .timeline__chevron {
  transform: rotate(180deg);
}

/* ---------- Experience Timeline ---------- */
.timeline {
  list-style: none;
  padding-left: var(--space-md);
  border-left: 2px solid var(--color-accent);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-md);
  padding-left: var(--space-sm);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

/* Dot on the timeline */
.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-md) - 5px);
  top: 6px;
  width: 10px;
  height: 10px;
  background-color: var(--color-accent);
  border-radius: 50%;
}

.timeline__role {
  font-weight: 700;
  font-size: 1.05rem;
}

.timeline__company {
  color: var(--color-accent);
}

.timeline__dates {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.timeline__desc {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-top: var(--space-xs);
}

/* ---------- Skills ---------- */
.skills-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.skills-list__item {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  font-size: 0.9rem;
  color: var(--color-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.skills-list__item:hover {
  background-color: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* ---------- Education Timeline ---------- */
.edu-timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--color-accent);
  padding-left: var(--space-md);
}

.edu-timeline__item {
  position: relative;
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding-bottom: var(--space-md);
}

.edu-timeline__item:last-child {
  padding-bottom: 0;
}

/* Dot on the line */
.edu-timeline__item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-md) - 5px);
  top: 6px;
  width: 10px;
  height: 10px;
  background-color: var(--color-accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.edu-timeline__year {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background-color: var(--color-accent);
  border-radius: 100px;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.edu-timeline__body {
  flex: 1;
}

.edu-timeline__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.4;
}

.edu-timeline__org {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.1rem;
}

/* ---------- Languages ---------- */
.languages-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-sm);
}

.lang-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.lang-card:hover {
  box-shadow: 0 4px 14px rgba(13, 31, 78, 0.1);
  transform: translateY(-2px);
}

.lang-card__flag {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.lang-card__body {
  flex: 1;
  min-width: 0;
}

.lang-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.lang-card__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
}

.lang-card__badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
  background-color: var(--color-accent-light);
  color: var(--color-accent);
  white-space: nowrap;
}

.lang-card__badge--native {
  background-color: var(--color-accent);
  color: #fff;
}

.lang-card__bar {
  width: 100%;
  height: 5px;
  background-color: var(--color-border);
  border-radius: 100px;
  overflow: hidden;
}

.lang-card__fill {
  height: 100%;
  background-color: var(--color-accent);
  border-radius: 100px;
  transition: width 0.6s ease;
}

/* ---------- Interests ---------- */
.interests-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-sm);
}

.interests-list__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.interests-list__item:hover {
  box-shadow: 0 4px 14px rgba(13, 31, 78, 0.1);
  transform: translateY(-2px);
}

.interests-list__icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.interests-list__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ---------- Contact ---------- */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.contact-list__item {
  font-size: 1rem;
  color: var(--color-text-muted);
}

.contact-list__label {
  font-weight: 600;
  color: var(--color-text);
}

/* ---------- LinkedIn Button ---------- */
.linkedin {
  text-align: center;
  padding: var(--space-md) 0 var(--space-lg);
}

.linkedin__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  background-color: var(--color-accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.linkedin__link:hover {
  background-color: var(--color-accent-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}

/* ---------- Footer (dark) ---------- */
.site-footer {
  grid-area: footer;
  text-align: center;
  padding: var(--space-md) 0;
  margin-top: var(--space-lg);
  background-color: var(--color-footer-bg);
  font-size: 0.85rem;
  color: var(--color-footer-text);
}

.site-footer__logo {
  height: 60px;
  width: auto;
  margin: 0 auto var(--space-xs);
  opacity: 0.85;
}

/* ---------- Scroll-to-top button ---------- */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background-color: var(--color-accent);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
}

.scroll-top--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-3px);
}

.scroll-top[hidden] {
  display: none;
}

/* ==========================================================================
   Responsive — Mobile-first adjustments
   ========================================================================== */
@media (max-width: 600px) {
  .site-header__inner {
    flex-direction: column;
    text-align: center;
  }

  .site-header__text {
    text-align: center;
  }

  .site-header__name {
    font-size: 1.75rem;
  }

  .site-header__title {
    font-size: 1rem;
  }

  .profile__photo {
    width: 140px;
    height: 140px;
  }

  section {
    padding: var(--space-md) 0;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .timeline {
    padding-left: var(--space-sm);
  }

  .timeline__item::before {
    left: calc(-1 * var(--space-sm) - 5px);
  }
}
