/* =========================================================
   Kevin Chavarría — Portfolio landing page
   Plain HTML/CSS/JS. Full-screen, no app-shell, no framework.
   ========================================================= */

:root{
  --bg: #FDFDFE;
  --bg-soft: #F6F4FC;
  --surface: #FFFFFF;
  --surface-translucent: rgba(253, 253, 254, 0.7);
  --card-translucent: rgba(253, 253, 254, 0.8);
  --card-border: rgba(255, 255, 255, 0.6);
  --shadow: rgba(23, 21, 31, 0.14);
  --shadow-soft: rgba(23, 21, 31, 0.05);
  --ink: #17151F;
  --ink-soft: #615C72;
  --line: #E3DFF2;
  --violet: #7C6AEF;
  --violet-dark: #6552D6;
  --violet-soft: #EFEBFE;
  --violet-solid: #6552D6;
  --yellow: #F5C944;
  --yellow-soft: #FBF0CE;
  --pill-bg: #17151F;
  --pill-text: #FFFFFF;
  --radius-md: 18px;
  --radius-full: 999px;
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-heading: 'Fredoka', 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --container: 1180px;
  --nav-h: 84px;
}

:root[data-theme="dark"]{
  --bg: #121018;
  --bg-soft: #1A1725;
  --surface: #1E1B2A;
  --surface-translucent: rgba(18, 16, 24, 0.72);
  --card-translucent: rgba(24, 21, 33, 0.82);
  --card-border: rgba(255, 255, 255, 0.08);
  --shadow: rgba(0, 0, 0, 0.45);
  --shadow-soft: rgba(0, 0, 0, 0.3);
  --ink: #F4F2FB;
  --ink-soft: #A79FC2;
  --line: #322D45;
  --violet: #9B8CFB;
  --violet-dark: #B3A6FF;
  --violet-soft: #291F45;
  --yellow-soft: #3A331A;
  --pill-bg: #F4F2FB;
  --pill-text: #17151F;
}

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

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .2s ease, color .2s ease;
}

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

a{ color: var(--ink); text-decoration: none; }

.mono{ font-family: var(--font-mono); }

h1, h2, h3{ margin: 0; font-family: var(--font-display); }

p{ margin: 0; }

.section{ position: relative; padding: 96px 0; border-bottom: 1px solid var(--line); }
.section-inner{ width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 32px; }

.section-title{ font-size: clamp(28px, 4vw, 44px); font-weight: 700; letter-spacing: -0.02em; }

.body-text{ font-size: 17px; line-height: 1.7; color: var(--ink-soft); max-width: 640px; margin-bottom: 16px; }
.body-text:last-of-type{ margin-bottom: 0; }

/* ---------- ambient blobs ---------- */
.blob{
  position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0;
}
.blob--violet{ top: 8vh; left: 55%; width: 380px; height: 380px; background: var(--violet); opacity: 0.18; }
.blob--yellow{ top: 26vh; left: 78%; width: 300px; height: 300px; background: var(--yellow); opacity: 0.22; }
@media (max-width: 720px){
  .blob--violet{ left: 10%; width: 240px; height: 240px; }
  .blob--yellow{ left: 60%; top: 40vh; width: 200px; height: 200px; }
}

/* ---------- tags / dots / badges ---------- */
.tag-row{ display: flex; flex-wrap: wrap; gap: 10px; }
.tag{
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--violet-soft); color: var(--violet-dark); padding: 7px 13px; border-radius: var(--radius-full);
}

.dot{ width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot--green{ background: #4ADE80; }
.dot--violet{ background: var(--violet); }

.badge{
  display: inline-flex; align-items: center; gap: 8px; background: var(--violet-soft); color: var(--violet-dark);
  padding: 8px 16px; border-radius: var(--radius-full); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
}

/* ---------- buttons ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 14px; font-weight: 500; padding: 14px 28px; border-radius: var(--radius-full);
  border: 1px solid transparent; cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.btn--primary{ background: var(--pill-bg); color: var(--pill-text); }
.btn--primary:hover{ background: var(--violet-solid); transform: translateY(-2px); color: #fff; }
.btn--primary:active{ transform: translateY(0); background: #4A3AA8; }
.btn--secondary{ background: transparent; color: var(--ink); border-color: var(--line); }
.btn--secondary:hover{ border-color: var(--ink); background: var(--violet-soft); }
.btn--ghost{ background: transparent; color: var(--ink); border-color: var(--line); font-size: 13px; padding: 11px 20px; }
.btn--ghost:hover{ border-color: var(--ink); background: var(--violet-soft); }
.btn--sm{ padding: 11px 26px; font-size: 13px; }

.link-underline{
  font-size: 13px; color: var(--ink); padding-bottom: 2px;
  background-image: linear-gradient(var(--violet), var(--violet));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 1.5px;
  transition: background-size .2s ease, color .2s ease;
}
.link-underline:hover{ background-size: 100% 1.5px; color: var(--violet-dark); }

/* ============ HEADER ============ */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: var(--surface-translucent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled{ border-color: var(--line); box-shadow: 0 8px 24px var(--shadow-soft); }

.header-inner{
  max-width: var(--container); margin: 0 auto; height: var(--nav-h);
  padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand{ display: flex; align-items: center; gap: 11px; }

/* CK monogram. The light/dark files are the artwork's own
   light-background and dark-background cuts — swapped, never recoloured. */
.brand-mark{
  flex-shrink: 0;
  display: block;
  width: 50px;
  aspect-ratio: 5 / 3;
  background: url('../assets/images/brand/logo-ck-light.png') center / contain no-repeat;
  transition: opacity .18s ease, transform .18s ease;
}
:root[data-theme="dark"] .brand-mark{
  background-image: url('../assets/images/brand/logo-ck-dark.png');
}
.brand:hover .brand-mark{ opacity: .82; transform: translateY(-1px); }
.brand-mark--sm{ width: 44px; }
.brand-text{ display: flex; flex-direction: column; line-height: 1.25; }
.brand-name{ font-size: 14px; letter-spacing: 0.01em; }
.brand-sub{ font-size: 11px; color: var(--ink-soft); }

.nav-pill-group{
  display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface);
  padding: 6px; border-radius: var(--radius-full);
}
.nav-pill{
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 18px;
  border-radius: var(--radius-full); transition: background .15s ease, color .15s ease;
}
.nav-pill:hover{ background: var(--violet-soft); color: var(--violet-dark); }
.nav-pill.is-active{ background: var(--pill-bg); color: var(--pill-text); }
.nav-pill--cta{ background: var(--pill-bg); color: var(--pill-text); }
.nav-pill--cta:hover{ background: var(--violet-solid); color: #fff; }
.nav-pill--cta.is-active{ background: var(--pill-bg); color: var(--pill-text); }

.header-right{ display: flex; align-items: center; gap: 18px; }
.header-actions{ display: flex; align-items: center; gap: 22px; }

/* ---------- language + theme toggles ---------- */
.header-toggles{ display: flex; align-items: center; gap: 10px; }

.lang-btn{
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 15px; border-radius: var(--radius-full);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 12px; letter-spacing: 0.04em; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.lang-btn:hover{ border-color: var(--ink); background: var(--violet-soft); }

.icon-btn{
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.icon-btn:hover{ border-color: var(--ink); background: var(--violet-soft); }
.icon-btn__icon{
  position: absolute; font-size: 15px;
  transition: opacity .2s ease, transform .3s ease;
}
.icon-btn__icon--light{ opacity: 0; transform: rotate(-50deg) scale(.6); }
:root[data-theme="dark"] .icon-btn__icon--dark{ opacity: 0; transform: rotate(50deg) scale(.6); }
:root[data-theme="dark"] .icon-btn__icon--light{ opacity: 1; transform: rotate(0) scale(1); }

.menu-toggle{
  position: relative;
  display: none; width: 42px; height: 42px; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer;
}
.menu-toggle__icon{
  position: absolute; font-size: 15px; color: var(--ink);
  transition: opacity .15s ease, transform .15s ease;
}
.menu-toggle__icon--close{ opacity: 0; transform: rotate(-45deg); }
.site-header.is-open .menu-toggle__icon--open{ opacity: 0; transform: rotate(45deg); }
.site-header.is-open .menu-toggle__icon--close{ opacity: 1; transform: rotate(0); }

.mobile-nav{
  display: none; flex-direction: column; gap: 4px; padding: 0 20px 20px;
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.mobile-nav a{ padding: 12px 6px; font-size: 15px; }
.mobile-nav__divider{ height: 1px; background: var(--line); margin: 8px 0; }
.site-header.is-open .mobile-nav{ display: flex; }

/* ============ HERO ============ */
.hero{
  position: relative; overflow: hidden;
  min-height: 680px;
  padding: 56px 20px;
  display: flex; align-items: center; justify-content: center;
  background-image: url('../assets/images/hero-bg.png');
  background-size: cover;
  background-position: center 32%;
  background-repeat: no-repeat;
}
.hero-inner{
  position: relative; z-index: 1;
  max-width: 860px; margin: 0 auto; padding: 44px 40px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--card-translucent);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  box-shadow: 0 30px 70px var(--shadow);
  transition: background .2s ease, border-color .2s ease;
}

.hero-title{ position: relative; margin-top: 22px; }
.hero-title__text{ display: flex; flex-direction: column; font-family: var(--font-heading); }
.hero-title__line{
  font-weight: 600; font-size: clamp(30px, 5.4vw, 56px); line-height: 1.1; letter-spacing: -0.02em; position: relative; z-index: 1;
}

.hero-copy{ max-width: 520px; margin-top: 26px; font-size: 17px; line-height: 1.6; color: var(--ink-soft); }

.hero-actions{ display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; justify-content: center; }

/* ============ ABOUT ============ */
.about{ display: flex; gap: 80px; align-items: flex-start; }
.about-visual{
  flex: 0 0 300px; width: 300px; height: 300px; border-radius: var(--radius-md);
  background: linear-gradient(155deg, #DCD4FC 0%, #8A78F5 55%, #6D59DE 100%);
  position: relative; overflow: hidden;
}
.about-visual__img{ width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.about-copy{ flex: 1; min-width: 0; }
.about-copy h2{ margin-bottom: 22px; }
.about-copy .tag-row{ margin-top: 12px; }

/* ============ PROJECTS ============ */
.section-head{ display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 44px; flex-wrap: wrap; }

.project-grid{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }

.card{
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform .22s ease, box-shadow .22s ease, background .2s ease, border-color .2s ease;
}
.card:hover{ transform: translateY(-6px); box-shadow: 0 18px 34px var(--shadow); }

.card__thumb{ height: 190px; border-radius: 14px; position: relative; overflow: hidden; transition: transform .35s ease; }
.card:hover .card__thumb{ transform: scale(1.03); }
.card__num{ position: absolute; bottom: 12px; right: 16px; font-size: 34px; font-weight: 700; }
.card__thumb-img{ width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.card__thumb--logo{ background: #F4F2FB; display: flex; align-items: center; justify-content: center; padding: 28px; }
.card__thumb-img--contain{ width: auto; max-width: 78%; height: auto; max-height: 70%; object-fit: contain; }

.card__thumb--yellow{ background: linear-gradient(140deg, #FCEFC6, #F5C944 60%, #DDA92A); }
.card__thumb--yellow .card__num{ color: rgba(23,21,31,0.18); }
.card__thumb--violet{ background: linear-gradient(140deg, #DCD4FC, #8A78F5 60%, #6D59DE); }
.card__thumb--violet .card__num{ color: rgba(255,255,255,0.25); }
.card__thumb--soft-violet{ background: linear-gradient(140deg, #EFEBFE, #B9AEF8 60%, #7C6AEF); }
.card__thumb--soft-violet .card__num{ color: rgba(255,255,255,0.3); }
.card__thumb--gold{ background: linear-gradient(140deg, #FBF0CE, #F5C944 60%, #C99420); }
.card__thumb--gold .card__num{ color: rgba(23,21,31,0.18); }
.card__thumb--deep-violet{ background: linear-gradient(140deg, #D8CFFC, #6D59DE 60%, #4A3AA8); }
.card__thumb--deep-violet .card__num{ color: rgba(255,255,255,0.25); }
.card__thumb--pastel{ background: linear-gradient(140deg, #FCEFC6, #EFEBFE 60%, #B9AEF8); }
.card__thumb--pastel .card__num{ color: rgba(23,21,31,0.18); }

.card__head{ display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card__head h3{ font-size: 19px; font-weight: 600; }
.card__arrow{ flex-shrink: 0; font-size: 15px; color: var(--ink); transition: transform .2s ease, color .2s ease; }
.card:hover .card__arrow{ transform: translate(2px, -2px); color: var(--violet); }
.card p{ font-size: 14px; color: var(--ink-soft); line-height: 1.6; }

/* ============ EXPERIENCE ============ */
.timeline{ display: flex; flex-direction: column; margin-top: 48px; }
.timeline__item{ display: grid; grid-template-columns: 150px 24px 1fr; gap: 0; }
.timeline__item:not(.timeline__item--last){ padding-bottom: 44px; }
.timeline__date{ font-size: 13px; color: var(--ink-soft); padding-top: 2px; }
.timeline__rail{ display: flex; flex-direction: column; align-items: center; }
.timeline__dot{ width: 11px; height: 11px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.timeline__dot--active{ background: var(--violet); }
.timeline__line{ width: 1px; flex: 1; background: var(--line); margin-top: 4px; }
.timeline__body h3{ font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.timeline__body p{ font-size: 15px; color: var(--ink-soft); line-height: 1.65; max-width: 640px; margin-bottom: 14px; }

/* ============ CONTACT ============ */
.contact{ padding: 130px 0; }
.contact-inner{ display: flex; flex-direction: column; align-items: center; text-align: center; }
.contact-title{ font-size: clamp(32px, 5vw, 56px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 20px; max-width: 760px; line-height: 1.05; }
.contact-inner .body-text{ margin-bottom: 34px; }

/* ============ FOOTER ============ */
.site-footer{ padding: 56px 0; }
.footer-inner{
  max-width: var(--container); margin: 0 auto; padding: 0 32px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; flex-wrap: wrap;
}
.footer-role{ font-size: 12px; color: var(--ink-soft); margin: 10px 0 0; }
.footer-col{ display: flex; flex-direction: column; gap: 10px; }
.footer-col a{ font-size: 14px; display: flex; align-items: center; gap: 9px; }
.footer-col a i{ width: 15px; font-size: 13px; color: var(--ink-soft); text-align: center; transition: color .15s ease; }
.footer-col a:hover i{ color: var(--violet-dark); }
.footer-col a:hover{ color: var(--violet-dark); }
.footer-col__label{ font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.footer-col--right{ align-items: flex-end; text-align: right; }

/* ============ scroll-reveal ============ */
[data-reveal]{ opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].in-view{ opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  [data-reveal]{ opacity: 1; transform: none; transition: none; }
  .card, .btn{ transition: none; animation: none; }
  .brand:hover .brand-mark{ transform: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 980px){
  .project-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about{ flex-direction: column; gap: 40px; }
  .about-visual{ width: 220px; height: 220px; flex-basis: auto; }
}

@media (max-width: 860px){
  .nav-pill-group, .header-actions{ display: none; }
  .menu-toggle{ display: flex; }
}

@media (max-width: 640px){
  .section{ padding: 64px 0; }
  .section-inner{ padding: 0 20px; }
  .header-inner{ padding: 0 20px; }
  .header-right{ gap: 10px; }
  .lang-btn{ padding: 0 12px; }
  .hero{ min-height: auto; padding: 40px 16px; background-position: 30% 22%; }
  .hero-inner{ padding: 28px 22px; border-radius: 20px; }
  .project-grid{ grid-template-columns: 1fr; }
  .timeline__item{ grid-template-columns: 90px 20px 1fr; }
  .hero-actions{ flex-direction: column; width: 100%; }
  .hero-actions .btn{ width: 100%; }
  .footer-inner{ flex-direction: column; gap: 28px; }
  .footer-col--right{ align-items: flex-start; text-align: left; }
}
