/* site.css — base stylesheet.
   Delegated draft: glm-5.1:cloud (via ollama-mcp), reviewed + patched by Claude.
   Patches: .site-nav width/padding, .card-section h4 vs heading swap. */

/* --- Base & Variables ---
   Identity: professional-but-personal NZ. Pounamu (greenstone) green as the
   working accent, kōwhai gold for warm flourishes, warm paper background —
   nature-adjacent without being a tourism brochure. Fraunces (a warm display
   serif) carries headings/brand; Inter carries body text. */
:root {
  --accent: #14604a;        /* pounamu green */
  --accent-deep: #0e4636;
  --gold: #d9a426;          /* kōwhai gold */
  --bg: #faf7f2;            /* warm paper */
  --text: #21302b;
  --muted: #5f6b66;
  --card-bg: #ffffff;
  --border: #e7e1d6;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(46, 58, 52, 0.10), 0 4px 14px rgba(46, 58, 52, 0.06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --btn-text: #ffffff;      /* text on accent-filled buttons (flips dark in dark mode) */
}

/* --- Brand palettes (switchable via js/brand.js) ---
   Two independent axes now (Stephen's request):
     • data-brand  — the accent colour AND a matching background tint, so the
       whole page shifts, not just the highlights.
     • data-mode="dark" — flips to dark surfaces with brighter accents.
   Each palette leads with one of Stephen's colours (green/orange/blue/purple/
   teal) as the accent and flourishes with a second (--gold). The base :root is
   the default "Pounamu" (green) light theme; others opt in via data-brand. */
:root[data-brand="kowhai"] {
  --accent: #b26410; --accent-deep: #8f4f0b; --gold: #4e9a51;   /* orange + flax green */
  --bg: #fbf6ef; --border: #ece3d5;
}
:root[data-brand="harbour"] {
  --accent: #3a5a9e; --accent-deep: #2c477e; --gold: #e0912a;   /* blue + warm orange */
  --bg: #f2f5fb; --border: #dde3ef;
}
:root[data-brand="tussock"] {
  --accent: #6e4c8f; --accent-deep: #573a73; --gold: #86c23e;   /* purple + lime */
  --bg: #f7f4fb; --border: #e7e0ef;
}
:root[data-brand="ocean"] {
  --accent: #147a6e; --accent-deep: #0f5a51; --gold: #e8963a;   /* teal + sunset orange */
  --bg: #eef7f5; --border: #d8e8e3;
}

/* --- Dark mode ---
   The neutral dark surfaces apply regardless of brand and must come AFTER the
   brand blocks so their --bg wins (equal specificity → source order decides).
   Button text flips to near-black so the brighter dark-mode accents stay
   readable behind white-on-accent... which is now dark-on-accent. */
:root[data-mode="dark"] {
  --bg: #14171c; --card-bg: #1b1f26; --text: #eceef1; --muted: #9aa2ac;
  --border: #2b303a; --btn-text: #14171c;
  --shadow: 0 1px 3px rgba(0,0,0,0.45), 0 6px 18px rgba(0,0,0,0.38);
  /* default (Pounamu green) dark accents */
  --accent: #4fbf8f; --accent-deep: #6ccaa0; --gold: #e6bd55;
}
:root[data-mode="dark"][data-brand="kowhai"]  { --accent: #f0913f; --accent-deep: #f4a55e; --gold: #6cc46f; }
:root[data-mode="dark"][data-brand="harbour"] { --accent: #6ea6f5; --accent-deep: #8bb8f7; --gold: #eaa64a; }
:root[data-mode="dark"][data-brand="tussock"] { --accent: #b98af0; --accent-deep: #c8a2f4; --gold: #8fd05a; }
:root[data-mode="dark"][data-brand="ocean"]   { --accent: #3fc9bd; --accent-deep: #5fd3c9; --gold: #f0a24a; }

/* --- Brand switcher (floating, bottom-right; injected by js/brand.js) --- */
.brand-switch {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 8px 12px;
}
.brand-switch .bs-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.brand-switch .bs-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.15s;
}
.brand-switch .bs-dot:hover { transform: scale(1.15); }
.brand-switch .bs-dot[aria-pressed="true"] {
  border-color: var(--text);
}
.brand-switch .bs-mode {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.brand-switch .bs-mode:hover { border-color: var(--accent); }
@media (max-width: 560px) {
  .brand-switch .bs-label { display: none; }
  .brand-switch { padding: 8px; gap: 6px; }
}
/* Global demo-hide, set by visibility.js from showThemeSwitcher:false in
   visibility.json. Attribute-driven so it works no matter when the switcher
   is built. */
:root[data-hide-theme="1"] .brand-switch { display: none; }

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

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

/* --- Layout --- */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 3rem;
}

.site-header {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1.2rem;
}

/* Small kōwhai tick before the brand — the one deliberate decorative mark. */
.brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50% 50% 50% 0;
  background: var(--gold);
  margin-right: 10px;
  transform: rotate(-45deg);
}

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

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 2px;
}

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  padding: 2rem 0 5rem;   /* extra bottom room so the floating theme switcher never covers the footer text */
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* --- Homepage --- */
.hero {
  padding: 5rem 0 3rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.7rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: 720px;
}

/* Gold underline flourish beneath the hero statement. */
.hero h1::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  border-radius: 2px;
  background: var(--gold);
  margin-top: 1.1rem;
}

.hero-small {
  padding: 3rem 0 1rem;
}

.hero-small h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.3;
  font-weight: 600;
}

.lede {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 1.5rem 0;
  max-width: 640px;
}

.hero-links {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--btn-text);
  padding: 0.65rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(30, 35, 32, 0.22);
}

.btn:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(30, 35, 32, 0.28);
}

section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 3rem 0 1rem;
  font-size: 1.6rem;
  border-left: 4px solid var(--gold);
  padding-left: 14px;
}

.timeline {
  list-style: none;
  border-left: 2px solid var(--border);
  padding-left: 24px;
  margin: 2rem 0;
}

.timeline-entry {
  position: relative;
  display: flex;
  margin-bottom: 2rem;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
}

.timeline-dates {
  width: 120px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.9rem;
  padding-top: 2px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.skill-group {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.skill-group h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.skill-group ul {
  list-style: none;
  font-size: 0.9rem;
  color: var(--muted);
}

.skill-group ul li {
  margin-bottom: 0.25rem;
}

/* --- Dashboard --- */
.build-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.project-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.card-header h3 {
  font-size: 1.1rem;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

.status-live { background: #16a34a; }
.status-active { background: var(--accent); }
.status-paused { background: #d97706; }
.status-archived { background: #6b7280; }
.status-unknown { background: #e5e7eb; color: #374151; }

.card-desc {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.card-section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.card-section h4 {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

.card-section-heading {
  font-weight: 600;
  margin-top: 0.35rem;
}

.card-section-body {
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.loading, .empty {
  color: var(--muted);
  padding: 2rem 0;
}

.error {
  color: #dc2626;
  padding: 2rem 0;
}

code {
  background: #f1ede4;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

/* --- Overnight Report --- */
.report-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin: 2rem 0;
}

.report-header {
  margin-bottom: 1.5rem;
}

.report-kicker {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.report-mood {
  font-style: italic;
  color: var(--muted);
  margin: 0.5rem 0;
}

.report-summary {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.report-outcome {
  font-size: 0.95rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.report-table th {
  text-align: left;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid var(--border);
}

.report-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.report-table tr:nth-child(even) {
  background: #f7f4ee;
}

.report-project {
  font-weight: 600;
}

.report-block {
  margin-top: 2rem;
}

.report-block h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.report-blockers h3 {
  color: #d97706;
}

.report-next h3 {
  color: var(--accent);
}

/* --- Offerings page (Phase 8) ---
   Delegated draft: glm-5.1:cloud (via ollama-mcp), reviewed by Claude. */
.offer-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 2rem 0;
}

.offer-card h3 {
  font-size: 1.3rem;
}

.offer-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.steps {
  list-style: none;
  padding-left: 0;
  counter-reset: step-counter;
  margin: 1.5rem 0;
}

.steps li {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1rem;
  counter-increment: step-counter;
}

.steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.6rem;
  height: 1.6rem;
  line-height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--btn-text);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.cta-block {
  text-align: center;
  margin: 3rem 0;
  padding: 2.5rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cta-block h2 {
  border: none;
  padding-left: 0;
  margin: 0 0 0.5rem;
}

.cta-lede {
  margin-bottom: 1.5rem;
}

.cta-block .btn-large {
  font-size: 1.1rem;
  padding: 0.8rem 2rem;
}

.cta-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.offer-teaser {
  font-size: 1.05rem;
}

/* --- Responsive --- */
@media (max-width: 700px) {
  .skills-grid, .project-grid {
    grid-template-columns: 1fr;
  }

  .timeline-entry {
    flex-direction: column;
  }

  .timeline-dates {
    width: auto;
    margin-bottom: 0.25rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .site-nav {
    flex-direction: column;
    height: auto;
    padding: 1rem 24px;
    gap: 0.5rem;
  }

  .nav-links {
    justify-content: center;
  }

  .offer-card {
    padding: 1.5rem;
  }
}

/* --- Build log timeline (phase 10) --- */
.phase-timeline {
  list-style: none;
  margin: 2rem 0;
  padding: 0;
  position: relative;
}
.phase-timeline::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--border));
}
.phase-node {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 0 0 1.75rem 0;
}
.phase-num {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--btn-text);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 4px var(--bg);
}
.st-review .phase-num { background: #b45309; }
.st-action .phase-num { background: #1d4ed8; }
.phase-body { flex: 1; min-width: 0; }
.phase-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.phase-head h3 { font-size: 1.05rem; }
.phase-repo {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.phase-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 9px;
  border-radius: 999px;
  background: #d1e7e2;
  color: #0f5148;
}
.st-review .phase-status { background: #fde8cd; color: #92400e; }
.st-action .phase-status { background: #dbe5fd; color: #1e40af; }
.phase-body p { font-size: 0.92rem; margin-top: 0.35rem; }
.phase-outcome {
  color: var(--muted);
  font-size: 0.85rem !important;
  font-variant-numeric: tabular-nums;
}
/* Per-phase "Stephen: TEST / DO / CHECK" checklist. */
.phase-stephen {
  margin-top: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: #fbf4e3;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.phase-stephen h4 {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #92400e;
  margin-bottom: 0.3rem;
}
.phase-stephen ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}
.phase-stephen li { margin-bottom: 0.2rem; }

.report-divider {
  border: none;
  border-top: 2px solid var(--border);
  margin: 3rem 0;
}

.pre-reveal { opacity: 0; transform: translateY(10px); }
.revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
@media (prefers-reduced-motion: reduce) {
  .pre-reveal { opacity: 1; transform: none; }
}

/* --- Full-bleed feature band (breaks out of .container) --- */
.feature-band {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: 3rem;
  margin-bottom: 1rem;
  height: clamp(220px, 34vw, 380px);
  overflow: hidden;
}
.feature-band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
}
.feature-band .band-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2.5rem 24px 1rem;
  background: linear-gradient(to top, rgba(20, 25, 22, 0.72), rgba(20, 25, 22, 0));
  color: #fff;
}
.feature-band .band-caption .bc-inner {
  max-width: 860px;
  margin: 0 auto;
}
.feature-band .band-caption p {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  font-weight: 600;
  font-style: italic;
  max-width: 620px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.35);
}

/* --- Personal "off the clock" photo strip --- */
.photo-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.photo-strip figure {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--card-bg);
}
.photo-strip img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.photo-strip figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.55rem 0.8rem;
}
@media (max-width: 560px) {
  .photo-strip { grid-template-columns: 1fr; }
}

/* accent link underline animation on nav for a touch of interactivity */
.nav-links a { position: relative; }
.nav-links a:not(.active)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}
.nav-links a:not(.active):hover::after { transform: scaleX(1); }

/* --- Admin bar (js/admin.js, ?admin=1) --- */
.admin-bar {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 60;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 280px;
  font-size: 0.85rem;
  color: var(--text);
}
.admin-bar strong { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.admin-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.admin-actions { display: flex; gap: 8px; margin-top: 4px; }
.admin-actions button {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.78rem;
  cursor: pointer;
}
.admin-actions button:hover { border-color: var(--accent); }
