/* Christopher Grantham portfolio — mobile-first, navy/blue */
:root {
  --navy: #0f2347;
  --navy-2: #16325c;
  --navy-3: #1c3d6e;
  --blue: #1c4ed8;
  --blue-2: #3b6cf0;
  --blue-soft: #9eb6e8;
  --ink: #142033;
  --muted: #5a6a80;
  --paper: #f3f5fa;
  --line: #d5dcea;
  --white: #ffffff;
  --header-h: 4rem;
  --radius: 16px;
  --shadow: 0 16px 40px rgba(15, 35, 71, 0.18);
  --font-serif: "Playfair Display", "Liberation Serif", Georgia, serif;
  --font-sans: "Source Sans 3", "Liberation Sans", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  min-height: 100%;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
:focus-visible {
  outline: 2px solid var(--blue-2);
  outline-offset: 3px;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--white);
  color: var(--navy);
  padding: 0.5rem 0.8rem;
  z-index: 100;
  border-radius: 6px;
}
.skip-link:focus { top: 0.75rem; }

.wrap {
  width: min(1160px, calc(100% - 2rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(15, 35, 71, 0.92);
  backdrop-filter: blur(12px);
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}
.logo {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  border-radius: 1px;
}
.site-nav {
  display: none;
  flex-direction: column;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--navy);
  padding: 0.5rem 1rem 1rem;
  gap: 0.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-nav a {
  color: #e8eef8;
  text-decoration: none;
  padding: 0.7rem 0.4rem;
  font-weight: 600;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--white); }
.nav-resume {
  color: var(--white) !important;
}
body.nav-open .site-nav { display: flex; }

@media (min-width: 800px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    flex-direction: row;
    position: static;
    background: transparent;
    padding: 0;
    gap: 0.2rem 1.25rem;
    border: 0;
    align-items: center;
  }
  .site-nav a { padding: 0.35rem 0; }
  .nav-resume {
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    padding: 0.35rem 0.9rem !important;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 650;
  border-radius: 999px;
  padding: 0.8rem 1.25rem;
  border: 1px solid transparent;
  line-height: 1.2;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: var(--blue);
  color: var(--white);
}
.btn-primary:hover { background: #163fbb; }
.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.45);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-small {
  background: var(--navy);
  color: var(--white);
  padding: 0.55rem 0.95rem;
  font-size: 0.92rem;
  white-space: nowrap;
}

/* Hero */
.hero {
  background:
    radial-gradient(1200px 500px at 80% 0%, rgba(59,108,240,0.28), transparent 55%),
    linear-gradient(180deg, var(--navy) 0%, #0b1a36 100%);
  color: var(--white);
  padding: 2rem 0 3rem;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-soft);
  margin: 0 0 0.6rem;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 7vw, 4.1rem);
  line-height: 1.05;
  margin: 0 0 0.6rem;
  font-weight: 700;
}
.hero-title {
  color: #8eb0ff;
  font-weight: 650;
  font-size: 1.05rem;
  margin: 0 0 1rem;
}
.hero-pitch {
  color: #d7e0f0;
  font-size: 1.08rem;
  max-width: 38rem;
  margin: 0 0 1.5rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-photo {
  position: relative;
  max-width: 420px;
  margin-inline: auto;
  padding: 0 0 1rem 0;
}
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 10% 0 -0.7rem 10%;
  border: 1px solid rgba(59,108,240,0.55);
  border-radius: 28px;
  z-index: 0;
  pointer-events: none;
}
.hero-photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1.03;
  object-fit: cover;
  object-position: 50% 10%;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

@media (min-width: 860px) {
  .hero { padding: 3.5rem 0 4.5rem; }
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
  }
  .hero-photo { max-width: none; margin: 0; padding: 0 1rem 1.25rem 0; }
  .hero-photo::after { inset: 12% 0 -0.8rem 12%; }
}

/* Section intros */
.section-intro { margin: 0 0 1.5rem; }
.section-intro h2,
.contact h2,
.about h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
  color: var(--navy);
}
.section-intro p { margin: 0; color: var(--muted); max-width: 42rem; }

/* Demos */
.demos {
  padding: 3.25rem 0 2.5rem;
  background: var(--white);
}
.demo-shell {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--paper);
  min-height: 70vh;
}
.demo-sidebar {
  order: 2;
  background: var(--navy);
  color: var(--white);
}
.demo-tabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 0.35rem;
  padding: 0.65rem;
  scrollbar-width: thin;
}
.demo-tab {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #e8eef8;
  text-align: left;
  font-family: inherit;
  font-size: 0.92rem;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  flex: 0 0 auto;
  min-width: 11.5rem;
  line-height: 1.3;
}
.demo-tab strong { display: block; font-size: 0.95rem; color: var(--white); }
.demo-tab span { display: block; color: var(--blue-soft); font-size: 0.78rem; margin-top: 0.15rem; }
.demo-tab[aria-selected="true"] {
  background: var(--blue);
  border-color: var(--blue-2);
}
.demo-stage {
  order: 1;
  display: flex;
  flex-direction: column;
  min-height: 68vh;
  background: #0b1528;
}
.demo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.demo-toolbar h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  color: var(--navy);
}
.demo-toolbar p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.demo-tech { color: var(--navy-2) !important; font-weight: 600; margin-top: 0.25rem !important; font-size: 0.85rem !important; }
.demo-frame-wrap {
  position: relative;
  flex: 1;
  min-height: 55vh;
  background: #0b1528;
}
.demo-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.demo-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #0b1528;
}
.demo-fallback[hidden] { display: none !important; }
.demo-fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: saturate(0.95);
}
.fallback-card {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  background: rgba(15, 35, 71, 0.92);
  color: var(--white);
  padding: 1rem 1.1rem;
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
}
.fallback-card p { margin: 0; flex: 1 1 16rem; color: #dce5f5; }

@media (min-width: 960px) {
  .demo-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: min(78vh, 860px);
  }
  .demo-sidebar {
    order: 0;
    position: sticky;
    top: var(--header-h);
    align-self: start;
    height: min(78vh, 860px);
    overflow: auto;
  }
  .demo-tabs {
    flex-direction: column;
    overflow: visible;
    padding: 0.85rem;
    height: 100%;
  }
  .demo-tab { min-width: 0; width: 100%; }
  .demo-stage { order: 0; min-height: min(78vh, 860px); }
  .demo-frame-wrap { min-height: 0; }
}

/* About */
.about {
  padding: 3.5rem 0 3rem;
  background: var(--paper);
}
.about-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.about-copy p { font-size: 1.08rem; color: #2a384c; }
.about-copy .btn { margin-top: 0.5rem; }
.resume-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: 0 8px 24px rgba(15, 35, 71, 0.05);
}
.resume-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  color: var(--navy);
}
.resume-card p { margin: 0 0 1rem; color: #3a4658; }
.skill-cloud {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.skill-cloud li {
  background: #e8eefb;
  color: var(--navy);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 650;
}
.subhead {
  font-family: var(--font-serif);
  color: var(--navy);
  font-size: 1.45rem;
  margin: 0 0 1rem;
}
.timeline {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0 0 0 1.1rem;
  border-left: 2px solid var(--line);
}
.timeline li {
  position: relative;
  padding: 0 0 1.25rem 1.15rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -1.18rem;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  background: var(--blue);
  border: 2px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--blue-2);
}
.timeline .when {
  display: block;
  color: var(--blue);
  font-weight: 700;
  font-size: 0.88rem;
}
.timeline strong { display: block; color: var(--navy); }
.timeline .org { display: block; color: var(--muted); font-size: 0.95rem; }
.timeline p { margin: 0.25rem 0 0; color: #3a4658; }
.about-split {
  display: grid;
  gap: 1.75rem;
}
.plain-list { margin: 0; padding: 0 0 0 1.1rem; color: #3a4658; }
.plain-list li { margin-bottom: 0.35rem; }
.edu { margin: 0; }
.edu strong { display: block; color: var(--navy); }
.edu span { color: var(--muted); }

@media (min-width: 800px) {
  .about-grid { grid-template-columns: 1.2fr 0.8fr; align-items: start; }
  .about-split { grid-template-columns: 1.2fr 0.8fr; }
}

/* Contact */
.contact {
  background: var(--navy);
  color: var(--white);
  padding: 3.5rem 0;
}
.contact .eyebrow { color: var(--blue-soft); }
.contact h2 { color: var(--white); }
.contact-inner { display: grid; gap: 1.75rem; }
.contact-inner > div > p { color: #c9d5ea; max-width: 34rem; }
.contact-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}
.contact-cards li {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.contact-cards .label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-soft);
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.contact-cards a, .contact-cards span:last-child {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  word-break: break-word;
}
.contact-cards a:hover { text-decoration: underline; }

@media (min-width: 800px) {
  .contact-inner { grid-template-columns: 1fr 1fr; align-items: center; }
}

.site-footer {
  background: #0b1a36;
  color: #9aa8bf;
  padding: 1.25rem 0;
  font-size: 0.88rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}
.site-footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.contact-cards a, .hero-title {
  overflow-wrap: anywhere;
}
