/* global.css — color palette + light/dark theme tokens, base styles, buttons, fade-in (.reveal) and classes shared by many sections */

/* ---------- 1. Palette: raw colors, the same in both themes ---------- */
:root {
  --yellow: #f9bf2c;
  --yellow-soft: #fff1c4;
  --yellow-border: #ffd76a;
  --logo-accent: #f9bf26;
  --ivory: #fffaf0;
  --honey: #fde7a8;
  --amber: #e8a800;
  --brown: #5a3f05;
  --charcoal: #1a1a1a;
  --night: #0d0d0d;
  --ink: #111111;
  --white: #ffffff;
  --paper: #fafaf8;

  --grey-100: #f1f1f1;
  --grey-line: #ececec;
  --grey-300: #d6d6d6;
  --grey-350: #c4c4c4;
  --grey-400: #bdbdbd;
  --grey-500: #999999;
  --grey-600: #6b6b6b;
  --grey-800: #2b2b2b;
  --grey-850: #232323;

  --lilac: #eadcf0;
  --sky: #d9f4f7;
  --lime: #e6f5c9;
  --rose: #ffe1e1;
  --lilac-ink: #9a6aae;
  --sky-ink: #3aa8c1;
  --rose-ink: #f0726b;
  --lime-strong: #b5e35b;
  --lime-border: #d3f09a;

  --green: #22a04b;
  --green-soft: #e3f6e5;
  --linkedin: #0a66c2;    /* the "in" badge on the LinkedIn contact card */
  --orange: #f79009;      /* "In progress" pills */
  --orange-soft: #fde4c2;

  /* (Each project's accent color lives in js/projects-data.js → "accent") */

  --yellow-glow: rgba(249, 191, 44, 0.35);
  --yellow-a12: rgba(249, 191, 44, 0.12);
  --yellow-a20: rgba(249, 191, 44, 0.2);
  --yellow-a25: rgba(249, 191, 44, 0.25);
  --yellow-a28: rgba(249, 191, 44, 0.28);
  --yellow-a30: rgba(249, 191, 44, 0.3);
  --yellow-a50: rgba(249, 191, 44, 0.5);
  --yellow-a55: rgba(249, 191, 44, 0.55);
  --yellow-soft-a60: rgba(255, 241, 196, 0.6);

  --white-a04: rgba(255, 255, 255, 0.04);
  --white-a06: rgba(255, 255, 255, 0.06);
  --white-a08: rgba(255, 255, 255, 0.08);
  --white-a12: rgba(255, 255, 255, 0.12);
  --white-a15: rgba(255, 255, 255, 0.15);
  --white-a18: rgba(255, 255, 255, 0.18);
  --white-a25: rgba(255, 255, 255, 0.25);
  --white-a30: rgba(255, 255, 255, 0.3);
  --white-a60: rgba(255, 255, 255, 0.6);
  --white-a65: rgba(255, 255, 255, 0.65);
  --white-a70: rgba(255, 255, 255, 0.7);
  --white-a80: rgba(255, 255, 255, 0.8);
  --white-a92: rgba(255, 255, 255, 0.92);

  --black-a06: rgba(0, 0, 0, 0.06);
  --black-a08: rgba(0, 0, 0, 0.08);
  --black-a10: rgba(0, 0, 0, 0.1);
  --black-a12: rgba(0, 0, 0, 0.12);
  --black-a20: rgba(0, 0, 0, 0.2);
  --black-a25: rgba(0, 0, 0, 0.25);
  --black-a40: rgba(0, 0, 0, 0.4);
  --black-a50: rgba(0, 0, 0, 0.5);
  --ink-a08: rgba(17, 17, 17, 0.08);
  --ink-a12: rgba(17, 17, 17, 0.12);
  --glass-dark: rgba(20, 20, 20, 0.6);
  --glass-dark-strong: rgba(20, 20, 20, 0.92);

  /* About code snippet: syntax colors (dark versions here, darker readable ones in the light tokens) */
  --syntax-purple: #c792ea;
  --syntax-blue: #82aaff;
  --syntax-light: #e5e5e5;
  --syntax-purple-dark: #8b3fb5;
  --syntax-blue-dark: #2d5fc4;
  --syntax-amber-dark: #9a5d00;
  --dot-red: #ff5f57;
  --dot-yellow: #febc2e;
  --dot-green: #28c840;

  --font: 'Poppins', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --container: 1200px;
  --gutter: clamp(24px, 8vw, 140px);   /* space between the content and the screen edge (each side) */
  --nav-pad: 20px;     /* how far the menu pill reaches outside the container (each side) */
  --nav-h: 76px;
}

@media (max-width: 760px) {
  :root { --nav-pad: 8px; }
}

/* ---------- 2. Dark theme (default) ---------- */
:root,
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0d0d0d;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --text: #f5f5f5;
  --heading: #f5f5f5;
  --muted: #a3a3a3;
  --line: var(--white-a08);
  --logo-ink: var(--white);

  --page-bg:
    linear-gradient(var(--white-a04) 1px, transparent 1px) 0 0 / 100% 140px,
    linear-gradient(90deg, var(--white-a04) 1px, transparent 1px) 0 0 / 140px 100%,
    var(--bg);
  --band-opacity: 0;

  --card-border: var(--line);
  --shadow-card: 0 10px 30px var(--black-a40);
  --shadow-card-hover: 0 20px 44px var(--black-a50);
  --shadow-strong: 0 24px 50px var(--black-a50);
  --divider: var(--white-a18);

  --projects-accent: var(--yellow);
  --filter-border: var(--white-a15);
  --filter-hover-bg: var(--yellow-a12);
  --filter-active-bg: var(--yellow);
  --filter-active-text: var(--ink);
  --btn-dark-bg: var(--yellow);
  --btn-dark-text: var(--ink);
  --highlight-bg: var(--yellow-a12);
  --highlight-text: var(--text);
  --skill-border: var(--white-a15);
  --skill-bg: var(--white-a04);

  --nav-glass-bg: var(--glass-dark);
  --nav-glass-border: var(--line);
  --nav-shadow: 0 10px 30px var(--black-a40);
  --nav-hover: var(--white-a06);
  --nav-dropdown-bg: var(--glass-dark-strong);
  --nav-button-bg: var(--white-a08);

  --code-text: var(--syntax-light);
  --code-kw: var(--syntax-purple);
  --code-key: var(--syntax-blue);
  --code-str: var(--yellow);
  --code-num: var(--grey-600);
  --code-val-bg: var(--yellow-a12);       /* the 4 values after the sweep */
  --code-val-text: var(--yellow);
  --code-sweep-bg: var(--yellow-a30);     /* the moment each value is swept */
  --about-accent: var(--yellow);    /* code cursor + "What I bring" progress line */
  --about-line: var(--line);        /* divider, line-number rule, icon borders */
}

/* ---------- 3. Light theme (the original design) ---------- */
[data-theme="light"] {
  color-scheme: light;

  --bg: var(--ink);
  --surface: var(--white);
  --surface-2: var(--paper);
  --text: var(--grey-800);
  --heading: var(--ink);
  --muted: var(--grey-600);
  --line: var(--grey-line);
  --logo-ink: var(--grey-850);

  --page-bg: var(--bg);
  --band-opacity: 1;

  --card-border: transparent;
  --shadow-card: 0 10px 30px var(--black-a06);
  --shadow-card-hover: 0 20px 44px var(--black-a10);
  --shadow-strong: 0 24px 50px var(--black-a25);
  --divider: var(--ink);

  --projects-accent: var(--ink);
  --filter-border: var(--ink);
  --filter-hover-bg: var(--yellow-soft);
  --filter-active-bg: var(--ink);
  --filter-active-text: var(--white);
  --btn-dark-bg: var(--ink);
  --btn-dark-text: var(--white);
  --highlight-bg: var(--yellow-soft);
  --highlight-text: var(--ink);
  --skill-border: var(--grey-400);
  --skill-bg: var(--white-a60);

  --nav-glass-bg: var(--white-a70);
  --nav-glass-border: var(--white-a80);
  --nav-shadow: 0 10px 30px var(--ink-a08);
  --nav-hover: var(--yellow-soft-a60);
  --nav-dropdown-bg: var(--white-a92);
  --nav-button-bg: var(--white-a70);

  --code-text: var(--grey-800);
  --code-kw: var(--syntax-purple-dark);
  --code-key: var(--syntax-blue-dark);
  --code-str: var(--syntax-amber-dark);
  --code-num: var(--grey-500);
  --code-val-bg: var(--yellow-a50);             /* stronger, so it shows on the yellow-ish band */
  --code-val-text: var(--ink);                  /* yellow text would vanish here */
  --code-sweep-bg: var(--yellow);
  --about-accent: var(--syntax-amber-dark);   /* yellow would vanish on the yellow band */
  --about-line: var(--ink-a12);
}

/* In the light theme, Experience / Contact / Footer have dark backgrounds → light text there… */
[data-theme="light"] .experience,
[data-theme="light"] .contact,
[data-theme="light"] .footer {
  --heading: var(--white);
  --text: var(--grey-350);
  --muted: var(--grey-350);
  --line: var(--white-a12);
  --logo-ink: var(--white);
}

/* …but the white cards inside them keep dark text */
[data-theme="light"] .contact-form {
  --heading: var(--ink);
  --text: var(--grey-800);
  --muted: var(--grey-600);
  --line: var(--grey-line);
}

/* Smooth color change while switching theme (navbar.js adds this class for 0.4s) */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease !important;
}

/* ---------- 4. Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

[hidden] { display: none !important; }

.load-error {
  position: relative;
  z-index: 100;
  margin: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  font: 500 14px/1.5 var(--font);
  color: var(--ink);
  background: var(--yellow-soft);
  border: 2px solid var(--yellow);
}

/* The ONE container: every section and the navbar use it, so their left/right edges line up */
.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* Inline SVG logo (navbar, footer, splash): yellow "A" + "ya." in the theme's logo color */
.logo { display: block; width: auto; aspect-ratio: 1605 / 909; overflow: visible; color: var(--logo-ink); }
.logo-A { fill: var(--logo-accent); }
.logo-y, .logo-a, .logo-dot { fill: currentColor; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--yellow);
  color: var(--ink);
  padding: 16px 30px;
  box-shadow: 0 10px 28px var(--yellow-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px var(--yellow-a50); }

.btn-link {
  padding: 16px 8px;
  color: var(--heading);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.btn-link:hover { border-bottom-color: var(--yellow); }

.btn-dark {
  justify-content: center;
  padding: 16px 30px;
  background: var(--btn-dark-bg);
  color: var(--btn-dark-text);
}
.btn-dark:hover { transform: translateY(-2px); box-shadow: 0 12px 28px var(--black-a20); }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Eyebrow: the small label above every section title — number pill, name, and a line that grows in */
.eyebrow {
  display: flex;          /* behaves like inline-flex (only as wide as its content) but gives an exact 20px gap below */
  width: fit-content;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;    /* always 20px above the section's big title */
}

.eyebrow__num {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--yellow);
  background: var(--yellow-a12);
  border: 1px solid var(--yellow-glow);
}

.eyebrow__text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow__line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--yellow), transparent);
  transition: width 0.6s ease 0.2s;
}
.eyebrow.is-visible .eyebrow__line { width: 40px; }

.section-title {
  margin-top: 0;
  font-size: clamp(40px, 5.6vw, 80px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -3px;
  color: var(--heading);
}
.section-title span { color: var(--yellow); }

/* ---------- 5. Layering: light-theme color bands (::before) < glows < content ---------- */
.about, .process, .projects, .experience, .contact, .footer { position: relative; }

.hero::before,
.marquee::before,
.about::before,
.process::before,
.projects::before,
.experience::before,
.contact::before,
.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--band);
  opacity: var(--band-opacity);
  pointer-events: none;
}

main section > .container,
.footer > .container,
.marquee__tape { position: relative; z-index: 2; }

.glow {
  position: absolute;
  z-index: 1;
  width: min(560px, 90vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  opacity: 0.35;
  filter: blur(120px);
  pointer-events: none;
}

/* Dark theme: the glows become slow, soft "aurora" lights between sections */
[data-theme="dark"] .glow {
  opacity: 0.16;
  filter: blur(140px);
  will-change: transform;
  animation: aurora 26s ease-in-out infinite alternate;
}
[data-theme="dark"] .glow--2 { opacity: 0.12; animation-delay: -6s; }
[data-theme="dark"] .glow--3 { opacity: 0.2; animation-delay: -12s; }
[data-theme="dark"] .glow--4 { opacity: 0.14; animation-delay: -18s; }
[data-theme="dark"] .glow--5 { opacity: 0.12; animation-delay: -9s; }

@keyframes aurora {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(80px, -50px) scale(1.12); }
  100% { transform: translate(-60px, 40px) scale(0.95); }
}

/* ---------- 6. Chips (Experience toolbox) ---------- */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips li {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--heading);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.chips--yellow li { background: var(--yellow); border-color: var(--yellow); color: var(--ink); font-weight: 600; }
.chips--dark li { background: var(--heading); border-color: var(--heading); color: var(--surface); }

@media (max-width: 560px) {
  .section-title { letter-spacing: -2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .eyebrow__line { width: 40px; transition: none; }
  *, *::before, *::after { animation: none !important; }
}
