/* =========================================================================
   LEDGER — Resume Builder  |  Premium Design System v2
   =========================================================================
   Palette: deep ledger-green ink, brass/ochre accent (the "seal" color),
   warm paper stock + new gradient accents & glassmorphism tokens.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Outfit:wght@400;500;600;700;800&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ── Core Ink Palette ── */
  --ink-900: #0f1715;
  --ink-800: #172420;
  --ink-700: #223831;
  --ink-600: #2d4c42;
  --ink-500: #3d6b5a;

  /* ── Paper Palette ── */
  --paper-100: #f8f6f0;
  --paper-50:  #fcfbf7;
  --paper-200: #eee8da;
  --paper-300: #dfd7c2;

  /* ── Brass / Accent ── */
  --brass-500: #c2952b;
  --brass-600: #9e781e;
  --brass-400: #d4a83a;
  --brass-100: #f5e7c6;
  --brass-50:  #faf3e3;

  /* ── Status ── */
  --danger:    #a3392b;
  --danger-bg: #f8e6e2;
  --success:   #2f6b4f;
  --success-bg:#e6f0ea;
  --info:      #3b6fc2;
  --info-bg:   #e8f0fc;

  /* ── Rules & Borders ── */
  --rule:        rgba(15, 23, 21, 0.10);
  --rule-strong: rgba(15, 23, 21, 0.20);

  /* ── Gradients ── */
  --gradient-primary:  linear-gradient(135deg, #0f1715 0%, #1a3a2e 50%, #223831 100%);
  --gradient-accent:   linear-gradient(135deg, #c2952b 0%, #d4a83a 50%, #9e781e 100%);
  --gradient-hero:     linear-gradient(135deg, rgba(194,149,43,0.08) 0%, rgba(15,23,21,0.02) 50%, rgba(63,107,90,0.06) 100%);
  --gradient-glass:    linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.3) 100%);
  --gradient-glow:     radial-gradient(circle, rgba(194,149,43,0.15) 0%, transparent 70%);
  --gradient-mesh:     conic-gradient(from 180deg at 50% 50%, rgba(194,149,43,0.06) 0deg, rgba(15,23,21,0.03) 90deg, rgba(47,107,79,0.05) 180deg, rgba(194,149,43,0.04) 270deg, rgba(15,23,21,0.02) 360deg);

  /* ── Glassmorphism ── */
  --glass-bg:     rgba(252, 251, 247, 0.72);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-blur:   16px;

  /* ── Type ── */
  --font-display: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif:   'Source Serif 4', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', Consolas, monospace;

  /* ── Spacing Scale ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* ── Radius ── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* ── Premium Shadows ── */
  --shadow-xs:       0 1px 2px rgba(15, 23, 21, 0.05);
  --shadow-card:     0 1px 3px rgba(15, 23, 21, 0.06), 0 8px 24px -8px rgba(15, 23, 21, 0.12);
  --shadow-elevated: 0 4px 6px rgba(15, 23, 21, 0.04), 0 16px 40px -8px rgba(15, 23, 21, 0.16);
  --shadow-pop:      0 12px 48px -8px rgba(15, 23, 21, 0.25), 0 0 0 1px rgba(15, 23, 21, 0.04);
  --shadow-glow:     0 0 24px -4px rgba(194, 149, 43, 0.3);
  --shadow-glow-sm:  0 0 12px -2px rgba(194, 149, 43, 0.2);
  --shadow-inner:    inset 0 1px 3px rgba(15, 23, 21, 0.08);

  /* ── Timing ── */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:    cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --container: 1180px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--paper-100);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  animation: pageEntry 0.5s var(--ease-spring) both;
}

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

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.02em;
  color: var(--ink-900);
}
h1 { font-weight: 800; }

p { margin: 0 0 var(--space-4); color: var(--ink-800); line-height: 1.65; }
a { color: inherit; text-decoration: none; }

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ── Focus Visibility ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brass-500);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Container ── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   SCROLL REVEAL
   ═══════════════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-spring), transform 0.8s var(--ease-spring);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ═══════════════════════════════════════════════════════════════════════
   SPINNER
   ═══════════════════════════════════════════════════════════════════════ */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--rule-strong);
  border-top-color: var(--brass-500);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════
   KEYBOARD SHORTCUT BADGE
   ═══════════════════════════════════════════════════════════════════════ */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--paper-200);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  color: var(--ink-700);
  line-height: 1;
  box-shadow: 0 1px 0 var(--rule-strong);
}

/* ═══════════════════════════════════════════════════════════════════════
   TOOLTIP
   ═══════════════════════════════════════════════════════════════════════ */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--ink-900);
  color: var(--paper-50);
  font-size: 0.72rem;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s var(--ease-spring);
  z-index: 50;
  box-shadow: var(--shadow-elevated);
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════
   MODALS (global)
   ═══════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 21, 0.6);
  display: none !important;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: var(--space-4);
}
@supports (backdrop-filter: blur(1px)) {
  .modal-overlay { backdrop-filter: blur(8px); }
}
.modal-overlay.show {
  display: flex !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS — Premium System
   ═══════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.2s var(--ease-spring),
              box-shadow 0.2s var(--ease-spring),
              background-color 0.2s ease,
              border-color 0.2s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.btn:hover::before { opacity: 1; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); transition-duration: 0.08s; }

/* Primary — Dark ink */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--paper-50);
  border-color: var(--ink-800);
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover {
  box-shadow: var(--shadow-elevated), 0 0 20px -4px rgba(15, 23, 21, 0.2);
}

/* Brass / Gold accent */
.btn-brass {
  background: var(--gradient-accent);
  color: var(--ink-900);
  border-color: var(--brass-500);
  box-shadow: var(--shadow-xs);
}
.btn-brass:hover {
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--ink-900);
  border-color: var(--rule-strong);
}
.btn-ghost:hover {
  border-color: var(--ink-700);
  background: rgba(15, 23, 21, 0.03);
  box-shadow: var(--shadow-xs);
}

/* Danger */
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(163,57,43,0.3);
}
.btn-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.btn-sm  { padding: 8px 16px; font-size: 0.84rem; }
.btn-xs  { padding: 5px 10px; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Icon-only Button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--ink-900);
  transition: background 0.2s ease, transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}
.btn-icon:hover {
  background: rgba(15, 23, 21, 0.04);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.btn-icon svg { width: 18px; height: 18px; }

/* ═══════════════════════════════════════════════════════════════════════
   NAV — Premium Frosted Glass
   ═══════════════════════════════════════════════════════════════════════ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 246, 240, 0.82);
  border-bottom: 1px solid var(--rule);
}
@supports (backdrop-filter: blur(1px)) {
  .site-nav {
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
  }
}
.site-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--brass-500) 30%, var(--brass-400) 50%, var(--brass-500) 70%, transparent 100%);
  opacity: 0.4;
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

/* ── Brand Mark ── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink-900);
  letter-spacing: -0.02em;
}
.brand-logo-img {
  height: 34px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.3s var(--ease-spring);
}
.brand:hover .brand-logo-img {
  transform: scale(1.06);
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--paper-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  position: relative;
  box-shadow: var(--shadow-glow-sm);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease;
}
.brand:hover .brand-mark {
  transform: scale(1.06) rotate(-4deg);
  box-shadow: var(--shadow-glow);
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1.5px solid var(--brass-500);
  border-radius: 50%;
  opacity: 0.6;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a {
  color: var(--ink-700);
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-spring);
}
.nav-links a:hover { color: var(--ink-900); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-cta { display: flex; align-items: center; gap: var(--space-3); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: 7px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink-900);
  border-radius: 1px;
  transition: transform 0.25s var(--ease-spring), opacity 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: var(--space-9);
  color: var(--ink-700);
  font-size: 0.9rem;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass-500), transparent);
  opacity: 0.3;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-7);
}
.footer-grid h4 {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--ink-900);
  margin-bottom: var(--space-3);
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { transition: color 0.15s ease; }
.footer-grid a:hover { color: var(--ink-900); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-5);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.footer-social-links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper-200);
  color: var(--ink-700);
  border: 1px solid var(--rule);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}
.social-icon-btn:hover {
  background: var(--brass-500);
  color: #ffffff;
  border-color: var(--brass-500);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(194, 149, 43, 0.3);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   SKELETON LOADING
   ═══════════════════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--paper-200) 25%, rgba(255,255,255,0.5) 50%, var(--paper-200) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   STAGGER CHILDREN ANIMATION
   ═══════════════════════════════════════════════════════════════════════ */
.stagger-in > * {
  opacity: 0;
  transform: translateY(20px);
  animation: staggerFadeIn 0.5s var(--ease-spring) forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.12s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.18s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.24s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.30s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.36s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.42s; }
.stagger-in > *:nth-child(n+9) { animation-delay: 0.48s; }
@keyframes staggerFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════
   GLASSMORPHISM UTILITIES
   ═══════════════════════════════════════════════════════════════════════ */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}
@supports (backdrop-filter: blur(1px)) {
  .glass {
    backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   PERFORMANCE UTILITIES
   ═══════════════════════════════════════════════════════════════════════ */
.contain-layout { contain: layout style; }
.content-auto   { content-visibility: auto; contain-intrinsic-size: auto 600px; }
.gpu-layer      { will-change: transform; transform: translateZ(0); }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .container {
    padding: 0 var(--space-4);
  }
  .nav-links { display: none; }
  .nav-links.show {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(248, 246, 240, 0.96);
    border-bottom: 1px solid var(--rule);
    padding: var(--space-4) var(--space-5);
    gap: var(--space-3);
    box-shadow: var(--shadow-elevated);
    z-index: 39;
  }
  @supports (backdrop-filter: blur(1px)) {
    .nav-links.show {
      backdrop-filter: blur(20px);
    }
  }
  .nav-toggle { display: flex; }
  .site-nav .container { position: relative; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  /* Prevent iOS auto-zoom on form inputs by ensuring 16px font size */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }

  button, .btn, input, select {
    touch-action: manipulation;
  }
}

