/* ═══════════════════════════════════════════════════════════════
   Hugo Dignoes Ricart — Academic Portfolio
   Shared Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Design tokens ──────────────────────────────────────────── */
:root {
  --navy:        #12263a;
  --navy-mid:    #1a3a5c;
  --blue:        #1f618d;
  --blue-light:  #2e86c1;
  --teal:        #1abc9c;
  --teal-dark:   #17a589;
  --text:        #1c2833;
  --muted:       #5d6d7e;
  --light-muted: #8395a7;
  --bg:          #f4f6f9;
  --surface:     #ffffff;
  --border:      #dce3ea;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow-sm:   0 1px 6px rgba(0,0,0,.07);
  --shadow:      0 2px 16px rgba(0,0,0,.09);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
  --nav-h:       68px;
  --transition:  .22s ease;
  --max-w:       1080px;
}

/* ─── Base ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ─── Container ──────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── NAV ────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.nav-brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.01em;
}
.nav-brand-role {
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .01em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
}

.nav-menu a {
  display: block;
  padding: .45rem .85rem;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.nav-menu a:hover,
.nav-menu a.active {
  color: var(--blue);
  background: #ebf5fb;
  text-decoration: none;
}
.nav-menu a.active { color: var(--navy); }

/* ─── PAGE HEADER (hero banner on each page) ────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 55%, var(--blue) 100%);
  color: #fff;
  padding: 4rem 0 3.5rem;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: .55rem;
}

.page-header .subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,.7);
  max-width: 600px;
}

/* ─── SECTION ────────────────────────────────────────────────── */
.section {
  padding: 4rem 0;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 2rem;
  padding-bottom: .55rem;
  border-bottom: 3px solid var(--teal);
  display: inline-block;
}

/* ─── CARD ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1.2rem;
  border-radius: 6px;
  font-size: .87rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

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

.btn-teal {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.btn-teal:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--blue-light);
  border-color: var(--blue-light);
}
.btn-outline:hover { background: var(--blue-light); color: #fff; }

/* ─── TAGS / BADGES ──────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .2rem .7rem;
  border-radius: 20px;
  background: #ebf5fb;
  color: var(--blue);
  border: 1px solid #aed6f1;
}

.tag-teal {
  background: #e8f8f5;
  color: #0e7a65;
  border-color: #a2d9ce;
}

/* ─── TIMELINE ───────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2.8rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--blue-light), var(--teal));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 2.8rem;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -2.8rem;
  top: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--blue-light);
  box-shadow: 0 0 0 3px rgba(46,134,193,.15);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.timeline-item:hover .timeline-dot {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(26,188,156,.2);
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.timeline-item:hover .timeline-card { box-shadow: var(--shadow); }

.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .4rem;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

.timeline-date {
  font-size: .8rem;
  color: var(--muted);
  background: var(--bg);
  padding: .22rem .75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-company {
  font-size: .97rem;
  color: var(--blue-light);
  margin-bottom: .3rem;
}
.timeline-company a { color: inherit; }
.timeline-company a:hover { text-decoration: underline; }

.timeline-location {
  font-size: .82rem;
  color: var(--light-muted);
  margin-bottom: .8rem;
}
.timeline-location i { margin-right: .35rem; }

.timeline-desc {
  font-size: .94rem;
  color: var(--muted);
  line-height: 1.72;
}
.timeline-desc p { margin-bottom: .6rem; }
.timeline-desc p:last-child { margin-bottom: 0; }
.timeline-desc ul {
  list-style: disc;
  padding-left: 1.25rem;
}
.timeline-desc ul li { margin-bottom: .35rem; }

/* ─── FOOTER ─────────────────────────────────────────────────── */
footer {
  margin-top: auto;
  background: var(--navy);
  color: rgba(255,255,255,.45);
  padding: 1.6rem 2rem;
  font-size: .82rem;
  text-align: center;
}
footer a { color: rgba(255,255,255,.6); }
footer a:hover { color: var(--teal); }

/* ─── UTILITIES ──────────────────────────────────────────────── */
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.text-muted { color: var(--muted); }
.text-small { font-size: .88rem; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --nav-h: 60px; }

  .page-header h1 { font-size: 1.9rem; }

  .nav-brand-role { display: none; }

  .nav-menu a {
    padding: .4rem .6rem;
    font-size: .78rem;
  }

  .container { padding: 0 1.2rem; }
}

@media (max-width: 560px) {
  .nav-menu { display: none; }
}
