/* ==========================================================================
   Design System & Custom Properties
   ========================================================================== */
:root {
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* System preference defaults: Noctis Hibernus Light Theme (Fallback for older browsers) */
  --bg-color: #ffffff;
  --bg-gradient-1: transparent;
  --bg-gradient-2: transparent;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-hover-border: #cbd5e1;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --accent: #3d5e9e;
  --accent-hover: #2e4777;
  --accent-light: rgba(61, 94, 158, 0.05);
  --shadow-sm: 0 1px 3px rgba(30, 41, 59, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(30, 41, 59, 0.05), 0 2px 4px -1px rgba(30, 41, 59, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(30, 41, 59, 0.05), 0 4px 6px -2px rgba(30, 41, 59, 0.02);
  --shadow-glow: 0 10px 30px -10px rgba(61, 94, 158, 0.1);
  --timeline-line: #e2e8f0;
  --timeline-dot-border: #cbd5e1;
  --header-bg: rgba(255, 255, 255, 0.8);
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-track: #ffffff;

  /* Modern standard: light-dark() utility for newer browsers */
  @supports (color: light-dark(white, black)) {
    --bg-color: light-dark(#ffffff, #071417);
    --bg-gradient-1: transparent;
    --bg-gradient-2: transparent;
    --card-bg: light-dark(#ffffff, #0f172a);
    --card-border: light-dark(#e2e8f0, #1e293b);
    --card-hover-border: light-dark(#cbd5e1, #334155);
    --text-primary: light-dark(#1e293b, #f8fafc);
    --text-secondary: light-dark(#475569, #94a3b8);
    --accent: light-dark(#3d5e9e, #A2B7E1);
    --accent-hover: light-dark(#2e4777, #c2d2f0);
    --accent-light: light-dark(rgba(61, 94, 158, 0.05), rgba(162, 183, 225, 0.1));
    --shadow-glow: light-dark(0 10px 30px -10px rgba(61, 94, 158, 0.1), 0 10px 30px -10px rgba(162, 183, 225, 0.2));
    --timeline-line: light-dark(#e2e8f0, #1e293b);
    --timeline-dot-border: light-dark(#cbd5e1, #475569);
    --header-bg: light-dark(rgba(255, 255, 255, 0.8), rgba(7, 20, 23, 0.8));
    --scrollbar-thumb: light-dark(#cbd5e1, #334155);
    --scrollbar-track: light-dark(#ffffff, #071417);
  }

  /* Colors based on prefers-color-scheme: Noctis Obscuro Dark Theme */
  @media (prefers-color-scheme: dark) {
    --bg-color: #071417;
    --bg-gradient-1: transparent;
    --bg-gradient-2: transparent;
    --card-bg: #0f172a;
    --card-border: #1e293b;
    --card-hover-border: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #A2B7E1;
    --accent-hover: #c2d2f0;
    --accent-light: rgba(162, 183, 225, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 10px 30px -10px rgba(162, 183, 225, 0.2);
    --timeline-line: #1e293b;
    --timeline-dot-border: #475569;
    --header-bg: rgba(7, 20, 23, 0.8);
    --scrollbar-thumb: #334155;
    --scrollbar-track: #071417;
  }

  color-scheme: light dark;
}

/* Explicit data-theme overrides: Noctis Hibernus Light Theme (for user toggle) */
:root[data-theme="light"] {
  --bg-color: #ffffff;
  --bg-gradient-1: transparent;
  --bg-gradient-2: transparent;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-hover-border: #cbd5e1;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --accent: #3d5e9e;
  --accent-hover: #2e4777;
  --accent-light: rgba(61, 94, 158, 0.05);
  --shadow-sm: 0 1px 3px rgba(30, 41, 59, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(30, 41, 59, 0.05), 0 2px 4px -1px rgba(30, 41, 59, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(30, 41, 59, 0.05), 0 4px 6px -2px rgba(30, 41, 59, 0.02);
  --shadow-glow: 0 10px 30px -10px rgba(61, 94, 158, 0.1);
  --timeline-line: #e2e8f0;
  --timeline-dot-border: #cbd5e1;
  --header-bg: rgba(255, 255, 255, 0.8);
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-track: #ffffff;
  color-scheme: light;
}

/* Explicit data-theme overrides: Noctis Obscuro Dark Theme (for user toggle) */
:root[data-theme="dark"] {
  --bg-color: #071417;
  --bg-gradient-1: transparent;
  --bg-gradient-2: transparent;
  --card-bg: #0f172a;
  --card-border: #1e293b;
  --card-hover-border: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #A2B7E1;
  --accent-hover: #c2d2f0;
  --accent-light: rgba(162, 183, 225, 0.1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 10px 30px -10px rgba(162, 183, 225, 0.2);
  --timeline-line: #1e293b;
  --timeline-dot-border: #475569;
  --header-bg: rgba(7, 20, 23, 0.8);
  --scrollbar-thumb: #334155;
  --scrollbar-track: #071417;
  color-scheme: dark;
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
}

/* Custom Scrollbar */
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);

@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 5px;
  }
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

/* ==========================================================================
   Layout wrappers
   ========================================================================== */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.home-container {
  margin: auto;
  max-width: 750px;
  width: 100%;
  padding: 6rem 2rem 4rem 2rem;
  box-sizing: border-box;
  text-align: center;
}

.resume-container {
  max-width: 800px;
  width: 100%;
  padding: 8rem 2rem 10rem 2rem;
  box-sizing: border-box;
  margin: 0 auto;
}

.resume-section {
  margin-top: 3.5rem;
}

.column-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card-flat {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  border-radius: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 10px var(--accent-light);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  transition: background-color 0.4s ease;
}

.header-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.nav-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.25rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background-color: var(--accent-light);
  transform: scale(1.05);
}

.sun-icon {
  display: none;
  width: 20px;
  height: 20px;
}

.moon-icon {
  display: block;
  width: 20px;
  height: 20px;
}

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

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

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sun-icon {
    display: block;
  }

  :root:not([data-theme="light"]) .moon-icon {
    display: none;
  }
}

/* ==========================================================================
   Resume / Experience Details
   ========================================================================== */
.resume-header-card {
  padding: 0 0 1.5rem 0;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 2rem;
}

.resume-header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.resume-name {
  font-size: 3rem;
  font-weight: 850;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.resume-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.resume-meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.resume-link-text {
  color: var(--accent);
  font-weight: 600;
}

.resume-link-text:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.resume-summary-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.7;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 6px;
  width: 2px;
  height: calc(100% - 16px);
  background-color: var(--timeline-line);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  transition: all 0.3s ease;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid transparent;
  background-clip: padding-box, border-box;
  background-origin: border-box;
  background-repeat: no-repeat;
  background-image: linear-gradient(var(--bg-color), var(--bg-color)), linear-gradient(180deg, var(--timeline-dot-border), var(--timeline-dot-border));
  transition: transform 0.25s ease, background-image 0.25s ease;
  z-index: 2;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.25);
  background-image: linear-gradient(var(--bg-color), var(--bg-color)), linear-gradient(180deg, #F7C844, #A2B7E1, #F19E9E);
}

.timeline-date {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  display: block;
  margin-bottom: 0.25rem;
}

.timeline-role {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.timeline-company {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.timeline-summary {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.timeline-list {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: 0.75rem;
  padding-left: 1.25rem;
}

.timeline-list li {
  margin-bottom: 0.75rem;
}

.timeline-list li::marker {
  color: var(--accent);
}

/* Skills list */
.resume-skills-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.resume-skills-group {
  margin-bottom: 1rem;
}

.resume-skills-group-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-badge {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background-color: var(--accent-light);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}

/* ==========================================================================
   Footer & Bicycle Stripes
   ========================================================================== */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10;
  background-color: var(--bg-color);
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  transition: background-color 0.4s ease;
}

.bottom-stripes-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.stripes-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: relative;
}

.stripe {
  height: 6px;
  border-radius: 0 4px 4px 0;
  transition: background-color 0.4s ease;
}

.stripe-yellow {
  background-color: #F7C844;
  height: 8px;
  width: 94%;
}

.stripe-blue {
  background-color: #A2B7E1;
  width: 92%;
}

.stripe-red {
  background-color: #F19E9E;
  width: 90%;
}

.stripes-group::after {
  content: '';
  position: absolute;
  right: 0%;
  top: 50%;
  transform: translateY(-50%);
  width: 100px;
  height: 65px;
  background-image: url('assets/bicycle.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: filter 0.4s ease;
  pointer-events: none;
}

/* Dynamic color inversion for PNG to support dark theme */
:root[data-theme="dark"] .stripes-group::after {
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stripes-group::after {
    filter: invert(1);
  }
}

/* ==========================================================================
   Home Page Centered Layout Animation
   ========================================================================== */
.minimal-title {
  font-size: 4.75rem;
  font-weight: 850;
  margin-bottom: 1.25rem;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.035em;
  font-family: var(--font-display);
}

.minimal-subtitle {
  color: var(--text-secondary);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 2.25rem;
  line-height: 1.6;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.minimal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.minimal-link-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--accent);
  transition: color 0.2s ease, opacity 0.2s ease;
  font-family: var(--font-body);
}

.minimal-link-inline:hover {
  opacity: 0.8;
  color: var(--accent-hover);
}

.minimal-link-inline svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.minimal-divider {
  color: #cbd5e1;
  font-size: 1.2rem;
  user-select: none;
  font-weight: 300;
}

:root[data-theme="dark"] .minimal-divider {
  color: #475569;
}

@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-container {
  animation: contentFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ==========================================================================
   Responsive Design Media Queries
   ========================================================================== */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .header-container {
    padding: 1rem;
  }

  .resume-name {
    font-size: 2.25rem;
  }

  .resume-header-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .resume-skills-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .minimal-title {
    font-size: 3.5rem;
  }

  .minimal-subtitle {
    font-size: 1.15rem;
    padding: 0 1rem;
  }

}

@media (max-width: 480px) {
  .header-container {
    padding: 0.75rem 1rem;
  }

  .nav {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  .nav-container {
    gap: 1rem;
  }

  .minimal-title {
    font-size: 2.75rem;
  }

  .minimal-links {
    gap: 1rem;
  }

  .minimal-link-inline {
    font-size: 1.1rem;
  }

  .bottom-stripes-container {
    display: none;
  }
}