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

:root {
  --bg: #F8F7F4;
  --surface-tint: #f2f7f2;
  --surface: #ffffff;
  --border: #e8e5e0;
  --heading: #1C2541;
  --text: #2E2E2E;
  --text-body: #2E2E2E;
  --text-muted: #5f6663;
  --accent: #097C87;
  --accent-hover: #07646d;
  --accent-light: rgba(35, 206, 217, 0.16);
  --accent-bright: #23CED9;
  --accent-secondary: #FCA47C;
  --accent-secondary-hover: #ee8f62;
  --sage: #A1CCA6;
  --yellow: #F9D779;
  --tag-bg: rgba(161, 204, 166, 0.22);
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.13);
  --max-width: 1100px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

/* ===========================
   Layout
   =========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   Header / Nav
   =========================== */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

/* ===========================
   Hero
   =========================== */
.hero {
  padding: 72px 0 56px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--heading);
}

.hero h1 span { color: var(--accent); }

.hero p {
  font-size: 1.1rem;
  color: var(--text-body);
  max-width: 540px;
  margin: 0 auto 28px;
}

.hero-tags {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-tag {
  background: rgba(161, 204, 166, 0.28);
  color: var(--heading);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 99px;
}

/* ===========================
   Section Headers
   =========================== */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.section-header span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===========================
   Project Grid
   =========================== */
.projects-section { padding: 0 0 80px; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.project-card-thumb {
  aspect-ratio: 16/9;
  background: var(--accent-light);
  overflow: hidden;
  position: relative;
}

.project-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.project-card:hover .project-card-thumb img {
  transform: scale(1.03);
}

.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: linear-gradient(135deg, var(--accent-light), rgba(35, 206, 217, 0.22));
  color: var(--accent-bright);
}

.thumb-placeholder-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(249, 215, 121, 0.4), transparent 30%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.42), rgba(9, 124, 135, 0.08));
}

.thumb-badge {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.72);
  color: var(--heading);
  border: 1px solid rgba(9, 124, 135, 0.12);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  text-transform: uppercase;
}

.thumb-title {
  max-width: 15ch;
  color: var(--heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.thumb-icon {
  align-self: flex-end;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--accent);
}

.thumb-placeholder svg {
  opacity: 0.9;
}

.project-card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.3;
}

.project-card-desc {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.55;
  flex: 1;
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.project-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  background: var(--tag-bg);
  color: var(--text);
  font-size: 0.73rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 99px;
}

/* ===========================
   About Section
   =========================== */
.about-section {
  background: var(--surface-tint);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 0;
  margin-bottom: 0;
}

.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 40px;
  align-items: start;
}

.about-copy {
  max-width: 70ch;
}

.about-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.about-inner h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--heading);
  margin-bottom: 20px;
}

.about-body p {
  color: var(--text-body);
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.about-media {
  align-self: start;
  padding-top: 3rem;
}

.about-headshot-frame {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #1F3A5F;
  box-shadow: 0 6px 14px rgba(31, 58, 95, 0.08);
  background: #fff;
}

.about-headshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  transform: scale(1.16);
  transform-origin: center;
  display: block;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.skill-chip {
  background: rgba(161, 204, 166, 0.3);
  color: var(--heading);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 99px;
}

/* ===========================
   Contact Section
   =========================== */
.contact-section {
  padding: 64px 0 80px;
  text-align: center;
}

.contact-section h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--heading);
}

.contact-section p {
  color: var(--text-body);
  margin-bottom: 28px;
}

.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 4px 14px rgba(45,106,159,0.3);
}

.btn-outline {
  background: var(--accent-secondary);
  color: #fff;
  border: 1.5px solid var(--accent-secondary);
}

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

/* ===========================
   Footer
   =========================== */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ===========================
   Project Page
   =========================== */
.project-page-header {
  padding: 40px 0 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 24px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--accent); }

.project-page-meta {
  margin-bottom: 28px;
}

.project-page-meta h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--heading);
}

.project-page-meta p {
  color: var(--text-body);
  font-size: 1rem;
  max-width: 640px;
  margin-bottom: 14px;
}

.project-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.project-info-row strong { color: var(--text); }

/* ===========================
   Storyline Embed
   =========================== */
.storyline-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
  position: relative;
}

.storyline-wrap iframe {
  width: 100%;
  border: none;
  display: block;
}

.storyline-wrap.loading::after {
  content: 'Loading module...';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 0.9rem;
  background: #f0f0f0;
}

/* ===========================
   Error / Loading States
   =========================== */
.error-msg {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

.error-msg h2 { margin-bottom: 8px; font-size: 1.2rem; }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 700px) {
  .about-inner { grid-template-columns: 1fr; gap: 24px; }
  .about-copy { max-width: none; }
  .about-media {
    padding-top: 0;
    justify-self: start;
  }
  .about-headshot-frame {
    width: 200px;
    height: 200px;
  }
  .project-grid { grid-template-columns: 1fr; }
  nav { gap: 16px; }
  .nav-links { gap: 16px; }
}
