/* ============================================================
   Design Tokens  "The Precision Architect" (DESIGN.md)
   ============================================================ */
:root {
  /* Brand */
  --primary:                #1e5667;
  --primary-container:      #3a6e80;
  --primary-fixed-dim:      #2b7082;
  --on-primary:             #ffffff;
  --tertiary:               #235661;

  /* Surface Stack */
  --surface-lowest:         #ffffff;
  --surface:                #f7f9ff;
  --surface-low:            #edf4ff;
  --surface-container:      #deeaf5;
  --surface-high:           #cddcea;
  --surface-highest:        #bdd0e0;

  /* Content */
  --on-surface:             #091d2e;
  --on-surface-variant:     #3a4a55;
  --inverse-surface:        #203243;

  /* Secondary */
  --secondary-container:    #cfe2f9;
  --on-secondary-container: #0d3054;

  /* Borders */
  --outline-variant:        #c0c8cc;
  --outline:                #8a9ba5;
}

/* ============================================================
   Keyframes
   ============================================================ */

/* Animated gradient  12s breathe */
@keyframes gradientBreathe {
  0%,  100% { background-position: 0%   50%; }
  50%        { background-position: 100% 50%; }
}

/* Engineering grid drift  24px tile, 20s loop */
@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 24px 24px; }
}

/* Profile photo float  7s ease-in-out */
@keyframes floatPhoto {
  0%,  100% { transform: translateY(0); }
  50%        { transform: translateY(-8px); }
}

/* Skill bar fill */
@keyframes fillBar {
  from { width: 0 !important; }
}

/* ============================================================
   Accessibility  Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============================================================
   Scroll Reveal (IntersectionObserver adds .is-visible)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity  0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Base
   ============================================================ */
body {
  margin: 0;
  padding: 0;
  color: var(--on-surface);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--surface);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   Language Selector  Glassmorphism
   surface_container_highest at 70% opacity, 20px backdrop-blur
   ============================================================ */
.language-selector {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  display: flex;
  gap: 4px;
  background: rgba(189, 208, 224, 0.70);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 8px;
  padding: 4px;
}

.language-selector button {
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  color: var(--on-primary);
  font-family: "Inter", sans-serif;
}

.language-selector button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.language-selector button.active {
  background: var(--primary);
  color: var(--on-primary);
}

/* ============================================================
   Resume Wrapper
   ============================================================ */
.resume-wrapper {
  position: relative;
  max-width: 1280px;
  margin: 48px auto 96px;
  /* Ambient shadow: 3264px blur, 6% opacity, tinted  never pure black */
  box-shadow:
    0 64px 64px rgba(9, 29, 46, 0.06),
    0 16px 32px rgba(9, 29, 46, 0.06);
  background: var(--surface-lowest);
  border-radius: 20px;
  overflow: hidden;
}

/* ============================================================
   Header  Precision Architect Hero
   ============================================================ */
header {
  position: relative;
  /* Signature animated multi-stop gradient */
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--primary-container),
    var(--primary-fixed-dim),
    var(--tertiary)
  );
  background-size: 300% 300%;
  animation: gradientBreathe 12s ease infinite;
  color: var(--on-primary);
  padding: 80px 60px 64px;
  display: flex;
  align-items: center;
  gap: 56px;
  overflow: hidden;
}

/* Engineering Grid Overlay  outline_variant at 5%, drifts 24px on 20s loop */
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      rgba(192, 200, 204, 0.05) 0px 1px,
      transparent 1px 24px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(192, 200, 204, 0.05) 0px 1px,
      transparent 1px 24px
    );
  background-size: 24px 24px;
  animation: gridDrift 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Depth ring accent  right edge */
header::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 60px solid rgba(255, 255, 255, 0.03);
  pointer-events: none;
  z-index: 0;
}

/* Profile Photo */
header .profile-picture {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 1;
  /* Ambient ring  tonal, no harsh border */
  box-shadow:
    0 0 0 3px  rgba(255, 255, 255, 0.20),
    0 0 0 7px  rgba(255, 255, 255, 0.07),
    0 20px 48px rgba(9, 29, 46, 0.35);
  /* Float: 7s ease-in-out, 1.5s delay */
  animation: floatPhoto 7s ease-in-out 1.5s infinite;
  animation-fill-mode: backwards;
}

header .profile-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Header Content  intentional asymmetric right offset */
header .header-content {
  flex: 1;
  position: relative;
  z-index: 1;
  padding-right: 60px;
}

/* Kicker  label-md above display headline */
header .kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
  margin-bottom: 12px;
}

/* Display headline  Space Grotesk, 3.5rem, -0.02em */
header .name-container {
  font-size: 3.5rem;
  font-weight: 700;
  font-family: "Space Grotesk", "Inter", sans-serif;
  margin: 0 0 10px 0;
  color: var(--on-primary);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

header .job-container {
  font-size: 1.05rem;
  margin: 0 0 32px 0;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 400;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.01em;
}

/* Contact chips  Glassmorphism */
header .contact-container {
  position: static;
}

header .contact-container .contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

header .contact-container .contact-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  height: auto;
  padding: 7px 16px;
  /* surface_container_highest at ~18% opacity + 20px blur */
  background: rgba(189, 208, 224, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 25px;
  color: var(--on-primary);
  font-size: 12.5px;
  font-family: "Inter", sans-serif;
  transition: background 0.2s ease, transform 0.2s ease;
}

header .contact-container .contact-list li:hover {
  background: rgba(189, 208, 224, 0.30);
  transform: translateY(-2px);
}

header .contact-container .contact-list li span {
  width: 16px;
  height: 16px;
  text-align: center;
  line-height: 16px;
  font-size: 12px;
  opacity: 0.72;
  flex-shrink: 0;
}

/* ============================================================
   Main Layout  Tonal Column Split
   surface for main, surface-low for sidebar via ::before pseudo
   ============================================================ */
#main {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  background: var(--surface);
  isolation: isolate;
}

/* Sidebar column background  fills full height of #main */
#main::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  background: var(--surface-low);
  pointer-events: none;
  z-index: -1;
}

#main > .resume-item-wrapper,
#main > .sidebar {
  position: relative;
}

#main > .resume-item-wrapper {
  padding: 56px 48px 64px 56px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ============================================================
   Resume Sections  No Card-itis
   Sections flow on surface. No white boxes. No hard borders.
   ============================================================ */
.resume-item {
  position: relative;
}

/* Section headings  Space Grotesk display, -0.02em */
.resume-item h2 {
  position: relative;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: "Space Grotesk", "Inter", sans-serif;
  color: var(--on-surface);
  letter-spacing: -0.02em;
  margin: 0 0 28px 0;
  padding-bottom: 14px;
}

/* Tertiary accent line  grows on scroll reveal (accent bar grow) */
.resume-item h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--tertiary);
  transform-origin: left;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

.resume-item.is-visible h2::after {
  width: 64px;
}

/* Remove old accent square */
.resume-item h2::before {
  display: none;
}

/* ============================================================
   Experience Timeline
   ============================================================ */
.experience ul {
  position: relative;
}

.experience ul li {
  position: relative;
  margin: 0 0 40px;
  padding-left: 18px;
}

.experience ul li:last-child {
  margin-bottom: 0;
}

/* 2px teal left accent bar  scaleY(01) with 200ms base delay */
.experience ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--tertiary);
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 1px;
}

/* Staggered accent bar reveals  90ms increments, capped at 4 (360ms) */
.resume-item.is-visible .experience ul li:nth-child(1)::before { transform: scaleY(1); transition-delay: 0.09s; }
.resume-item.is-visible .experience ul li:nth-child(2)::before { transform: scaleY(1); transition-delay: 0.18s; }
.resume-item.is-visible .experience ul li:nth-child(3)::before { transform: scaleY(1); transition-delay: 0.27s; }
.resume-item.is-visible .experience ul li:nth-child(4)::before { transform: scaleY(1); transition-delay: 0.36s; }
.resume-item.is-visible .experience ul li:nth-child(5)::before { transform: scaleY(1); transition-delay: 0.36s; }
.resume-item.is-visible .experience ul li:nth-child(6)::before { transform: scaleY(1); transition-delay: 0.36s; }

.experience h3 {
  font-size: 1.05rem;
  color: var(--on-surface);
  margin-bottom: 4px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  letter-spacing: -0.01em;
  padding-right: 150px;
}

.experience .company {
  margin: 0 0 8px;
  color: var(--primary-container);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Date  Technical chip: surface-low bg, 2px radius, primary text */
.experience .date {
  position: absolute;
  top: 2px;
  right: 0;
  background: var(--surface-low);
  color: var(--primary);
  font-size: 10.5px;
  padding: 4px 10px;
  border-radius: 2px;
  font-weight: 500;
  white-space: nowrap;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.03em;
}

.experience .detail {
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--on-surface-variant);
  font-family: "Inter", sans-serif;
  font-weight: 400;
  margin-top: 8px;
}

/* Highlight block  tonal, 2px accent bar, no solid line borders */
.experience .highlight {
  background: var(--surface-low);
  padding: 11px 15px;
  border-radius: 3px;
  margin-top: 12px;
  border-left: 2px solid var(--tertiary);
  font-size: 13px;
  font-weight: 400;
  color: var(--on-surface-variant);
  line-height: 1.55;
}

.experience ul li:nth-child(even) .highlight {
  background: var(--surface-container);
  border-left-color: var(--primary-container);
}

/* ============================================================
   Project / Achievements  No Card-itis
   Alternating tonal backgrounds replace white card boxes
   ============================================================ */
.project ul {
  display: flex;
  flex-direction: column;
}

.project ul li {
  position: relative;
  font-size: 14px;
  line-height: 1.65;
  padding: 22px 22px 22px 36px;
  margin-bottom: 0;
}

.project ul li:nth-child(odd)  { background: var(--surface-low);       }
.project ul li:nth-child(even) { background: var(--surface-container); }

/* 2px accent bar  scaleY on section reveal */
.project ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--tertiary);
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.project ul li:nth-child(even)::before {
  background: var(--primary-container);
}

.resume-item.is-visible .project ul li:nth-child(1)::before { transform: scaleY(1); transition-delay: 0.05s; }
.resume-item.is-visible .project ul li:nth-child(2)::before { transform: scaleY(1); transition-delay: 0.14s; }
.resume-item.is-visible .project ul li:nth-child(3)::before { transform: scaleY(1); transition-delay: 0.23s; }
.resume-item.is-visible .project ul li:nth-child(4)::before { transform: scaleY(1); transition-delay: 0.32s; }

.project h3 {
  display: block;
  color: var(--on-surface);
  font-size: 1rem;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

/* Nav underline hover  scaleX(01), 0.2s */
.project h3 a {
  color: var(--on-surface);
  position: relative;
  text-decoration: none;
}

.project h3 a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.project h3 a:hover {
  color: var(--primary-container);
}

.project h3 a:hover::after {
  transform: scaleX(1);
}

.project .detail {
  display: block;
  font-size: 13px;
  color: var(--on-surface-variant);
  margin-bottom: 10px;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  line-height: 1.68;
}

.project .highlight {
  background: rgba(255, 255, 255, 0.55);
  padding: 9px 13px;
  border-radius: 3px;
  margin-top: 10px;
  border-left: 2px solid var(--tertiary);
  font-size: 13px;
  color: var(--on-surface-variant);
  line-height: 1.55;
}

.project ul li:nth-child(even) .highlight {
  border-left-color: var(--primary-container);
}

/* Technical Chips  secondary_container, 2px radius (sm = 0.125rem) */
.project p.tags {
  font-size: 11px;
  color: var(--on-secondary-container);
  background: var(--secondary-container);
  padding: 3px 10px;
  border-radius: 2px;
  display: inline-block;
  margin-top: 10px;
  font-weight: 500;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.01em;
}

/* Bullets sub-list */
.project .bullets {
  margin: 10px 0 0;
  background: rgba(255, 255, 255, 0.40);
  padding: 10px 14px;
  border-radius: 3px;
}

.project .bullets li {
  list-style: none !important;
  font-size: 12.5px !important;
  color: var(--on-surface-variant) !important;
  padding: 4px 0 4px 18px !important;
  position: relative !important;
  background: none !important;
  border-radius: 0 !important;
  margin-bottom: 4px !important;
  border-left: none !important;
}

.project .bullets li::before {
  content: '';
  position: absolute;
  left: 2px;
  color: var(--tertiary);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

/* Nav underline on bullet links */
.project .bullets li a {
  color: var(--primary-container);
  position: relative;
  text-decoration: none;
}

.project .bullets li a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.project .bullets li a:hover::after {
  transform: scaleX(1);
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  padding: 56px 32px 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  position: sticky;
  top: 40px;
  height: fit-content;
  align-self: start;
}

.sidebar .resume-item {
  padding: 0;
}

/* ============================================================
   Skills
   ============================================================ */
.skill ul {
  display: flex;
  flex-direction: column;
}

.skill ul li {
  height: auto;
  min-height: 34px;
  background: transparent;
  border-radius: 0;
  padding: 8px 0;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: none;
}

/* Ghost border at ~20% opacity  accessibility fallback per 4 */
.skill ul li + li {
  border-top: 1px solid rgba(192, 200, 204, 0.22);
}

.skill h3 {
  float: none;
  width: 44%;
  flex-shrink: 0;
  height: auto;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  color: var(--on-surface-variant);
  font-family: "Inter", sans-serif;
  letter-spacing: 0.01em;
}

.skill .skill-bar {
  float: none;
  flex: 1;
  height: 3px;
  background: var(--surface-container);
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

.skill .skill-bar .bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-container));
  border-radius: 0;
  animation: fillBar 1.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  position: relative;
  padding: 24px 40px;
  font-size: 11.5px;
  text-align: center;
  color: var(--on-surface-variant);
  /* Tonal shift creates separation  no harsh top border */
  background: var(--surface-container);
}

footer a {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

footer a:hover {
  color: var(--primary-container);
}

/* ============================================================
   Misc
   ============================================================ */
.end {
  margin-bottom: 0 !important;
}

#main .bullets li {
  margin-bottom: 8px;
  margin-top: 3px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  #main {
    grid-template-columns: 1fr 260px;
  }

  #main::before {
    width: 260px;
  }
}

@media (max-width: 768px) {
  .resume-wrapper {
    margin: 16px;
    border-radius: 12px;
  }

  .language-selector {
    top: 12px;
    right: 12px;
    padding: 3px;
  }

  .language-selector button {
    padding: 6px 10px;
    font-size: 10px;
  }

  header {
    flex-direction: column;
    text-align: center;
    padding: 56px 24px 44px;
    gap: 24px;
  }

  header .header-content {
    padding-right: 0;
  }

  header .name-container {
    font-size: 2.6rem;
  }

  header .contact-container .contact-list {
    justify-content: center;
  }

  #main {
    grid-template-columns: 1fr;
  }

  #main::before {
    display: none;
  }

  #main > .resume-item-wrapper {
    padding: 32px 24px;
  }

  .sidebar {
    background: var(--surface-low);
    padding: 32px 24px 40px;
    position: static;
    gap: 32px;
  }

  .experience h3 {
    padding-right: 0;
  }

  .experience .date {
    position: static;
    display: inline-block;
    margin-bottom: 8px;
  }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
  .language-selector {
    display: none !important;
  }

  body {
    background: white !important;
    font-size: 12px;
    line-height: 1.4;
    color: #091d2e !important;
  }

  .resume-wrapper {
    max-width: none !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: white !important;
  }

  header {
    background: #1e5667 !important;
    animation: none !important;
    border-radius: 0 !important;
    padding: 30px 20px 20px !important;
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  header::before,
  header::after {
    display: none !important;
  }

  header .profile-picture {
    animation: none !important;
    width: 100px !important;
    height: 100px !important;
  }

  header .name-container {
    font-size: 2rem !important;
  }

  header .contact-container .contact-list li {
    font-size: 11px !important;
    backdrop-filter: none !important;
  }

  #main {
    display: block !important;
    background: white !important;
    padding: 0 !important;
  }

  #main::before {
    display: none !important;
  }

  #main > .resume-item-wrapper {
    padding: 20px !important;
    display: block !important;
  }

  .sidebar {
    position: static !important;
    width: 100% !important;
    background: white !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
  }

  .sidebar .resume-item {
    flex: 1 1 200px !important;
  }

  .resume-item {
    page-break-inside: avoid;
  }

  .experience ul li::before,
  .project ul li::before {
    animation: none !important;
    transform: scaleY(1) !important;
  }

  .resume-item h2::after {
    width: 64px !important;
    transition: none !important;
  }

  .project ul li {
    background: #edf4ff !important;
    page-break-inside: avoid;
  }

  .project ul li:nth-child(even) {
    background: #deeaf5 !important;
  }

  .experience .highlight {
    background: #edf4ff !important;
  }

  footer {
    display: none !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
