/* ========================================
   ROOT VARIABLES & DESIGN TOKENS
   ======================================== */

:root {
  /* Color Palette - Deep Black with Warm Amber */
  --color-bg-primary: #050505;
  --color-bg-secondary: #0a0908;
  --color-bg-elevated: #111110;
  --color-bg-subtle: #1a1918;
  
  --color-accent: #d4850c;
  --color-accent-hover: #e69a1e;
  --color-accent-active: #f0a830;
  --color-accent-glow: rgba(212, 133, 12, 0.4);
  --color-accent-subtle: rgba(212, 133, 12, 0.1);
  
  --color-text-primary: #f5f2ed;
  --color-text-secondary: #a8a49c;
  --color-text-muted: #6b675f;
  
  --color-border: #2a2825;
  --color-border-subtle: #1f1d1b;
  
  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Shadows */
  --shadow-glow: 0 0 20px var(--color-accent-glow);
  --shadow-glow-lg: 0 0 40px var(--color-accent-glow);
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  z-index: 9999;
}

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

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

::selection {
  background-color: var(--color-accent);
  color: var(--color-bg-primary);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
  max-width: 65ch;
}

.text-accent {
  color: var(--color-accent);
}

.text-muted {
  color: var(--color-text-secondary);
}

/* ========================================
   LAYOUT
   ======================================== */

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

.container--narrow {
  max-width: 800px;
}

.section {
  padding: var(--space-5xl) 0;
}

.section--hero {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   NAVIGATION
   ======================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: var(--space-lg) 0;
  background: linear-gradient(
    to bottom,
    var(--color-bg-primary) 0%,
    rgba(5, 5, 5, 0.95) 50%,
    transparent 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  transition: color var(--transition-base);
}

.navbar__logo:hover {
  color: var(--color-accent);
}

.navbar__logo span {
  color: var(--color-accent);
}

.navbar__menu {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
}

.navbar__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  border-radius: 4px;
  transition: 
    color var(--transition-fast),
    transform var(--transition-spring),
    background-color var(--transition-fast);
  transform-origin: center;
}

.navbar__link:hover {
  color: var(--color-text-primary);
  transform: scale(1.08);
}

.navbar__link:active {
  color: var(--color-accent);
  background-color: var(--color-accent-subtle);
  box-shadow: var(--shadow-glow);
  transform: scale(1.05);
}

.navbar__link--active {
  color: var(--color-accent);
}

.navbar__link--active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: var(--color-accent);
  border-radius: 50%;
}

/* Mobile menu toggle */
.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  background: none;
  border: none;
  cursor: pointer;
}

.navbar__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text-primary);
  transition: var(--transition-base);
}

@media (max-width: 768px) {
  .navbar__toggle {
    display: flex;
    z-index: 1001;
  }
  
  /* Hamburger to X animation */
  .navbar__toggle.is-active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .navbar__toggle.is-active span:nth-child(2) {
    opacity: 0;
  }
  
  .navbar__toggle.is-active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
  
  .navbar__menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    background-color: var(--color-bg-primary);
    transition: right var(--transition-slow);
    z-index: 1000;
  }
  
  .navbar__menu.is-open {
    right: 0;
  }
  
  .navbar__link {
    font-size: 1.25rem;
    padding: var(--space-md) var(--space-xl);
  }
  
  /* Fix social icons on mobile - ensure circles not ovals */
  .hero__socials {
    flex-wrap: wrap;
  }
  
  .social-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
  }
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  text-align: center;
  padding-top: var(--space-5xl);
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-lg);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.hero__title {
  margin-bottom: var(--space-xl);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 50ch;
  margin: 0 auto var(--space-3xl);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

.hero__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.8s forwards;
}

/* Social Icons Row */
.hero__socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.7s forwards;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  transition: 
    transform var(--transition-spring),
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-base);
}

.social-icon:hover {
  transform: scale(1.15);
  border-color: var(--color-accent);
  background-color: var(--color-accent-subtle);
}

.social-icon:active {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.social-icon svg {
  width: 20px;
  height: 20px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: 
    transform var(--transition-spring),
    box-shadow var(--transition-base),
    background-color var(--transition-fast),
    color var(--transition-fast);
  transform-origin: center;
}

.btn:hover {
  transform: scale(1.05);
}

.btn:active {
  transform: scale(1.02);
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-bg-primary);
}

.btn--primary:hover {
  background-color: var(--color-accent-hover);
  box-shadow: var(--shadow-glow);
}

.btn--primary:active {
  background-color: var(--color-accent-active);
  box-shadow: var(--shadow-glow-lg);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn--outline:active {
  background-color: var(--color-accent-subtle);
  box-shadow: var(--shadow-glow);
}

/* ========================================
   CARDS & CONTENT BLOCKS
   ======================================== */

.card {
  padding: var(--space-2xl);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  transition: 
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 30px rgba(212, 133, 12, 0.1);
}

/* ========================================
   PAGE CONTENT
   ======================================== */

.page-header {
  padding: calc(80px + var(--space-5xl)) 0 var(--space-4xl);
  text-align: center;
  border-bottom: 1px solid var(--color-border-subtle);
}

.page-header__title {
  margin-bottom: var(--space-md);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.page-header__subtitle {
  color: var(--color-text-secondary);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.page-content {
  padding: var(--space-4xl) 0;
}

/* ========================================
   ABOUT PAGE
   ======================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--space-3xl);
  align-items: start;
}

.about__image-wrapper {
  max-width: 360px;
}

.about__image-wrapper img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

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

.about__image-wrapper {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: 8px;
  background-color: var(--color-bg-subtle);
}

.about__image-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  transform: translate(12px, 12px);
  z-index: -1;
}

.about__content h3 {
  color: var(--color-accent);
  margin-bottom: var(--space-lg);
}

.about__content p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

.about__content p:last-of-type {
  margin-bottom: var(--space-2xl);
}

/* Skills list */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  list-style: none;
}

.skills-list li {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent);
  background-color: var(--color-accent-subtle);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
}

/* ========================================
   CONTACT PAGE
   ======================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-4xl);
}

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

.contact-info h3 {
  color: var(--color-accent);
  margin-bottom: var(--space-lg);
}

.contact-info p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2xl);
}

.contact-links {
  list-style: none;
}

.contact-links li {
  margin-bottom: var(--space-md);
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.contact-links a:hover {
  color: var(--color-accent);
}

.contact-links svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.form-group input,
.form-group textarea {
  padding: var(--space-md);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text-primary);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: 
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

/* ========================================
   CV PAGE
   ======================================== */

.cv-download {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xl);
  padding: var(--space-4xl) 0;
}

.cv-preview {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1/1.414;
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-preview iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.cv-preview__fallback {
  display: none;
  text-align: center;
}

/* iOS / touch fallback */
@media (pointer: coarse) {
  .cv-preview iframe {
    display: none;
  }
  .cv-preview__fallback {
    display: block;
  }
}


.timeline {
  position: relative;
  padding-left: var(--space-2xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    var(--color-accent) 0%,
    var(--color-border) 100%
  );
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-2xl);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-2xl) - 4px);
  top: 8px;
  width: 9px;
  height: 9px;
  background-color: var(--color-accent);
  border-radius: 50%;
}

.timeline-item__date {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.timeline-item__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

.timeline-item__company {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.timeline-item__description {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--color-border-subtle);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__copy {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer__links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.footer__links a {
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--color-accent);
}

@media (max-width: 768px) {
  .footer__inner {
    flex-direction: column;
    gap: var(--space-lg);
    text-align: center;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Staggered animation utility classes */
.animate-fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* ========================================
   DECORATIVE ELEMENTS
   ======================================== */

.accent-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(
    to right,
    var(--color-accent),
    transparent
  );
  margin: var(--space-xl) 0;
}

.accent-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--color-accent);
  border-radius: 50%;
}
