/* =========================================================
   MARKET SCOUT — style.css
   Design language: a field-report / expedition dossier.
   Dark "canvas cover" ink sections bookend warm "paper" sections
   styled like pages in a surveyor's journal. The signature element
   is the brass compass gauge used for the Opportunity Score.
   ========================================================= */

:root{
  /* --- color tokens --- */
  --ink:        #16232C;   /* canvas cover / dark sections */
  --ink-soft:   #24343D;   /* dark section secondary surface */
  --paper:      #F3EFE2;   /* journal page background */
  --paper-card: #EAE3CE;   /* card surface on paper */
  --paper-line: #D8CFB2;   /* hairline on paper */
  --text-dark:  #1E2A24;   /* body text on paper */
  --text-light: #F3EFE2;   /* body text on ink */
  --text-muted: #5B6B62;

  --brass:      #B07C2C;   /* primary accent — compass brass */
  --brass-dark: #8C6221;
  --pine:       #33513F;   /* positive / opportunity green */
  --pine-light: #4C7059;
  --gold:       #D9A441;   /* mid-zone amber */
  --brick:      #A23E2E;   /* risk / danger */

  --radius-sm: 4px;
  --radius-md: 10px;
  --shadow-card: 0 2px 0 rgba(22,35,44,0.06), 0 8px 24px rgba(22,35,44,0.08);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

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

html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body{
  margin:0;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--text-dark);
}
h1{ font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; }
h2{ font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3{ font-size: 1.25rem; }
h4{ font-size: 1rem; letter-spacing: 0.02em; }
p{ margin: 0 0 1em; }
a{ color: inherit; }

.wrap{
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

.skip-link{
  position:absolute; left:-9999px; top:0; background:var(--ink); color:var(--text-light);
  padding:10px 16px; z-index:100; border-radius:0 0 6px 0;
}
.skip-link:focus{ left:0; }

:focus-visible{ outline: 3px solid var(--brass); outline-offset: 2px; }

/* =============== BUTTONS =============== */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  font-family: var(--font-body); font-weight:700; font-size:0.95rem;
  padding: 13px 26px; border-radius: var(--radius-sm); border:2px solid transparent;
  cursor:pointer; text-decoration:none; transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn-primary{ background: var(--brass); color:#1B1204; }
.btn-primary:hover{ background: var(--brass-dark); }
.btn-large{ padding:16px 32px; font-size:1.05rem; }
.btn-ghost{ background:transparent; border-color: rgba(243,239,226,0.5); color: var(--text-light); }
.btn-ghost:hover{ border-color: var(--text-light); }
.btn-secondary{ background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-secondary:hover{ background: var(--ink); color: var(--text-light); }
.btn-text{ background:none; border:none; color: var(--text-muted); text-decoration: underline; padding: 13px 10px; font-weight:600; }

/* =============== HEADER =============== */
.site-header{ background: var(--ink); padding: 14px 0; }
.header-row{ display:flex; align-items:center; justify-content:space-between; }
.brand{ display:flex; align-items:center; gap:10px; text-decoration:none; }
.brand-mark{
  font-family: var(--font-mono); font-weight:600; font-size:0.85rem;
  color: var(--ink); background: var(--brass); padding:4px 8px; border-radius: 3px; letter-spacing: 0.04em;
}
.brand-name{ color: var(--text-light); font-weight:600; font-size:0.95rem; }
.header-tool-tag{
  font-family: var(--font-mono); font-size:0.72rem; letter-spacing:0.08em; text-transform:uppercase;
  color: var(--gold); border:1px solid rgba(217,164,65,0.4); padding:5px 10px; border-radius: 20px;
}

/* =============== HERO =============== */
.hero{ background: var(--ink); color: var(--text-light); padding: 56px 0 68px; }
.hero-grid{ display:grid; gap: 40px; align-items:center; }
.eyebrow{
  font-family: var(--font-mono); font-size:0.75rem; letter-spacing:0.14em; text-transform:uppercase;
  color: var(--gold); margin-bottom:14px;
}
.hero h1{ color: var(--text-light); }
.hero-sub{ color: rgba(243,239,226,0.82); font-size:1.08rem; max-width: 46ch; }
.hero-actions{ display:flex; gap:14px; flex-wrap:wrap; margin: 22px 0 14px; }
.hero-meta{ font-size:0.85rem; color: rgba(243,239,226,0.55); margin:0; }

.hero-visual{ display:flex; justify-content:center; }
.compass-teaser{
  width: 220px; height:220px; border-radius:50%;
  background: radial-gradient(circle at 50% 42%, #223540 0%, #16232C 72%);
  border: 1px solid rgba(217,164,65,0.35);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
  position:relative;
}
.compass-teaser-dial{
  width:120px; height:120px; border-radius:50%; position:relative;
  background: conic-gradient(from 0deg, rgba(217,164,65,0.15) 0deg, transparent 40deg);
  border: 2px solid var(--brass); box-shadow: inset 0 0 0 6px rgba(22,35,44,0.5);
}
.compass-teaser-needle{
  position:absolute; left:50%; bottom:50%; width:2px; height:52px; background: var(--brass);
  transform-origin: bottom center; transform: translateX(-50%) rotate(28deg);
  animation: needleDrift 4.5s ease-in-out infinite alternate;
}
.compass-teaser-needle::after{
  content:""; position:absolute; left:50%; bottom:0; width:8px; height:8px; background:var(--brass);
  border-radius:50%; transform: translate(-50%, 50%);
}
@keyframes needleDrift{ from{ transform: translateX(-50%) rotate(18deg); } to{ transform: translateX(-50%) rotate(48deg); } }
.compass-teaser-label{ font-family: var(--font-mono); font-size:0.75rem; text-align:center; color: rgba(243,239,226,0.7); margin:0; letter-spacing:0.04em; }

@media (min-width: 860px){
  .hero-grid{ grid-template-columns: 1.2fr 0.8fr; }
}

/* =============== AD PLACEHOLDER =============== */
.ad-placeholder{
  margin: 28px auto; padding: 22px; text-align:center;
  border: 1px dashed var(--paper-line); border-radius: var(--radius-sm);
  color: var(--text-muted); font-family: var(--font-mono); font-size:0.78rem; letter-spacing:0.05em;
  background: var(--paper-card);
}

/* =============== HOW IT WORKS =============== */
.how-it-works{ padding: 56px 0; }
.how-grid{ display:grid; gap:20px; margin-top: 26px; }
.how-card{
  background: var(--paper-card); border:1px solid var(--paper-line); border-radius: var(--radius-md);
  padding: 22px 22px 6px;
}
.how-num{
  font-family: var(--font-display); font-weight:700; font-size:1.3rem; color: var(--brass-dark); margin-bottom:8px;
}
@media (min-width: 760px){ .how-grid{ grid-template-columns: repeat(3, 1fr); } }

/* =============== FORM SECTION =============== */
.form-section{ padding: 20px 0 64px; }

.progress-tracker{ position: sticky; top:0; z-index:20; background: var(--paper); padding: 14px 0; margin-bottom: 20px; }
.progress-track{ height:8px; border-radius:6px; background: var(--paper-card); border:1px solid var(--paper-line); overflow:hidden; }
.progress-fill{ height:100%; background: var(--brass); transition: width .3s ease; }
.progress-label{ font-family: var(--font-mono); font-size:0.78rem; color: var(--text-muted); margin: 8px 0 0; }

fieldset.waypoint{
  border: 1px solid var(--paper-line); border-left: 4px solid var(--brass);
  border-radius: var(--radius-md); background: #FBF9F2;
  padding: 22px 22px 24px; margin: 0 0 18px; box-shadow: var(--shadow-card);
}
fieldset.waypoint legend{
  font-family: var(--font-display); font-weight:600; font-size:1.1rem; padding:0 6px;
  display:flex; align-items:baseline; gap:10px;
}
.waypoint-num{
  font-family: var(--font-mono); font-size:0.68rem; letter-spacing:0.1em; text-transform:uppercase;
  color: var(--brass-dark); background: rgba(176,124,44,0.14); padding:3px 8px; border-radius: 12px;
}
.waypoint-hint{ color: var(--text-muted); font-size:0.92rem; margin: -4px 0 16px; }

.field{ margin-bottom: 14px; }
.field label{ display:block; font-weight:600; font-size:0.9rem; margin-bottom:6px; }
.field input[type="text"], .field input[type="email"], select{
  width:100%; padding: 12px 14px; font-size:1rem; font-family: var(--font-body);
  border: 1px solid var(--paper-line); border-radius: var(--radius-sm); background:#fff; color: var(--text-dark);
}
.field input:focus, select:focus{ border-color: var(--brass); }

.slider-field{ display:flex; align-items:center; gap:16px; }
.slider-field input[type="range"]{
  flex:1; height:6px; -webkit-appearance:none; appearance:none; background: var(--paper-line); border-radius:4px;
}
.slider-field input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none; width:26px; height:26px; border-radius:50%; background: var(--brass);
  border: 3px solid #FBF9F2; box-shadow: 0 1px 4px rgba(0,0,0,0.3); cursor:pointer; margin-top:-2px;
}
.slider-field input[type="range"]::-moz-range-thumb{
  width:26px; height:26px; border-radius:50%; background: var(--brass); border: 3px solid #FBF9F2; cursor:pointer;
}
.slider-field output{
  font-family: var(--font-mono); font-weight:600; font-size:1.1rem; min-width: 2ch; text-align:center;
  background: var(--ink); color: var(--gold); border-radius: var(--radius-sm); padding: 4px 8px;
}
.slider-scale{ display:flex; justify-content:space-between; font-size:0.78rem; color: var(--text-muted); margin-top:6px; }

.radio-row, .checkbox-grid{ display:flex; flex-wrap:wrap; gap:10px; }
.radio-pill, .check-pill{
  border: 1px solid var(--paper-line); border-radius: 24px; padding: 10px 16px; cursor:pointer;
  font-size:0.9rem; background:#fff; transition: border-color .15s ease, background .15s ease;
}
.radio-pill input, .check-pill input{ margin-right:8px; accent-color: var(--brass); }
.radio-pill:has(input:checked), .check-pill:has(input:checked){ border-color: var(--brass); background: rgba(176,124,44,0.1); }

.form-submit-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top: 26px; }

/* =============== RESULTS =============== */
.results{ background: var(--ink); color: var(--text-light); padding: 56px 0 64px; }
.results h2, .results h3{ color: var(--text-light); }
.results-header .eyebrow{ margin-bottom:6px; }

.score-panel{
  display:grid; gap: 28px; align-items:center; margin: 30px 0 26px;
  background: var(--ink-soft); border-radius: var(--radius-md); padding: 28px; border: 1px solid rgba(217,164,65,0.2);
}
.gauge-wrap{ text-align:center; }
.gauge{ width: 220px; height: 112px; position:relative; margin: 0 auto; overflow:hidden; }
.gauge::before{
  content:""; position:absolute; inset:0;
  background: conic-gradient(from 270deg at 50% 100%,
    var(--brick) 0deg 72deg,
    var(--gold) 72deg 108deg,
    #C7A93B 108deg 144deg,
    var(--pine-light) 144deg 180deg,
    transparent 180deg 360deg);
  border-radius: 50%;
}
.gauge::after{
  content:""; position:absolute; left:50%; bottom:0; width: 170px; height:85px; transform: translateX(-50%);
  background: var(--ink-soft); border-radius: 50% 50% 0 0 / 100% 100% 0 0; clip-path: polygon(0 100%,100% 100%, 100% 30%, 50% 0, 0 30%);
}
.gauge-needle{
  position:absolute; left:50%; bottom:0; width:3px; height: 96px; background: var(--brass);
  transform-origin: bottom center; transform: translateX(-50%) rotate(-90deg); transition: transform 1s cubic-bezier(.2,.8,.2,1);
  z-index:2;
}
.gauge-center{
  position:absolute; left:50%; bottom:-6px; width:14px; height:14px; background: var(--brass); border-radius:50%;
  transform: translateX(-50%); z-index:3; border: 2px solid var(--ink-soft);
}
.gauge-score{ font-family: var(--font-mono); font-size: 2.2rem; font-weight:600; margin: 10px 0 0; color: var(--text-light); }
.gauge-band{ font-size:0.85rem; color: rgba(243,239,226,0.6); margin:0; text-transform:uppercase; letter-spacing:0.06em; }

.score-cards{ display:grid; gap:14px; }
.score-card{ background: var(--ink); border-radius: var(--radius-sm); padding: 16px 18px; border: 1px solid rgba(217,164,65,0.15); }
.score-card-label{ font-size:0.78rem; text-transform:uppercase; letter-spacing:0.06em; color: rgba(243,239,226,0.55); margin:0 0 6px; }
.score-card-value{ font-family: var(--font-mono); font-size:1.6rem; font-weight:600; margin:0; }
.score-card-value-text{ font-family: var(--font-body); font-size:1.05rem; font-weight:700; }
.mini-bar{ height:6px; background: rgba(243,239,226,0.12); border-radius:4px; margin-top:8px; overflow:hidden; }
.mini-bar-fill{ height:100%; background: var(--brick); transition: width .6s ease; }

@media (min-width: 720px){ .score-panel{ grid-template-columns: 260px 1fr; } .score-cards{ grid-template-columns: 1fr 1fr; } }

.uncle-rob{
  display:flex; gap:16px; align-items:flex-start; background: var(--ink-soft); border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm); padding: 18px 20px; margin-bottom: 24px;
}
.uncle-rob-badge{ font-size:1.8rem; line-height:1; }
.uncle-rob-says{ font-family: var(--font-display); font-weight:700; margin:0 0 4px; font-size:1.05rem; }
.uncle-rob-text{ margin:0; color: rgba(243,239,226,0.8); font-size:0.95rem; }

.recommendation{ background: var(--ink-soft); border-radius: var(--radius-sm); padding: 20px 22px; margin-bottom: 26px; }
.recommendation p{ margin:0; color: rgba(243,239,226,0.85); }

.swot-grid{ display:grid; gap:14px; margin-bottom: 28px; }
.swot-card{ border-radius: var(--radius-sm); padding: 18px 20px; border-top: 3px solid; }
.swot-card ul{ margin:0; padding-left: 20px; color: rgba(243,239,226,0.85); font-size:0.92rem; }
.swot-card li{ margin-bottom:6px; }
.swot-strengths{ background: rgba(76,112,89,0.18); border-color: var(--pine-light); }
.swot-weaknesses{ background: rgba(162,62,46,0.16); border-color: var(--brick); }
.swot-opportunities{ background: rgba(217,164,65,0.14); border-color: var(--gold); }
.swot-threats{ background: rgba(176,124,44,0.1); border-color: var(--brass); }
@media (min-width: 720px){ .swot-grid{ grid-template-columns: 1fr 1fr; } }

.next-steps{ background: var(--ink-soft); border-radius: var(--radius-sm); padding: 20px 22px; margin-bottom: 28px; }
.next-steps ul{ margin: 10px 0 0; padding-left: 20px; color: rgba(243,239,226,0.85); }
.next-steps li{ margin-bottom:8px; }

.export-row{ display:flex; flex-wrap:wrap; gap:10px; }
.results .btn-secondary{ border-color: rgba(243,239,226,0.5); color: var(--text-light); }
.results .btn-secondary:hover{ background: var(--text-light); color: var(--ink); }
.results .btn-text{ color: rgba(243,239,226,0.6); }

/* =============== VAULT =============== */
.vault{ padding: 56px 0; }
.vault-sub{ color: var(--text-muted); max-width: 60ch; }
.vault-table-wrap{ overflow-x:auto; border: 1px solid var(--paper-line); border-radius: var(--radius-md); }
.vault-table{ width:100%; border-collapse: collapse; min-width: 640px; background:#fff; }
.vault-table th, .vault-table td{ text-align:left; padding: 12px 16px; border-bottom: 1px solid var(--paper-line); font-size:0.9rem; }
.vault-table th{ background: var(--paper-card); font-family: var(--font-mono); font-size:0.72rem; text-transform:uppercase; letter-spacing:0.06em; }
.vault-empty-row td{ color: var(--text-muted); font-style: italic; }
.vault-remove{ background:none; border:none; color: var(--brick); cursor:pointer; font-weight:700; text-decoration:underline; font-size:0.85rem; }

/* =============== MORE TOOLS =============== */
.more-tools{ background: var(--paper-card); padding: 56px 0; }
.tools-grid{ display:grid; gap:16px; margin-top: 24px; }
.tool-card{
  display:block; background:#fff; border: 1px solid var(--paper-line); border-radius: var(--radius-md);
  padding: 20px 22px; text-decoration:none; transition: transform .15s ease, box-shadow .15s ease;
}
.tool-card:hover{ transform: translateY(-3px); box-shadow: var(--shadow-card); }
.tool-card-eyebrow{ font-family: var(--font-mono); font-size:0.7rem; text-transform:uppercase; letter-spacing:0.08em; color: var(--brass-dark); margin:0 0 6px; }
.tool-card h3{ margin: 0 0 6px; font-size: 1.1rem; }
.tool-card p{ margin:0; color: var(--text-muted); font-size:0.9rem; }
.tool-card-more{ border-style: dashed; background: transparent; }
@media (min-width: 720px){ .tools-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px){ .tools-grid{ grid-template-columns: repeat(4, 1fr); } }

/* =============== LEAD MAGNET =============== */
.lead-magnet{ background: var(--ink); color: var(--text-light); padding: 48px 0; }
.lead-magnet h2{ color: var(--text-light); margin-bottom:8px; }
.lead-magnet p{ color: rgba(243,239,226,0.78); margin:0; }
.lead-magnet-inner{ display:grid; gap: 24px; align-items:center; }
.lead-form{ display:flex; gap:10px; flex-wrap:wrap; }
.lead-form input{
  flex:1; min-width: 200px; padding: 13px 14px; border-radius: var(--radius-sm); border:1px solid rgba(243,239,226,0.3);
  background: var(--ink-soft); color: var(--text-light); font-size:1rem;
}
.lead-form input::placeholder{ color: rgba(243,239,226,0.4); }
@media (min-width: 800px){ .lead-magnet-inner{ grid-template-columns: 1.3fr 1fr; } }

/* =============== FAQ =============== */
.faq{ padding: 56px 0 64px; }
.faq-item{ border-bottom: 1px solid var(--paper-line); padding: 16px 0; }
.faq-item summary{ cursor:pointer; font-weight:700; font-family: var(--font-display); font-size:1.05rem; }
.faq-item p{ margin: 12px 0 0; color: var(--text-muted); }

/* =============== FOOTER =============== */
.site-footer{ background: var(--ink); color: rgba(243,239,226,0.55); padding: 22px 0; font-size:0.82rem; }
.footer-row{ display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between; align-items:center; }
.footer-row a{ color: var(--gold); text-decoration:none; }

/* =============== PRINT =============== */
@media print{
  .site-header, .hero, .how-it-works, .form-section, .ad-placeholder, .vault, .more-tools, .lead-magnet, .faq, .site-footer, .export-row{ display:none !important; }
  .results{ background:#fff; color:#000; }
  .results h2, .results h3, .gauge-score{ color:#000; }
}
