/* ============================================================
   GABRIEL PARINAS — Portfolio Style
   Design: Custom tokens, OLED dark, fluid type, no Tailwind CDN
   ============================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root, [data-theme="light"] {
  --bg:            #f7f6f2;
  --surface:       #ffffff;
  --surface-2:     #f0ede6;
  --text:          #1d1b17;
  --muted:         #6a6760;
  --faint:         #b5b2ac;
  --border:        rgba(29,27,23,.11);
  --primary:       #0f6b72;
  --primary-hover: #094c51;
  --accent-bg:     #d9e8e7;
  --accent-text:   #094c51;
  --shadow-sm:     0 1px 3px rgba(20,20,15,.07);
  --shadow-md:     0 6px 24px rgba(20,20,15,.09);
  --shadow-lg:     0 20px 60px rgba(20,20,15,.11);
  --radius:        20px;
  --radius-sm:     12px;
  --radius-pill:   999px;
  --transition:    180ms cubic-bezier(.16,1,.3,1);
  --max-w:         1160px;

  /* type scale */
  --text-xs:   clamp(.75rem,  .7rem  + .25vw, .875rem);
  --text-sm:   clamp(.875rem, .8rem  + .35vw, 1rem);
  --text-base: clamp(1rem,    .95rem + .25vw, 1.125rem);
  --text-lg:   clamp(1.125rem,1rem   + .75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,  1.2rem + 1.25vw,2.25rem);
  --text-2xl:  clamp(2rem,    1.2rem + 2.5vw, 3.5rem);
  --text-hero: clamp(2.8rem,  .5rem  + 6vw,   5.5rem);

  /* spacing */
  --s1:.25rem;--s2:.5rem;--s3:.75rem;--s4:1rem;--s5:1.25rem;
  --s6:1.5rem;--s8:2rem;--s10:2.5rem;--s12:3rem;--s16:4rem;
}

[data-theme="dark"] {
  --bg:            #111010;
  --surface:       #1a1918;
  --surface-2:     #222120;
  --text:          #ece8e1;
  --muted:         #a09c95;
  --faint:         #5a5854;
  --border:        rgba(236,232,225,.10);
  --primary:       #5fb3ba;
  --primary-hover: #82cdd3;
  --accent-bg:     #1c3234;
  --accent-text:   #82cdd3;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.25);
  --shadow-md:     0 6px 24px rgba(0,0,0,.32);
  --shadow-lg:     0 20px 60px rgba(0,0,0,.44);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:#111010;--surface:#1a1918;--surface-2:#222120;--text:#ece8e1;--muted:#a09c95;
    --faint:#5a5854;--border:rgba(236,232,225,.10);--primary:#5fb3ba;--primary-hover:#82cdd3;
    --accent-bg:#1c3234;--accent-text:#82cdd3;
    --shadow-sm:0 1px 3px rgba(0,0,0,.25);--shadow-md:0 6px 24px rgba(0,0,0,.32);--shadow-lg:0 20px 60px rgba(0,0,0,.44);
  }
}

/* ---------- BASE RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--s16);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100dvh;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: var(--text-base);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background var(--transition), color var(--transition);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
h1,h2,h3,h4 { text-wrap: balance; line-height: 1.1; }
p, li { text-wrap: pretty; max-width: 72ch; }
ul[role="list"] { list-style: none; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
::selection { background: color-mix(in srgb, var(--primary) 20%, transparent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- SKIP LINK ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}
.sr-only.focus\:not-sr-only:focus,
a.sr-only:focus {
  position: fixed; top: var(--s4); left: var(--s4); z-index: 9999;
  width: auto; height: auto; clip: auto; white-space: normal;
  background: var(--primary); color: #fff;
  padding: var(--s3) var(--s5); border-radius: var(--radius-sm);
  font-weight: 600; box-shadow: var(--shadow-md);
}

/* ---------- LAYOUT ---------- */
.container { width: min(calc(100% - var(--s8)), var(--max-w)); margin-inline: auto; }

/* ---------- HEADER ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s4) 0; gap: var(--s4); flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: var(--s3);
  font-weight: 700; font-size: var(--text-sm); letter-spacing: .02em;
}
.logo-mark {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--primary); display: grid; place-items: center;
  color: #fff; flex-shrink: 0; box-shadow: var(--shadow-sm);
}
.nav-links { display: flex; align-items: center; gap: var(--s6); flex-wrap: wrap; }
.nav-links a {
  font-size: var(--text-sm); color: var(--muted); font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active { font-weight: 600; }
.btn-resume {
  background: var(--primary); color: #fff;
  padding: var(--s2) var(--s5); border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: 600;
  transition: background var(--transition), transform var(--transition);
  display: inline-flex; align-items: center; gap: var(--s2);
}
.btn-resume:hover { background: var(--primary-hover); transform: translateY(-1px); }
.theme-toggle {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  color: var(--muted); transition: all var(--transition);
}
.theme-toggle:hover { color: var(--text); background: var(--surface-2); }

/* Mobile menu */
.mobile-btn {
  display: none; width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); align-items: center; justify-content: center;
}
#mobileNav {
  display: none; padding: var(--s4) 0; border-top: 1px solid var(--border);
  flex-direction: column; gap: var(--s3);
}
#mobileNav.open { display: flex; }
#mobileNav a {
  font-size: var(--text-base); padding: var(--s2) 0;
  color: var(--muted); font-weight: 500;
}
#mobileNav a:hover { color: var(--text); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-btn { display: flex; }
}

/* ---------- MAIN SECTIONS ---------- */
main { padding-top: var(--s12); padding-bottom: var(--s16); }

section { padding-block: clamp(var(--s10), 6vw, var(--s16)); }
section + section { border-top: 1px solid var(--border); }

.section-label {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent-text);
  background: var(--accent-bg); padding: var(--s2) var(--s4);
  border-radius: var(--radius-pill); margin-bottom: var(--s5);
}
h2.section-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: var(--text-2xl); color: var(--text);
  margin-bottom: var(--s4);
}
.section-desc { color: var(--muted); font-size: var(--text-base); max-width: 60ch; }

/* ---------- HERO ---------- */
#home {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--s8); align-items: start;
}
.hero-content { padding-top: var(--s4); }
.hero-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: var(--text-hero); line-height: .95;
  letter-spacing: -.03em; margin-bottom: var(--s5);
}
.hero-role {
  font-size: var(--text-lg); color: var(--primary);
  font-weight: 600; margin-bottom: var(--s5);
}
.hero-summary { color: var(--muted); font-size: var(--text-base); margin-bottom: var(--s8); max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s8); }
.btn-primary {
  background: var(--primary); color: #fff;
  padding: var(--s3) var(--s6); border-radius: var(--radius-pill);
  font-weight: 600; font-size: var(--text-sm);
  display: inline-flex; align-items: center; gap: var(--s2);
  transition: background var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
  padding: var(--s3) var(--s6); border-radius: var(--radius-pill);
  font-weight: 600; font-size: var(--text-sm);
  display: inline-flex; align-items: center; gap: var(--s2);
  transition: all var(--transition);
}
.btn-outline:hover { background: var(--surface-2); border-color: var(--faint); }
.hero-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  padding: var(--s2) var(--s4); border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: var(--text-xs); color: var(--muted);
}
.hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
  position: sticky; top: calc(var(--s16) + var(--s4));
}
.hero-photo {
  width: 100%; aspect-ratio: 3/3.5;
  background: linear-gradient(160deg, var(--accent-bg), var(--surface-2));
  overflow: hidden;
}
.hero-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  display: block;
}
.hero-stats {
  display: grid; grid-template-columns: repeat(3,1fr);
  border-top: 1px solid var(--border);
}
.stat {
  padding: var(--s4) var(--s3); text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: var(--text-xl); color: var(--primary); display: block;
}
.stat-label { font-size: var(--text-xs); color: var(--muted); }

/* ---------- COMPETENCIES ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px,100%), 1fr));
  gap: var(--s4);
}
.skill-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.skill-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.skill-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--accent-bg); display: grid; place-items: center;
  color: var(--primary); margin-bottom: var(--s4);
}
.skill-card h3 { font-size: var(--text-base); font-weight: 700; margin-bottom: var(--s4); }
.tag-group { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tag {
  padding: var(--s1) var(--s3); border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: var(--text-xs); color: var(--muted);
}

/* ---------- CASE STUDIES / TOOLS / CONTACT (unchanged structure) ---------- */
/* These classes are kept from your original Tailwind classes for compatibility */

/* ---------- EXPERIENCE TIMELINE ---------- */
.timeline { display: grid; gap: var(--s4); }
.job-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s6);
  box-shadow: var(--shadow-sm);
  display: grid; grid-template-columns: 200px 1fr; gap: var(--s6);
  transition: box-shadow var(--transition);
}
.job-card:hover { box-shadow: var(--shadow-md); }
.job-meta { padding-top: var(--s1); }
.job-period {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--primary); margin-bottom: var(--s2);
}
.job-company { font-size: var(--text-sm); color: var(--muted); line-height: 1.4; }
.job-title { font-size: var(--text-base); font-weight: 700; margin-bottom: var(--s2); }
.job-points { padding-left: var(--s5); display: grid; gap: var(--s2); margin-top: var(--s3); }
.job-points li { font-size: var(--text-sm); color: var(--muted); }

/* ---------- CERTIFICATIONS ---------- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px,100%), 1fr));
  gap: var(--s4);
}
.cert-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: var(--s5);
  box-shadow: var(--shadow-sm); display: flex; align-items: flex-start; gap: var(--s3);
  transition: box-shadow var(--transition);
}
.cert-card:hover { box-shadow: var(--shadow-md); }
.cert-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0; margin-top: 6px;
}
.cert-name { font-size: var(--text-sm); font-weight: 600; line-height: 1.4; }
.cert-issuer { font-size: var(--text-xs); color: var(--muted); margin-top: var(--s1); }

/* ---------- TOOLS SECTION ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px,100%), 1fr));
  gap: var(--s3);
}
.tool-chip {
  padding: var(--s3) var(--s4); border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  font-size: var(--text-sm); font-weight: 500; text-align: center;
  transition: all var(--transition);
}
.tool-chip:hover { background: var(--accent-bg); color: var(--accent-text); border-color: var(--primary); }

/* ---------- CONTACT ---------- */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4);
}
.contact-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s6); box-shadow: var(--shadow-sm);
}
.contact-item {
  display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s4); border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  margin-bottom: var(--s3); transition: all var(--transition);
}
.contact-item:last-child { margin-bottom: 0; }
.contact-item:hover { background: var(--accent-bg); border-color: var(--primary); }
.contact-item strong { font-size: var(--text-sm); }
.contact-item span { font-size: var(--text-xs); color: var(--muted); }

/* ---------- FOOTER ---------- */
footer {
  padding: var(--s8) 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--text-sm);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--s4);
}

/* ---------- FADE-IN ANIMATION ---------- */
.fade-in-section {
  opacity: 0; transform: translateY(24px);
  transition: opacity .65s ease-out, transform .65s ease-out;
}
.fade-in-section.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- PRINT ---------- */
@media print {
  header, footer, .hero-actions, .btn-resume, .theme-toggle, .mobile-btn { display: none !important; }
  body { background: white !important; color: black !important; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  #home { grid-template-columns: 1fr; }
  .hero-card { position: static; max-width: 400px; }
  .job-card { grid-template-columns: 1fr; gap: var(--s3); }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero-stats { grid-template-columns: repeat(3,1fr); }
}
