/* ===================================================================
   REPUTATION ENGINE — Foundation Styles
   Source: Design Brief/ui-kit.md
   =================================================================== */

/* -------------------------------------------------------------------
   1. CSS Custom Properties
   ------------------------------------------------------------------- */
:root {
  /* Base */
  --color-bg:               #0C1014;
  --color-surface:          #131C21;
  --color-surface-elevated: #1A2730;
  --color-border:           #1E2E35;

  /* Accent */
  --color-cyan:             #1CCFCF;
  --color-cyan-dim:         #0E7A7A;
  --color-cyan-card:        #0E3A3A;

  /* Text */
  --color-text:             #FFFFFF;
  --color-text-secondary:   #8B9EAA;
  --color-text-muted:       #6B8290;
  --color-text-accent:      #1CCFCF;

  /* Semantic */
  --color-positive:         #22C55E;
  --color-negative:         #EF4444;
  --color-positive-bg:      #0F2D1A;
  --color-negative-bg:      #2D0F0F;

  /* Font */
  --font:                   'Montserrat', system-ui, -apple-system, sans-serif;

  /* Layout */
  --container-max:          1200px;
  --container-px:           80px;
  --section-py:             90px;
  --section-gap:            48px;
  --card-gap:               24px;

  /* Shadows */
  --shadow-card:            0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow:            0 0 20px rgba(28, 207, 207, 0.3);
  --shadow-btn:             0 0 16px rgba(28, 207, 207, 0.33);
}

/* -------------------------------------------------------------------
   2. Reset
   ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

section[id] {
  scroll-margin-top: 72px;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea { font-family: inherit; }

/* -------------------------------------------------------------------
   3. Layout
   ------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.section {
  padding: var(--section-py) 0;
}

/* -------------------------------------------------------------------
   4. Typography scale
   ------------------------------------------------------------------- */
.section-title {
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--color-text);
  max-width: 100%;
}

.section-subtitle {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--color-text);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--color-text);
}

.body-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* -------------------------------------------------------------------
   5. Buttons
   ------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  padding: 14px 28px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}

/* Primary — cyan fill */
.btn--primary {
  background: var(--color-cyan);
  color: var(--color-bg);
}
.btn--primary:hover {
  filter: brightness(1.1);
  box-shadow: var(--shadow-btn);
}

/* Ghost — form submit */
.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-text);
  padding: 12px 32px;
}
.btn--ghost:hover {
  background: var(--color-cyan);
  color: var(--color-bg);
  border-color: var(--color-cyan);
}

/* -------------------------------------------------------------------
   6. Cards
   ------------------------------------------------------------------- */

/* Standard card — with left cyan accent */
.card {
  background: var(--color-surface);
  border-radius: 6px;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-cyan);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}
.card:hover {
  border-color: rgba(28, 207, 207, 0.27);
  border-left-color: var(--color-cyan);
}

/* Form card — Sections 08, 14 */
.card--form {
  background: var(--color-surface-elevated);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  padding: 48px;
  box-shadow: var(--shadow-card);
}

/* Chart container — Sections 07, 10 */
.card--chart {
  background: var(--color-surface);
  border-radius: 6px;
  border: 1px solid var(--color-border);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.card--chart .chart-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

/* -------------------------------------------------------------------
   6a. SVG Charts — Sections 07 and 10
   ------------------------------------------------------------------- */
.svg-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  border-radius: 4px;
}
.svg-chart text {
  font-family: var(--font);
  fill: var(--color-text-secondary);
}
.svg-chart .chart-grid {
  stroke: #8B9EAA;
  stroke-opacity: 0.12;
  stroke-width: 1;
}
.svg-chart .chart-axis {
  stroke: #8B9EAA;
  stroke-opacity: 0.28;
  stroke-width: 1;
}
.svg-chart .chart-row-label {
  font-size: 12px;
  text-anchor: end;
  dominant-baseline: middle;
}
.svg-chart .chart-col-label {
  font-size: 11px;
  text-anchor: middle;
}
.svg-chart--tilt-cols .chart-col-label {
  text-anchor: end;
}
.svg-chart .chart-tick-label {
  font-size: 10px;
  text-anchor: end;
  dominant-baseline: middle;
  fill-opacity: 0.85;
}
.svg-chart .chart-value {
  font-size: 11px;
  font-weight: 700;
  fill: #FFFFFF;
  dominant-baseline: middle;
}

/* Bar colors */
.svg-chart .bar-neg { fill: #EF4444; }
.svg-chart .bar-pos { fill: #22C55E; }

/* Category / subcategory hierarchy (used in Section 10 case-study neg chart) */
.svg-chart .bar-neg.is-cat { fill: #991B1B; }
.svg-chart .bar-neg.is-sub { fill: #F87171; }
.svg-chart .chart-row-label.is-cat {
  fill: var(--color-text-secondary);
  font-weight: 800;
}
.svg-chart .chart-row-label.is-sub {
  fill: #8B9EAA;
  font-size: 11px;
}

/* Stacked palettes — 5 shades */
.svg-chart .neg-1 { fill: #7F1D1D; }
.svg-chart .neg-2 { fill: #B91C1C; }
.svg-chart .neg-3 { fill: #EF4444; }
.svg-chart .neg-4 { fill: #F87171; }
.svg-chart .neg-5 { fill: #FCA5A5; }

.svg-chart .pos-1 { fill: #14532D; }
.svg-chart .pos-2 { fill: #15803D; }
.svg-chart .pos-3 { fill: #22C55E; }
.svg-chart .pos-4 { fill: #4ADE80; }
.svg-chart .pos-5 { fill: #BBF7D0; }

/* 1-5 star rating palette */
.svg-chart .star-1 { fill: #EF4444; }
.svg-chart .star-2 { fill: #F87171; }
.svg-chart .star-3 { fill: #E5E7EB; fill-opacity: 0.55; }
.svg-chart .star-4 { fill: #86EFAC; }
.svg-chart .star-5 { fill: #22C55E; }

/* Line / area (rating) */
.svg-chart .chart-line {
  fill: none;
  stroke: #1CCFCF;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.svg-chart .chart-area {
  fill: #1CCFCF;
  fill-opacity: 0.14;
  stroke: none;
}
.svg-chart .chart-dot {
  fill: #1CCFCF;
  stroke: #0C1014;
  stroke-width: 1.5;
}

/* HTML legend above SVG chart */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 14px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--color-text-secondary);
}
.chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-legend__swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* -------------------------------------------------------------------
   7. Accent Square (before card headings)
   ------------------------------------------------------------------- */
.accent-sq {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-cyan);
  border-radius: 1px;
  margin-right: 10px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* -------------------------------------------------------------------
   8. Numbered Badge — Section 04
   ------------------------------------------------------------------- */
.badge-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  background: var(--color-cyan);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-bg);
  flex-shrink: 0;
}

/* -------------------------------------------------------------------
   9. Form Fields
   ------------------------------------------------------------------- */
.form-field {
  width: 100%;
  height: 48px;
  background: var(--color-bg);
  border: 1.5px solid #2A3D48;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field::placeholder {
  color: var(--color-text-muted);
}
.form-field:focus {
  border-color: var(--color-cyan);
  box-shadow: 0 0 0 3px rgba(28, 207, 207, 0.13);
}

/* -------------------------------------------------------------------
   10. Divider
   ------------------------------------------------------------------- */
.divider {
  width: 80px;
  height: 1px;
  background: var(--color-cyan);
  margin: 32px auto;
}

/* -------------------------------------------------------------------
   11. Neon Orb — decorative, Sections 08, 14
   ------------------------------------------------------------------- */
.neon-orb {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: var(--color-cyan);
  opacity: 0.3;
  filter: blur(100px);
  pointer-events: none;
}

/* -------------------------------------------------------------------
   12. Stats Counter — Section 12
   ------------------------------------------------------------------- */
.stat-number {
  font-size: clamp(40px, 4vw, 54px);
  font-weight: 900;
  color: var(--color-text-accent);
  line-height: 1;
}
.stat-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
  max-width: 120px;
  text-align: center;
  line-height: 1.4;
  margin-top: 8px;
}

/* -------------------------------------------------------------------
   13. Team Card — Section 12
   ------------------------------------------------------------------- */
.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-surface);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  padding: 40px 32px 32px;
  box-shadow: var(--shadow-card);
}
.team-card__photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid rgba(28, 207, 207, 0.4);
  box-shadow: 0 0 0 6px rgba(28, 207, 207, 0.07);
  margin-bottom: 24px;
  flex-shrink: 0;
  display: block;
}
.team-card__info {
  padding: 0;
}
.team-card__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}
.team-card__bio {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.65;
  max-width: 320px;
}

/* -------------------------------------------------------------------
   14. Contact Row — Section 12
   ------------------------------------------------------------------- */
.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 400;
  color: var(--color-text);
}
.contact-row img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* -------------------------------------------------------------------
   15. Positive / Negative Thesis Columns — Section 02
   ------------------------------------------------------------------- */
.thesis-col {
  border-radius: 6px;
  padding: 20px 24px;
}
.thesis-col--positive { background: var(--color-positive-bg); }
.thesis-col--negative { background: var(--color-negative-bg); }

.thesis-col__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.thesis-col--positive .thesis-col__label { color: var(--color-positive); }
.thesis-col--negative .thesis-col__label { color: var(--color-negative); }

.thesis-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text);
  padding: 5px 0;
}
.thesis-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}
.thesis-icon--positive { background: var(--color-positive); color: #fff; }
.thesis-icon--negative { background: var(--color-negative); color: #fff; }

/* -------------------------------------------------------------------
   16. Client Logo Grid — Section 11
   ------------------------------------------------------------------- */
.client-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 64px;
  align-items: center;
  justify-items: center;
}
.client-logo {
  height: 56px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

/* -------------------------------------------------------------------
   17. Review Source Grid — Section 06
   ------------------------------------------------------------------- */
.source-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.source-category {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.source-category__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  text-align: center;
}
.source-icons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.source-icon {
  height: 30px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
}

/* -------------------------------------------------------------------
   18. Timeline — Section 09
   ------------------------------------------------------------------- */
.timeline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  padding-top: 40px;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border);
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}
.timeline-step__dot {
  position: absolute;
  top: -40px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-cyan);
  box-shadow: 0 0 0 3px var(--color-bg), 0 0 0 5px var(--color-cyan);
}
.timeline-step__num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-cyan);
  margin-bottom: 8px;
}
.timeline-step__desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 160px;
  line-height: 1.5;
}

/* -------------------------------------------------------------------
   19. Header
   ------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.3s, backdrop-filter 0.3s;
}
.site-header.is-scrolled {
  background: rgba(12, 16, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
}
.header__logo { justify-self: start; }
.header__logo img { height: 30px; width: auto; }
.header__nav {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-self: center;
}
.header__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text);
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--color-cyan); }
.nav-link--muted {
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 400;
}

/* -------------------------------------------------------------------
   20. Footer
   ------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.footer__logo img { height: 84px; width: auto; }
.footer__nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.footer__legal {
  text-align: center;
  padding-top: 16px;
  margin-top: 8px;
}

/* ===================================================================
   21. Section Separator (Process → Case Study)
   =================================================================== */
.section-sep {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-sep__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(28, 207, 207, 0.35), transparent);
}

.section-sep__diamond {
  width: 8px;
  height: 8px;
  background: var(--color-cyan);
  transform: rotate(45deg);
  opacity: 0.7;
  flex-shrink: 0;
}

/* ===================================================================
   22. Hamburger Button
   =================================================================== */
.header__burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.header__burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.header__burger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.header__burger.is-open span:nth-child(2) { opacity: 0; }
.header__burger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===================================================================
   22. Active nav link
   =================================================================== */
.nav-link.is-active {
  color: var(--color-cyan);
}

/* ===================================================================
   23. Form validation styles
   =================================================================== */
.form-group {
  position: relative;
}
.form-error {
  display: none;
  font-size: 12px;
  color: var(--color-negative);
  margin-top: 4px;
}
.form-field:invalid:not(:placeholder-shown) + .form-error {
  display: block;
}
.form-field:invalid:not(:placeholder-shown) {
  border-color: var(--color-negative);
}
.form-success {
  font-size: 14px;
  color: var(--color-positive);
  margin-top: 8px;
}

/* ----- Form: consent text + feedback ----- */
.form-consent {
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-top: 12px;
  margin-bottom: 0;
}

.form-consent a {
  color: var(--color-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-consent a:hover {
  opacity: 0.85;
}

.form-feedback {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.form-feedback--success {
  color: var(--color-positive);
}

.form-feedback--error {
  color: var(--color-negative);
}

.form-field[aria-invalid="true"] {
  border-color: var(--color-negative);
}

/* ===================================================================
   24. Focus-visible accessibility styles
   =================================================================== */
*:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 3px;
  border-radius: 2px;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 4px;
}

/* ===================================================================
   25. Responsive — Tablet (≤1024px)
   =================================================================== */
@media (max-width: 1024px) {
  :root {
    --container-px: 48px;
  }

  .footer__inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 24px;
  }
  .footer__nav {
    order: 3;
    width: 100%;
  }
}

/* ===================================================================
   26. Responsive — Mobile landscape (≤768px)
   =================================================================== */
@media (max-width: 768px) {
  :root {
    --container-px: 20px;
    --section-py: 60px;
  }

  /* Header / hamburger */
  .header__burger { display: flex; }
  /* On mobile, disable backdrop-filter on the header — it creates a new
     containing block for position:fixed descendants, which would collapse
     the open nav panel to zero height. See also .header__nav below. */
  .site-header.is-scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .header__nav {
    display: none;
    position: fixed;
    inset: 64px 0 0 0;
    /* Override base .header__nav { justify-self: center } — as a grid item
       of .header__inner, center would shrink-to-fit the fixed panel to the
       middle grid column instead of spanning the viewport. */
    justify-self: stretch;
    background: var(--color-bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 99;
  }
  .header__nav.is-open { display: flex; }
  .header__nav .nav-link { font-size: 18px; }
  .header__actions .btn--primary { display: none; }

  /* Footer */
  .footer__nav { gap: 16px; }
}

/* ===================================================================
   27. Responsive — Small mobile (≤480px)
   =================================================================== */
@media (max-width: 480px) {
  :root {
    --container-px: 16px;
    --section-py: 48px;
  }

  .section-title {
    font-size: clamp(24px, 6vw, 32px);
  }

  /* Buttons span full width on narrow screens for easier tapping */
  .btn {
    width: 100%;
    justify-content: center;
  }
}

