/* =========================================================================
   Jorge A. Perez — professional card site
   Palette and spacing live in the :root block below. Change a value there
   and it updates everywhere.
   ========================================================================= */

:root {
  /* EDIT: colors */
  --ink:        #0f1f2e;   /* main text */
  --ink-soft:   #48606f;   /* secondary text */
  --ink-faint:  #7b8f9c;   /* labels, dates */
  --navy:       #0f2b46;   /* headers, dark band */
  --navy-deep:  #0a1e33;
  --accent:     #1a7f8e;   /* links, highlights */
  --accent-dk:  #14636f;
  --bg:         #ffffff;
  --bg-soft:    #f5f8fa;
  --line:       #e2eaf0;

  --wrap: 1100px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 43, 70, .05), 0 12px 32px rgba(15, 43, 70, .07);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); }

h1, h2, h3 { font-family: var(--font-serif); line-height: 1.2; margin: 0; }

.muted { color: var(--ink-faint); font-weight: 400; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: #fff; padding: .7rem 1.1rem; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------------------------- buttons ---------------------------- */
.btn {
  display: inline-block;
  padding: .7rem 1.35rem;
  border-radius: 999px;
  font-size: .93rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-solid   { background: var(--navy); color: #fff; }
.btn-solid:hover { background: var(--accent-dk); }

.btn-outline { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-light   { background: #fff; color: var(--navy); }
.btn-light:hover { background: #eef5f7; }

.btn-ghost   { border-color: rgba(255,255,255,.35); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.1); }

/* ---------------------------- top bar ---------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: .85rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
}

.brand {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--ink); font-weight: 600;
  margin-right: auto;
}
.brand-mark {
  width: 34px; height: 34px; flex: none;
  border-radius: 9px;
  background: var(--navy); color: #fff;
  font-family: var(--font-serif); font-weight: 700; font-size: .95rem;
  display: grid; place-items: center;
}
.brand-name { font-size: .98rem; letter-spacing: .01em; }

.nav { display: flex; gap: 1.5rem; }
.nav a {
  color: var(--ink-soft); text-decoration: none;
  font-size: .9rem; font-weight: 500;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

.topbar-actions { display: flex; align-items: center; gap: .6rem; }

.nav-toggle {
  display: none;
  width: 40px; height: 38px;
  background: none; border: 1.5px solid var(--line); border-radius: 10px;
  cursor: pointer; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span { width: 17px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ---------------------------- hero ---------------------------- */
.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: .78rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  letter-spacing: -.02em;
  margin-bottom: 1.25rem;
}

.lede { font-size: 1.14rem; color: var(--ink); margin: 0 0 1.1rem; }
.lede strong { color: var(--accent-dk); }
.sub  { font-size: 1rem; color: var(--ink-soft); margin: 0 0 2rem; }

.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero-meta {
  margin: 1.75rem 0 0;
  display: flex; flex-wrap: wrap; gap: .6rem;
  font-size: .88rem; color: var(--ink-faint);
}

/* profile card */
.hero-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  position: sticky; top: 100px;
}
.card-photo {
  width: 100%;
  /* height:auto is load-bearing: the img's width/height attributes act as a
     presentational hint that would otherwise beat aspect-ratio below. */
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  /* EDIT: nudge if a new photo sits low or high in the frame, e.g. "50% 25%" */
  object-position: 50% 50%;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  background: var(--line);
}
.card-name { font-size: 1.25rem; margin-bottom: .3rem; }
.card-role { margin: 0 0 1.5rem; font-size: .92rem; color: var(--ink-soft); }

.card-facts { margin: 0; display: grid; gap: 1rem; }
.card-facts > div { display: grid; gap: .1rem; }
.card-facts dt {
  font-size: .72rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint);
}
.card-facts dd { margin: 0; font-size: .93rem; font-weight: 500; }

/* ---------------------------- metrics ---------------------------- */
.metrics {
  max-width: var(--wrap);
  margin: 1rem auto 0;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric { display: grid; gap: .3rem; }
.metric-num {
  font-family: var(--font-serif);
  font-size: 2.1rem; font-weight: 700; line-height: 1;
  color: var(--navy);
}
.metric-label { font-size: .85rem; color: var(--ink-soft); }

/* ---------------------------- sections ---------------------------- */
.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 0;
}
.section-eyebrow {
  margin: 0 0 .6rem;
  font-size: .76rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent);
}
.section-eyebrow.light { color: #7fd0da; }
.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  letter-spacing: -.015em;
  margin-bottom: 2rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  font-size: 1.03rem;
  color: var(--ink-soft);
}
.about-grid p { margin: 0; }

/* impact cards */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
.impact-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.6rem 1.7rem;
}
.impact-card h3 { font-size: 1.12rem; margin-bottom: .55rem; }
.impact-card p  { margin: 0; font-size: .96rem; color: var(--ink-soft); }

/* ---------------------------- experience ---------------------------- */
.timeline {
  border-left: 2px solid var(--line);
  padding-left: 2rem;
  margin-left: .5rem;
  display: grid;
  gap: 3rem;
}
.role { position: relative; }
.role::before {
  content: "";
  position: absolute;
  left: calc(-2rem - 7px);
  top: .55rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}
.role-head {
  display: flex; flex-wrap: wrap; gap: .4rem 1.5rem;
  align-items: baseline; justify-content: space-between;
  margin-bottom: 1rem;
}
.role-title   { font-size: 1.25rem; }
.role-company { margin: .25rem 0 0; font-size: .95rem; color: var(--ink-soft); }
.role-dates {
  margin: 0;
  font-size: .82rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}
.role-points { margin: 0; padding-left: 1.1rem; display: grid; gap: .75rem; }
.role-points li { font-size: .97rem; color: var(--ink-soft); }
.role-points li::marker { color: var(--accent); }

/* ---------------------------- patents ---------------------------- */
.patent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}
.patent {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  background: var(--bg);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.patent:hover,
.patent:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.patent-cta {
  margin: 1.1rem 0 0;
  font-size: .82rem; font-weight: 600;
  color: var(--accent);
}
.patent-no {
  margin: 0 0 .6rem;
  font-size: .8rem; font-weight: 600; letter-spacing: .04em;
  color: var(--accent);
}
.patent h3 { font-size: 1.02rem; margin-bottom: .6rem; }
.patent-date { margin: 0 0 auto; font-size: .84rem; color: var(--ink-faint); }

/* ---------------------------- education ---------------------------- */
.edu-list { list-style: none; margin: 0; padding: 0; display: grid; }
.edu {
  display: flex; flex-wrap: wrap; gap: .3rem 1.5rem;
  align-items: baseline; justify-content: space-between;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}
.edu:first-child { border-top: 1px solid var(--line); }
.edu h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.edu p  { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.edu-dates {
  font-size: .82rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint); white-space: nowrap;
}

/* ---------------------------- skills ---------------------------- */
.skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 3rem;
}
.skill-group h3 {
  font-size: .8rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  font-family: var(--font-sans);
  color: var(--ink-faint);
  margin-bottom: .9rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
}
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li {
  font-size: .86rem;
  padding: .35rem .8rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* ---------------------------- contact ---------------------------- */
.contact {
  margin-top: 5.5rem;
  background: var(--navy);
  background-image: radial-gradient(circle at 15% 0%, rgba(26,127,142,.45), transparent 55%);
  color: #fff;
}
.contact-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 5rem 1.5rem;
}
.contact h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  letter-spacing: -.015em;
  max-width: 22ch;
  margin-bottom: 1rem;
}
.contact-lede {
  margin: 0 0 2.2rem;
  max-width: 58ch;
  color: rgba(255,255,255,.78);
  font-size: 1.03rem;
}
.contact-links { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------------------------- footer ---------------------------- */
.footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,.6);
  font-size: .85rem;
}
.footer > * { margin: 0; }
.footer {
  display: flex; flex-wrap: wrap; gap: .5rem;
  align-items: center; justify-content: space-between;
  padding: 1.5rem max(1.5rem, calc((100vw - var(--wrap)) / 2 + 1.5rem));
}
.footer a { color: rgba(255,255,255,.75); text-decoration: none; }
.footer a:hover { color: #fff; }

/* ---------------------------- reveal on scroll ---------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .patent:hover { transform: none; }
}

/* ---------------------------- responsive ---------------------------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 3rem; }
  .hero-card { position: static; }
  .patent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem; }
}

@media (max-width: 760px) {
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: .5rem 1.5rem 1rem;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .nav a.active { border-bottom-color: var(--line); }
  .nav a:last-child { border-bottom: none; }
  .nav-toggle { display: flex; }
  .topbar { position: sticky; }
  .topbar-inner { position: relative; }

  /* the '·' between the two hero-meta items only reads well on one line */
  .hero-meta span[aria-hidden] { display: none; }

  .about-grid,
  .impact-grid,
  .skills { grid-template-columns: 1fr; }

  .section { padding-top: 3.5rem; }
  .timeline { padding-left: 1.4rem; margin-left: .25rem; gap: 2.5rem; }
  .role::before { left: calc(-1.4rem - 7px); }
  .contact-inner { padding: 3.5rem 1.5rem; }
}

@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr; }
  .patent-grid { grid-template-columns: 1fr; }
  .brand-name { display: none; }
}
