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

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --green: #34d399;
  --purple: #8b5cf6;
}

html { scroll-behavior: smooth; }

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

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

/* ── Nav ─────────────────────────────────────────────────────── */
#site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent) !important;
  letter-spacing: -0.02em;
}
.nav-links { display: flex; gap: 8px; }
.nav-link {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}
.nav-link:hover { background: rgba(88, 166, 255, 0.08); color: var(--text); }
.nav-link.active { background: rgba(88, 166, 255, 0.12); color: var(--accent); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  padding: 80px 24px 60px;
  text-align: center;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.hero-subtitle {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 16px;
}
.hero-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; }

/* ── Highlights ──────────────────────────────────────────────── */
.highlights {
  padding: 0 24px 80px;
  max-width: 960px;
  margin: 0 auto;
}
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.highlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
  text-align: center;
  transition: border-color 0.2s;
}
.highlight-card:hover { border-color: var(--accent); }
.highlight-icon { font-size: 2rem; margin-bottom: 12px; }
.highlight-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text);
}
.highlight-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Page sections (used by partials) ────────────────────────── */
.page-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.page-section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
.page-section p { margin-bottom: 16px; color: var(--text-muted); }
.page-section p strong { color: var(--text); }

/* Services list */
.service-list { list-style: none; margin: 24px 0; }
.service-list li {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.service-list li:hover { border-color: var(--accent); }
.service-list li strong { display: block; margin-bottom: 4px; color: var(--text); }
.service-list li span { font-size: 0.9rem; color: var(--text-muted); }

/* Portfolio grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.portfolio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  transition: border-color 0.2s;
}
.portfolio-card:hover { border-color: var(--purple); }
.portfolio-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.portfolio-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple);
  margin-right: 4px;
  margin-bottom: 8px;
}
.portfolio-card p { font-size: 0.9rem; color: var(--text-muted); }

/* Contact */
.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
}
.contact-card .contact-icon { font-size: 1.8rem; margin-bottom: 8px; }
.contact-card h3 { font-size: 1rem; margin-bottom: 4px; }

/* ── Contact Form ────────────────────────────────────────────── */
.contact-form {
  margin-top: 24px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group select { cursor: pointer; }
.form-group select option { background: var(--bg); color: var(--text); }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── Footer ──────────────────────────────────────────────────── */
#site-footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}
.footer-inner { max-width: 960px; margin: 0 auto; }
#site-footer p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.footer-contact a { color: var(--accent); }

/* ── HTMX transitions ───────────────────────────────────────── */
#content { opacity: 1; transition: opacity 0.15s ease; }
#content.htmx-swapping { opacity: 0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 6px 10px; font-size: 0.8rem; }
}

/* ── Dual-tone bands (homepage rebuild 2026-06) ───────────────────────────────── */
:root {
  --light-bg: #e6eef9;
  --light-card: #ffffff;
  --light-border: #d4def0;
  --light-text: #11151c;
  --light-text-muted: #5b6470;
  --light-heading: #0f2c4d;
  --light-accent: #0f6b5c;
}

.band { width: 100%; }
.band-inner { max-width: 960px; margin: 0 auto; padding: 72px 24px; }
.band-dark { background: var(--bg); color: var(--text); }
.band-dark.band-gradient { background: linear-gradient(160deg, #101826, var(--bg)); }
.band-light { background: var(--light-bg); color: var(--light-text); }
.band-light h2 { color: var(--light-heading); }
.band-light p { color: var(--light-text-muted); }

.band h2 {
  font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px;
}
.band .band-lead { font-size: 1rem; margin-bottom: 28px; }
.band-dark .band-lead { color: var(--text-muted); }
.band-light .band-lead { color: var(--light-text-muted); font-style: italic; }

@media (max-width: 640px) { .band-inner { padding: 48px 18px; } }

/* Hero band */
.hero-band { position: relative; overflow: hidden; }
.hero-band .hero-bg { position: absolute; inset: 0; opacity: 0.6; pointer-events: none; }
.hero-band .hero-bg .hero-hexes { width: 100%; height: 100%; }
.hero-band .band-inner { position: relative; }
.hero-headline { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; max-width: 760px; margin-bottom: 16px; }
.hero-subhead { font-size: 1.1rem; color: var(--text-muted); max-width: 640px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .hero-headline { font-size: 1.9rem; } }

/* ── Capability diagram + Principles (homepage rebuild Task 7) ───────────── */
.capability-diagram { width: 100%; max-width: 620px; height: auto; display: block; margin: 0 auto 32px; }
.principles { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.principle h3 { font-size: 1.05rem; color: var(--accent); margin-bottom: 6px; }
.principle p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }
@media (max-width: 640px) { .principles { grid-template-columns: 1fr; } }

/* About strip */
.about-strip { display: flex; gap: 28px; align-items: center; }
.about-portrait { flex: 0 0 120px; width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.about-portrait.placeholder { display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.8rem; background: var(--bg-card); }
.about-body p { color: var(--text-muted); }
.about-subline { color: var(--text) !important; font-weight: 500; margin-top: 12px; }
@media (max-width: 640px) { .about-strip { flex-direction: column; text-align: center; } }

/* Services tiles */
.service-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.service-tile { background: var(--light-card); border: 1px solid var(--light-border); border-radius: 10px; padding: 22px; }
.service-tile h3 { color: var(--light-heading); font-size: 1.05rem; margin-bottom: 8px; }
.service-tile p { color: var(--light-text-muted); font-size: 0.92rem; line-height: 1.55; }
@media (max-width: 640px) { .service-tiles { grid-template-columns: 1fr; } }

/* Selected Work */
.case { background: var(--light-card); border: 1px solid var(--light-border); border-left: 3px solid var(--light-accent); border-radius: 8px; padding: 20px; margin-bottom: 14px; }
.case h3 { color: var(--light-text); font-size: 1.05rem; margin-bottom: 8px; }
.case p { color: var(--light-text-muted); font-size: 0.92rem; }
.case-result strong { color: var(--light-text); }

/* Footer interests + contact status */
.interests { list-style: none; margin: 0 0 24px; padding: 0; }
.interests li { color: var(--text-muted); padding: 6px 0 6px 20px; position: relative; }
.interests li::before { content: "▸"; color: var(--accent); position: absolute; left: 0; }
.contact-intro { color: var(--text-muted); margin-bottom: 16px; }
.contact-status { margin-top: 12px; font-size: 0.9rem; }

/* Portfolio card image slots (graphics completion 2026-06) */
.portfolio-card .pf-frame { aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--bg); border: 1px solid var(--border); margin-bottom: 12px; }
.portfolio-card .pf-shot { width: 100%; height: 100%; object-fit: cover; display: block; }
.portfolio-card .pf-shot.placeholder { align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.8rem; }

/* Currently Building strip (was unstyled in the June rebuild) */
.cb-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.cb-strip .tile { background: var(--light-card); border: 1px solid var(--light-border); border-radius: 10px; padding: 14px; }
.cb-strip .tile h3 { color: var(--light-heading); font-size: 1rem; margin: 10px 0 6px; }
.cb-strip .tile p { color: var(--light-text-muted); font-size: 0.85rem; line-height: 1.5; }
.tile-frame { aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--light-bg); border: 1px solid var(--light-border); }
.tile-shot { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-shot.placeholder { align-items: center; justify-content: center; color: var(--light-text-muted); font-size: 0.8rem; }
@media (max-width: 640px) { .cb-strip { grid-template-columns: 1fr 1fr; } }
