/* ============================================================
   Paulina Rojas — Portfolio
   style.css — variables, base, nav, cards, buttons, footer
   ============================================================ */

/* ---- Design tokens (from logo palette) ---- */
:root {
  --bg:           #F7F3EF;  /* cream */
  --bg-elev:      #FFFFFF;  /* card surface */
  --text:         #1C1C1C;  /* charcoal */
  --accent:       #C4956A;  /* copper / rose-gold */
  --accent-soft:  #EAD9C8;  /* light accent */
  --muted:        #7A7570;  /* muted text */
  --line:         #E6DDD3;  /* hairline borders */
  --line-strong:  #D9CCBE;

  --maxw: 1120px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(28,28,28,.04), 0 4px 14px rgba(28,28,28,.05);
  --shadow-md: 0 6px 26px rgba(28,28,28,.08);

  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

main { flex: 1 1 auto; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -.01em;
}

/* ---- Layout helpers ---- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 28px; }
.section { padding-block: 84px; }
.section--tight { padding-block: 56px; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.section-title { font-size: clamp(28px, 4vw, 40px); }
.section-lead { color: var(--muted); max-width: 56ch; margin: 14px 0 0; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 243, 239, .82);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-nav__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 70px; height: 70px; flex: none; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--font-head); font-size: 17px; font-weight: 600; }
.brand__role { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  position: relative;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }
.nav-links a.is-active { color: var(--text); }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform .18s var(--ease), background .2s var(--ease),
              border-color .2s var(--ease), color .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--text); color: #fff; }
.btn--primary:hover { background: #000; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: #b3855b; }
.btn--sm { padding: 9px 16px; font-size: 13px; }
.btn .arrow { transition: transform .18s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================================
   CARDS (generic surface)
   ============================================================ */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  background: var(--accent-soft);
  color: #8a5e34;
}
.badge--line { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }

/* Decorative orbital ring motif */
.orbit-deco { position: absolute; pointer-events: none; opacity: .5; }
.orbit-deco circle.ring { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.orbit-deco circle.dot { fill: var(--accent); }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; overflow: hidden; padding-block: 96px 80px; }
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}
.hero h1 {
  font-size: clamp(46px, 8vw, 88px);
  line-height: .98;
  letter-spacing: -.02em;
}
.hero h1 .last { color: var(--accent); font-style: italic; }
.hero__sub {
  margin: 22px 0 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 12px;
}
.hero__sub::after { content: ""; flex: 1; height: 1px; background: var(--line); max-width: 120px; }
.hero__bio { margin: 26px 0 0; font-size: 18px; color: #3a3733; max-width: 46ch; }
.hero__cta { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; }

.hero__mark { display: grid; place-items: center; }
.hero__mark img { width: 100%; max-width: 500px; filter: drop-shadow(0 14px 40px rgba(28,28,28,.10)); }

/* ============================================================
   SUMMARY CARDS
   ============================================================ */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.summary__card { padding: 28px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.summary__num { font-family: var(--font-head); font-size: 34px; color: var(--accent); }
.summary__label { font-weight: 600; font-size: 15px; }
.summary__note { color: var(--muted); font-size: 13.5px; }

/* ============================================================
   LANGUAGE CHIPS
   ============================================================ */
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.chip .flag { font-size: 18px; }
.chip .lvl { color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: .04em; }

/* ============================================================
   SKILLS
   ============================================================ */
.skill-group + .skill-group { margin-top: 40px; }
.skill-group__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.skill-group__title { font-family: var(--font-head); font-size: 22px; }
.skill-group__rule { flex: 1; height: 1px; background: var(--line); }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.skill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.skill:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.skill img { width: 26px; height: 26px; flex: none; }
.skill span { font-size: 14px; font-weight: 500; }

/* ---- Skill index rows (editorial) ---- */
.skill-rows { margin-top: 44px; border-top: 1px solid var(--line); }
.skill-row {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 48px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.skill-row__head { position: relative; }
.skill-row__index {
  font-size: 12px; font-weight: 700; letter-spacing: .22em;
  color: var(--accent); display: block; margin-bottom: 8px;
}
.skill-row__title { font-family: var(--font-head); font-size: clamp(24px, 3vw, 30px); }
.skill-row__count { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.skill-row__items { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 4px; }
.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 500;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.skill-pill:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.skill-pill img.tech { width: 22px; height: 22px; flex: none; }
.skill-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.skill-pill .flag {
  width: 26px; height: 18px; flex: none;
  border-radius: 3px; object-fit: cover;
  box-shadow: 0 0 0 1px var(--line-strong);
}
.skill-pill .lvl {
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  color: #8a5e34; background: var(--accent-soft);
  padding: 3px 9px; border-radius: 999px; margin-left: 2px;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  text-align: left;
}
.contact-card__top { display: flex; align-items: center; justify-content: space-between; }
.contact-card__icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid; place-items: center;
}
.contact-card__icon img { width: 24px; height: 24px; }
.contact-card__label { font-weight: 600; font-size: 16px; }
.contact-card__handle { color: var(--muted); font-size: 13.5px; word-break: break-all; }
.contact-card .arrow-pill {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.contact-card:hover .arrow-pill { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============================================================
   PAGE HEADER (sub-pages)
   ============================================================ */
.page-head { position: relative; padding-block: 72px 40px; border-bottom: 1px solid var(--line); overflow: hidden; }
.page-head h1 { font-size: clamp(38px, 6vw, 60px); }
.page-head h1 .accent { color: var(--accent); font-style: italic; }
.page-head p { color: var(--muted); margin: 16px 0 0; max-width: 58ch; font-size: 17px; }

/* ============================================================
   CERTIFICATES
   ============================================================ */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.cert-card { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.cert-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cert-issuer { display: flex; align-items: center; gap: 11px; }
.cert-issuer__logo {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.cert-issuer__logo img { width: 24px; height: 24px; }
.cert-issuer__name { font-weight: 600; font-size: 14px; }
.cert-issuer__year { color: var(--muted); font-size: 12.5px; }
.cert-card__title { font-family: var(--font-head); font-size: 21px; }
.cert-card__desc { color: var(--muted); font-size: 14px; flex: 1; }
.cert-card__foot { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }

.cert-card--add {
  border: 1.5px dashed var(--line-strong);
  background: transparent;
  box-shadow: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 240px;
  color: var(--muted);
  gap: 12px;
}
.cert-card--add:hover { border-color: var(--accent); color: var(--accent); transform: none; box-shadow: none; }
.cert-card--add .plus {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1.5px dashed currentColor;
  display: grid; place-items: center;
  font-size: 26px; font-family: var(--font-head);
}

/* ============================================================
   PROJECTS
   ============================================================ */
.gh-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 26px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.gh-banner__left { display: flex; align-items: center; gap: 16px; }
.gh-banner__avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--text); display: grid; place-items: center;
}
.gh-banner__avatar img { width: 28px; height: 28px; }
.gh-banner__name { font-weight: 600; font-size: 16px; }
.gh-banner__handle { color: var(--muted); font-size: 13.5px; }
.gh-banner__status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.gh-banner__dot { width: 8px; height: 8px; border-radius: 50%; background: #57a05a; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: 26px; }
.proj-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.proj-card__bar { height: 5px; background: var(--accent); }
.proj-card__body { padding: 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.proj-card__tags { display: flex; flex-wrap: wrap; gap: 7px; }
.proj-card__name { font-family: var(--font-head); font-size: 22px; display: flex; align-items: center; gap: 8px; }
.proj-card__desc { color: var(--muted); font-size: 14.5px; flex: 1; }
.proj-card__foot { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.proj-meta { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }
.proj-meta .lang { display: flex; align-items: center; gap: 6px; }
.proj-meta .lang::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--lang-color, var(--accent)); }
.proj-meta .stars { display: flex; align-items: center; gap: 5px; }

.proj-card--add {
  border: 1.5px dashed var(--line-strong);
  background: transparent;
  box-shadow: none;
  min-height: 220px;
  display: grid; place-items: center;
  text-align: center;
  color: var(--muted);
}
.proj-card--add:hover { border-color: var(--accent); color: var(--accent); transform: none; box-shadow: none; }
.proj-card--add .inner { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; }
.proj-card--add .plus {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1.5px dashed currentColor;
  display: grid; place-items: center;
  font-size: 26px; font-family: var(--font-head);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--text); color: #cfc9c2; margin-top: 24px; }

.footer-links { display: flex; gap: 20px; }
.footer-links a { color: #cfc9c2; font-size: 13px; transition: color .2s var(--ease); }
.footer-links a:hover { color: var(--accent); }

.site-footer__bottom {
  border-top: 1px solid #2f2f2f;
}
.site-footer__bottom-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.copyright { font-size: 13px; color: #8f8a84; }
.social-row { display: flex; gap: 10px; }
.social-row a {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid #333;
  display: grid; place-items: center;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.social-row a:hover { background: var(--accent); border-color: var(--accent); }
.social-row img { width: 18px; height: 18px; }

/* focus visibility */
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ============================================================
   CERTIFICATE MODAL
   ============================================================ */
.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cert-modal:not([hidden]) { display: flex; }

.cert-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 28, .55);
  backdrop-filter: blur(4px);
}
.cert-modal__dialog {
  position: relative;
  z-index: 1;
  background: var(--bg-elev);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: min(900px, 92vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cert-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.cert-modal__title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.cert-modal__close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.cert-modal__close:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.cert-modal__body { flex: 1; overflow: hidden; min-height: 0; }
.cert-modal__frame { width: 100%; height: 100%; min-height: 520px; border: none; display: block; }

.cert-modal__foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ============================================================
   CERTIFICATE CARDS v2 — image-top layout
   ============================================================ */
.cert-card {
  padding: 0;
  overflow: hidden;
}
.cert-card__preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--accent-soft);
  flex-shrink: 0;
}
.cert-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s var(--ease);
}
.cert-card:hover .cert-card__preview img { transform: scale(1.04); }

.cert-card__body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* Simplified issuer row */
.cert-issuer { gap: 9px; }
.cert-issuer__logo {
  width: 24px;
  height: 24px;
  border-radius: 0;
  background: none;
  border: none;
  flex-shrink: 0;
}
.cert-issuer__logo img { width: 24px; height: 24px; }
.cert-issuer__logo--emoji {
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
}
.cert-issuer__logo--text {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .04em;
  width: auto;
  height: auto;
}

/* Modal: updated backdrop opacity + frame height */
.cert-modal__backdrop { background: rgba(0, 0, 0, .6); }
.cert-modal__frame { height: 80vh; min-height: unset; }

@media (max-width: 900px) {
  .cert-modal__dialog { max-width: 92vw; }
  .cert-modal__frame { height: 55vh; }
  .cert-modal__head { padding: 20px; }
  .cert-modal__foot { padding: 20px; }
}

@media (max-width: 600px) {
  .cert-modal { padding: 12px; }
  .cert-modal__dialog { max-width: 95vw; }
  .cert-modal__frame { height: 50vh; }
  .cert-modal__head { padding: 16px; }
  .cert-modal__foot { padding: 16px; flex-direction: column; gap: 8px; }
  .cert-modal__foot .btn { width: 100%; justify-content: center; }
  .cert-modal__title { font-size: 18px; }
}
