/* =============================================================================
   QNL Engineering — base theme
   Palette: blueprint blue, drafting-paper cream, redline red accent.
   Tailwind via CDN handles most of the layout; this file owns the
   identity bits (typography, paper texture, blueprint grid backdrop).
   Class prefix `cc-` is preserved (Civil Copilot legacy) to avoid a
   global rename — purely cosmetic; rename later if you want.
   ============================================================================= */

:root {
  --cc-blueprint:      #1B3A5B;   /* deep blueprint blue */
  --cc-blueprint-ink:  #0F2538;   /* near-black blueprint ink */
  --cc-paper:          #F4EFE2;   /* drafting-paper cream */
  --cc-paper-soft:     #FBF7EC;   /* lighter cream */
  --cc-redline:        #C8362D;   /* redline red */
  --cc-graphite:       #2E2E2E;   /* pencil-on-paper text */
  --cc-graphite-soft:  #5A5A5A;
  --cc-rule:           #C9BFA7;   /* faint paper-rule line */
}

html, body {
  background-color: var(--cc-paper);
  color: var(--cc-graphite);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Subtle blueprint grid behind the hero — like graph paper, not a gradient. */
.cc-grid-bg {
  background-color: var(--cc-blueprint);
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
}

/* Drafting-paper texture for content sections. */
.cc-paper {
  background-color: var(--cc-paper);
}
.cc-paper-soft {
  background-color: var(--cc-paper-soft);
}

/* Redline accent for callouts, links, the "live" pill, etc. */
.cc-redline { color: var(--cc-redline); }
.cc-bg-redline { background-color: var(--cc-redline); }
.cc-border-redline { border-color: var(--cc-redline); }

.cc-blueprint { color: var(--cc-blueprint); }
.cc-bg-blueprint { background-color: var(--cc-blueprint); }
.cc-border-blueprint { border-color: var(--cc-blueprint); }

/* Title type — slightly condensed, drafted feel. */
.cc-title {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.01em;
  font-weight: 700;
}

/* Monospace for log content + the "stamped" labels on cards. */
.cc-mono {
  font-family: "JetBrains Mono", "Consolas", "Courier New", monospace;
}

/* Card style — like an index-card stapled to the page. */
.cc-card {
  background: var(--cc-paper-soft);
  border: 1px solid var(--cc-rule);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 8px 24px -16px rgba(15,37,56,0.18);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.cc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 14px 32px -16px rgba(15,37,56,0.28);
}

/* "Coming soon" / "Live demo" pill stamps. */
.cc-stamp {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-weight: 600;
}

/* Buttons */
.cc-btn-primary {
  background: var(--cc-blueprint);
  color: var(--cc-paper);
  padding: 10px 18px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid var(--cc-blueprint-ink);
  transition: background 120ms ease;
}
.cc-btn-primary:hover { background: var(--cc-blueprint-ink); }
.cc-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.cc-btn-ghost {
  background: transparent;
  color: var(--cc-blueprint);
  padding: 10px 18px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid var(--cc-blueprint);
}
.cc-btn-ghost:hover { background: rgba(27,58,91,0.06); }

/* Input + textarea */
.cc-input, .cc-textarea {
  background: white;
  border: 1px solid var(--cc-rule);
  border-radius: 4px;
  padding: 10px 12px;
  width: 100%;
  color: var(--cc-graphite);
  font-size: 14px;
}
.cc-textarea {
  font-family: "JetBrains Mono", "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  min-height: 280px;
}
.cc-input:focus, .cc-textarea:focus {
  outline: none;
  border-color: var(--cc-blueprint);
  box-shadow: 0 0 0 3px rgba(27,58,91,0.12);
}

/* Result panel — looks like a marked-up paper sheet. */
.cc-result {
  background: var(--cc-paper-soft);
  border: 1px solid var(--cc-rule);
  border-left: 4px solid var(--cc-redline);
  border-radius: 4px;
  padding: 18px 20px;
}
.cc-result h3 { color: var(--cc-blueprint); font-weight: 700; margin-top: 1.25rem; }
.cc-result h3:first-child { margin-top: 0; }
.cc-result ul { list-style: disc; padding-left: 1.25rem; }
.cc-result li { margin: 4px 0; }
.cc-result .cc-issue { color: var(--cc-redline); font-weight: 600; }

/* Severity dots used in the result panel. */
.cc-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.cc-dot-high   { background: var(--cc-redline); }
.cc-dot-med    { background: #D9A441; }
.cc-dot-low    { background: #6E8AA8; }

/* Footer */
.cc-footer {
  border-top: 1px solid var(--cc-rule);
  color: var(--cc-graphite-soft);
}

/* =============================================================================
   Personal-portrait hero — drafting-paper-style frame around the photo.
   Gives the JPEG a hand-pinned, on-the-board feel without going gimmicky.
   ============================================================================= */
.cc-portrait {
  position: relative;
  background: var(--cc-paper);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04),
    0 18px 48px -20px rgba(0,0,0,0.55);
  max-width: 420px;
  margin: 0 auto;          /* center within its column */
}
.cc-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;     /* square crop — trims sky and legs */
  object-fit: cover;
  object-position: 55% 25%;/* zoom on face (upper-center of the photo) */
  border-radius: 4px;
}
@media (max-width: 767px) {
  .cc-portrait { max-width: 320px; }
}

/* =============================================================================
   Category "bucket" — used for AI / Dynamo / AutoLISP / Diagrams sections.
   Header strip + optional list of sub-tools beneath.
   ============================================================================= */
.cc-bucket {
  background: var(--cc-paper-soft);
  border: 1px solid var(--cc-rule);
  border-radius: 6px;
  padding: 22px 24px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 8px 24px -16px rgba(15,37,56,0.18);
  transition: transform 120ms ease, box-shadow 120ms ease;
  display: flex;
  flex-direction: column;
}
.cc-bucket:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 14px 32px -16px rgba(15,37,56,0.28);
}
/* Live bucket gets a redline left edge — same cue as the result panel. */
.cc-bucket.cc-bucket-live {
  border-left: 3px solid var(--cc-redline);
}
.cc-bucket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.cc-bucket-blurb {
  font-size: 14px;
  color: var(--cc-graphite-soft);
}
.cc-bucket-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cc-tool-row {
  border-top: 1px dashed var(--cc-rule);
  padding-top: 12px;
}
.cc-tool-row:first-child { border-top: none; padding-top: 0; }
.cc-tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: var(--cc-blueprint);
}
a.cc-tool-link:hover .cc-tool-name { text-decoration: underline; }
.cc-tool-name { font-weight: 600; }
.cc-tool-desc {
  font-size: 13px;
  color: var(--cc-graphite-soft);
  margin-top: 4px;
}
.cc-tool-row.cc-disabled .cc-tool-name { color: var(--cc-graphite-soft); }

/* "Coming soon" stamp variant — softer than redline. */
.cc-stamp.cc-soft { color: var(--cc-graphite-soft); }

/* =============================================================================
   Click-to-expand image gallery used inside project cards.
   ============================================================================= */
.cc-details { margin-top: 12px; }
.cc-details summary {
  cursor: pointer;
  list-style: none;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cc-redline);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.cc-details summary::-webkit-details-marker { display: none; }
.cc-details summary::marker { content: ''; }
.cc-details summary::before {
  content: '+';
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}
.cc-details[open] summary::before { content: '−'; }
.cc-details summary .when-open { display: none; }
.cc-details[open] summary .when-closed { display: none; }
.cc-details[open] summary .when-open { display: inline; }
.cc-details summary:hover { text-decoration: underline; }
