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

:root {
  --accent: #1F5C99;
  --accent-dark: #174a7e;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --text-light: #888;
  --bg: #fafaf8;
  --card-bg: #ffffff;
  --border: #e4e4e0;
  --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 2px 8px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.1);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Serif 4', 'Palatino Linotype', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* Layout */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Header / Hero ─────────────────────────────────────── */
.site-header {
  padding: 5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
}

.site-name {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.site-title {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.01em;
  margin-bottom: 1.5rem;
}

.site-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  align-items: center;
}

.site-contact span.sep { color: var(--border); }

.site-contact a {
  color: var(--text-muted);
}
.site-contact a:hover { color: var(--accent); text-decoration: underline; }

/* ── Sections ───────────────────────────────────────────── */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type { border-bottom: none; }

.section-heading {
  font-family: var(--font-display);
  font-size: 1.0rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 1.75rem;
}

/* ── About ──────────────────────────────────────────────── */
.about-body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 680px;
}

/* ── Project Cards ──────────────────────────────────────── */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem 2rem 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: #d0d0ca;
}

.project-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.project-problem {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-style: italic;
}

.project-description {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.stack-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-right: 0.25rem;
}

.stack-pill {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  background: #f0f4f9;
  color: var(--accent-dark);
  border: 1px solid #ccdcee;
  border-radius: 3px;
  padding: 0.15em 0.55em;
  line-height: 1.6;
}

.project-outcome {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--accent);
}

/* Screenshot */
.project-screenshot {
  margin-bottom: 1.25rem;
}

.screenshot-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.screenshot-img:hover {
  transform: scale(1.005);
  filter: brightness(0.97);
  box-shadow: var(--shadow-hover);
}

.screenshot-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f0f4f9;
  border: 2px dashed #ccdcee;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #8aadcc;
  font-size: 0.85rem;
  cursor: default;
}

.screenshot-placeholder svg {
  opacity: 0.5;
}

/* Expandable Sample Output */
.sample-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.15s;
}

.sample-toggle:hover { color: var(--accent-dark); }

.sample-toggle .toggle-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}

.sample-toggle.open .toggle-icon {
  transform: rotate(180deg);
}

.sample-content-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
  overflow: hidden;
}

.sample-content-wrapper.open {
  grid-template-rows: 1fr;
}

.sample-content-inner {
  min-height: 0;
}

.sample-content {
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
  background: #f7f8f6;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8375rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.sample-placeholder-note {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
  background: none;
  white-space: normal;
}

/* ── Lightbox ───────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 64px rgba(0,0,0,0.5);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.lightbox-overlay.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 1.1rem;
  transition: background 0.15s;
  line-height: 1;
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--text-muted);
}
.footer-links a:hover { color: var(--accent); }

.footer-byline {
  font-size: 0.8375rem;
  color: var(--text-light);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 0 1.25rem; }

  .site-header { padding: 3rem 0 2.5rem; }

  .section { padding: 3rem 0; }

  .project-card { padding: 1.5rem 1.25rem 1.25rem; }

  .project-name { font-size: 1.25rem; }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
