/* DogsBody Squad — Design System v1.0 */
/* Playfair Display + Inter + JetBrains Mono */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:           #1c1a14;
  --bg-raised:    #242018;
  --bg-card:      #2a261e;
  --bg-input:     #1a1810;
  --surface-light:#F5EDD8;
  --border:       rgba(245,237,216,0.08);
  --border-mid:   rgba(245,237,216,0.14);
  --border-light: rgba(245,237,216,0.22);
  --text-primary: #EDE4CC;
  --text-secondary:#B8AE96;
  --text-muted:   #7A7468;
  --amber:        #C8922A;
  --amber-light:  #D4A84A;
  --amber-bg:     rgba(200,146,42,0.12);
  --cream:        #F5EDD8;

  /* Character colours */
  --winston:  #8B2020;
  --rex:      #4A3520;
  --digby:    #3D6B4A;
  --nell:     #8A9BA8;
  --reg:      #7A2C35;
  --bex:      #5A7A5C;
  --ivy:      #3A7A7A;
  --flora:    #2E4A7A;
  --pip:      #C45C3A;
  --archie:   #8A6A2A;
  --scout:    #3A5A7A;
  --biscuit:  #8A6A4A;
  --kit:      #5A5A7A;
  --bruno:    #2A3A5A;
  --dash:     #2A6A6A;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-ui:      'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
}

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

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────────── */
.display { font-family: var(--font-display); }

h1, .h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h2, .h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-primary);
}

h3, .h3 {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}

.body { font-size: 15px; line-height: 1.65; color: var(--text-secondary); }
.small { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.micro { font-size: 11px; color: var(--text-muted); }
.mono { font-family: var(--font-mono); }

/* ── Layout ─────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 2rem; }

/* ── Navigation ─────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(28,26,20,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--border);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-brand .paw { color: var(--amber); font-size: 16px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text-primary); }

/* ── Treat Tin ──────────────────────────────────────────── */
.treat-tin {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-raised);
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-xl);
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s;
}
.treat-tin:hover { border-color: var(--border-light); color: var(--text-primary); }
.treat-tin .tin-item { display: flex; align-items: center; gap: 4px; }
.treat-tin .tin-divider { color: var(--border-light); margin: 0 2px; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-mid); }

.card-raised {
  background: var(--bg-raised);
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* ── Tool Cards ─────────────────────────────────────────── */
.tool-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--char-colour, var(--amber));
  opacity: 0;
  transition: opacity 0.2s;
}
.tool-card:hover { border-color: var(--border-mid); transform: translateY(-1px); }
.tool-card:hover::before { opacity: 1; }

.tool-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tool-card-icon { font-size: 24px; line-height: 1; }
.tool-card-cost {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3px 8px;
  white-space: nowrap;
}
.tool-card-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}
.tool-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}
.tool-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.tool-card-dog {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--char-colour, var(--amber));
}
.tool-card-arrow { color: var(--text-muted); font-size: 14px; transition: transform 0.15s; }
.tool-card:hover .tool-card-arrow { transform: translateX(3px); color: var(--text-secondary); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--amber);
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--bg-raised);
  color: var(--text-secondary);
  border: 0.5px solid var(--border-mid);
}
.btn-secondary:hover { border-color: var(--border-light); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 0.5px solid var(--border);
  font-size: 13px;
  padding: 7px 14px;
}
.btn-ghost:hover { border-color: var(--border-mid); color: var(--text-primary); }

/* ── Form elements ───────────────────────────────────────── */
input[type="text"], input[type="date"], input[type="number"],
input[type="email"], select, textarea {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  width: 100%;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--amber);
  background: var(--bg-raised);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; line-height: 1.6; }
select { cursor: pointer; }

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
  margin-top: 14px;
  letter-spacing: 0.02em;
}
label:first-of-type { margin-top: 0; }

/* ── Squad roster strip ──────────────────────────────────── */
.squad-strip {
  display: flex;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-raised);
}
.squad-member {
  flex: 1;
  padding: 14px 10px;
  text-align: center;
  border-right: 0.5px solid var(--border);
  text-decoration: none;
  transition: background 0.15s;
}
.squad-member:last-child { border-right: none; }
.squad-member:hover { background: var(--bg-card); }
.squad-name {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--char-colour, var(--amber));
  margin-bottom: 3px;
}
.squad-role {
  font-family: var(--font-display);
  font-size: 10px;
  font-style: italic;
  color: var(--text-muted);
}
.squad-line {
  width: 18px;
  height: 1.5px;
  background: var(--char-colour, var(--amber));
  margin: 6px auto 0;
  border-radius: 1px;
}

/* ── Status / badges ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-xl);
  letter-spacing: 0.04em;
}
.badge-live { background: rgba(61,107,74,0.2); color: #7DC48A; border: 0.5px solid rgba(61,107,74,0.3); }
.badge-soon { background: rgba(122,116,104,0.15); color: var(--text-muted); border: 0.5px solid var(--border); }
.badge-winston { background: rgba(139,32,32,0.2); color: #C87070; border: 0.5px solid rgba(139,32,32,0.3); }

/* ── Confidentiality notice ──────────────────────────────── */
.conf-notice {
  background: rgba(139,32,32,0.08);
  border: 0.5px solid rgba(139,32,32,0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  color: #C87070;
  line-height: 1.55;
  margin-bottom: 1rem;
}
.conf-notice strong { font-weight: 600; color: #D48080; }

/* ── Back to menu ────────────────────────────────────────── */
.back-menu {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 14px;
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: border-color 0.15s, color 0.15s;
}
.back-menu:hover { border-color: var(--border-mid); color: var(--text-secondary); }

/* ── Doc meta footer ─────────────────────────────────────── */
.doc-meta {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 0.5px solid var(--border);
  font-family: var(--font-mono);
}

/* ── Status / spinner ────────────────────────────────────── */
.status {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
.status.error { color: #C87070; }
.spinner {
  width: 14px; height: 14px;
  border: 1.5px solid var(--border-mid);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Output area ─────────────────────────────────────────── */
.output { display: none; }
.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 0.5px solid var(--border-mid);
}
.output-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}
.output-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Hint text ───────────────────────────────────────────── */
.hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; line-height: 1.5; }

/* ── Caveat box (legal) ──────────────────────────────────── */
.caveat {
  background: rgba(200,146,42,0.08);
  border: 0.5px solid rgba(200,146,42,0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: #C8A870;
  line-height: 1.55;
  margin-bottom: 1rem;
}
.caveat strong { font-weight: 600; color: var(--amber-light); }

/* ── Upload zone ─────────────────────────────────────────── */
.upload-zone {
  border: 1.5px dashed var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.upload-zone:hover { border-color: var(--amber); background: var(--amber-bg); }
.upload-zone.has-file { border-color: var(--digby); border-style: solid; background: rgba(61,107,74,0.06); }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-zone-text { font-size: 13px; color: var(--text-muted); pointer-events: none; }
.upload-zone.has-file .upload-zone-text { color: #7DC48A; font-weight: 500; }

/* ── Sections ────────────────────────────────────────────── */
.section { margin-bottom: 3rem; }
.section-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  border-top: 0.5px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}
.footer a { color: var(--text-secondary); text-decoration: none; }
.footer a:hover { color: var(--text-primary); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .container, .container-narrow { padding: 0 1rem; }
  .nav { padding: 0 1rem; }
  .squad-strip { flex-wrap: wrap; }
  .squad-member { flex: 0 0 33.33%; border-bottom: 0.5px solid var(--border); }
  .output-btns { flex-direction: column; width: 100%; }
  .output-btns .btn { width: 100%; justify-content: center; }
}
