/* ===== Robert McGregor — Personal Site ===== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
  --navy: #16263d;
  --navy-deep: #0f1b2d;
  --slate: #3e5168;
  --slate-light: #6b7d93;
  --accent: #2f6f8f;
  --accent-hover: #245870;
  --bg: #fbfcfd;
  --bg-alt: #f1f4f7;
  --card: #ffffff;
  --border: #e1e7ee;
  --text: #1f2c3d;
  --text-soft: #51637a;
  --shadow: 0 1px 3px rgba(16,30,50,.06), 0 8px 24px rgba(16,30,50,.05);
  --shadow-lg: 0 4px 12px rgba(16,30,50,.08), 0 16px 48px rgba(16,30,50,.08);
  --radius: 10px;
  --maxw: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--navy);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ===== Header / Nav ===== */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,252,253,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}
.brand {
  font-family: 'Fraunces', serif;
  font-weight: 600; font-size: 1.3rem; color: var(--navy);
  letter-spacing: -0.01em;
}
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 34px; list-style: none; }
.nav-links a {
  color: var(--slate); font-weight: 500; font-size: .98rem;
  position: relative; padding: 4px 0;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px; background: var(--accent); transition: width .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--navy); }
.nav-links a.active::after, .nav-links a:hover::after { width: 100%; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; font-size: 1.5rem; color: var(--navy); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--navy); color: #fff;
  padding: 13px 26px; border-radius: var(--radius);
  font-weight: 600; font-size: .97rem; border: 0; cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn:hover { background: var(--navy-deep); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--border); }
.btn.ghost:hover { background: var(--bg-alt); color: var(--navy); border-color: var(--slate-light); }

/* ===== Hero ===== */
.hero {
  padding: 100px 0 80px;
  background:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(47,111,143,.10), transparent 60%),
    var(--bg);
  position: relative;
}
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; align-items: center; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .18em; font-size: .8rem;
  font-weight: 600; color: var(--accent); margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.7rem); margin-bottom: 22px; }
.hero p.lead { font-size: 1.18rem; color: var(--text-soft); max-width: 560px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.portrait {
  aspect-ratio: 1; border-radius: 16px;
  background: linear-gradient(135deg, var(--navy), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: 'Fraunces', serif; font-size: 4.5rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.portrait::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 50%);
}

/* ===== Sections ===== */
section { padding: 74px 0; }
.section-head { margin-bottom: 46px; max-width: 640px; }
.section-head .eyebrow { margin-bottom: 12px; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin-bottom: 14px; }
.section-head p { color: var(--text-soft); font-size: 1.08rem; }
.alt-bg { background: var(--bg-alt); }

/* ===== Stat row ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 10px; }
.stat { text-align: center; }
.stat .num { font-family: 'Fraunces', serif; font-size: 2.6rem; font-weight: 600; color: var(--navy); }
.stat .lbl { color: var(--slate-light); font-size: .92rem; font-weight: 500; }

/* ===== Cards / grids ===== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.card p { color: var(--text-soft); font-size: .98rem; }
.card .icon {
  width: 46px; height: 46px; border-radius: 10px; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--navy), var(--accent));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.3rem;
}

/* ===== Resume page ===== */
.resume-layout { display: grid; grid-template-columns: 300px 1fr; gap: 50px; align-items: start; }
.resume-aside { position: sticky; top: 100px; }
.aside-block { margin-bottom: 32px; }
.aside-block h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--slate); margin-bottom: 14px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: var(--bg-alt); border: 1px solid var(--border);
  padding: 6px 13px; border-radius: 100px; font-size: .85rem; color: var(--slate);
}
.timeline { position: relative; }
.job {
  position: relative; padding: 0 0 38px 30px;
  border-left: 2px solid var(--border);
}
.job:last-child { border-left-color: transparent; padding-bottom: 0; }
.job::before {
  content: ''; position: absolute; left: -7px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
}
.job .when { color: var(--accent); font-weight: 600; font-size: .88rem; text-transform: uppercase; letter-spacing: .05em; }
.job h3 { font-size: 1.3rem; margin: 5px 0 3px; }
.job .org { color: var(--slate); font-weight: 600; margin-bottom: 12px; }
.job ul { list-style: none; }
.job ul li { position: relative; padding-left: 20px; margin-bottom: 8px; color: var(--text-soft); font-size: .98rem; }
.job ul li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }
.job .wins { margin-top: 14px; background: var(--bg-alt); border-radius: 8px; padding: 16px 18px; }
.job .wins .wins-lbl { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.job .wins li::before { content: '★'; font-size: .8rem; }

/* ===== Portfolio ===== */
.portfolio-card { overflow: hidden; padding: 0; }
.portfolio-card .thumb {
  aspect-ratio: 16/10; background: linear-gradient(135deg, var(--navy), var(--accent));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2rem;
  position: relative;
}
.portfolio-card .thumb span { font-family: 'Fraunces', serif; }
.portfolio-card .body { padding: 24px 26px; }
.portfolio-card .kicker { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 600; }
.portfolio-card h3 { font-size: 1.2rem; margin: 6px 0 8px; }

/* ===== Contact ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.contact-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.contact-item .ic {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px;
  background: var(--bg-alt); display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.contact-item .lbl { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-light); font-weight: 600; }
.contact-item a, .contact-item span.val { font-size: 1.05rem; color: var(--navy); font-weight: 500; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .88rem; font-weight: 600; color: var(--slate); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 1rem; color: var(--text); background: var(--card); transition: border-color .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }

/* ===== Footer ===== */
footer { background: var(--navy-deep); color: #cdd6e2; padding: 50px 0 34px; margin-top: 20px; }
footer .foot-grid { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
footer .brand { color: #fff; }
footer .brand span { color: #6fb3d0; }
footer a { color: #9fb3c8; }
footer a:hover { color: #fff; }
footer .foot-links { display: flex; gap: 24px; list-style: none; }
footer .copy { width: 100%; border-top: 1px solid rgba(255,255,255,.1); padding-top: 22px; font-size: .88rem; color: #7e90a6; }

/* ===== Animations ===== */
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; animation: rise .7s ease forwards; }
.reveal:nth-child(2) { animation-delay: .08s; }
.reveal:nth-child(3) { animation-delay: .16s; }
.reveal:nth-child(4) { animation-delay: .24s; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 70px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 10px 28px 20px;
  }
  .nav-toggle { display: block; }
  .hero-grid, .resume-layout, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .resume-aside { position: static; }
  .grid-3, .grid-2, .stats { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 60px 0 50px; }
  section { padding: 50px 0; }
}
