/* ============================================================
   InHouse Survey — Design Tokens
   Matches InHouse_Rebrand_Brief_v1.html (05_Branding).
   MVP reference brand for the Residential Survey App.
   ============================================================ */

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

:root {
  /* Brand — forest / sage / brass on parchment */
  --ih-primary:       #2E3E36;   /* Forest — primary, headers */
  --ih-primary-deep:  #1F2B25;   /* Deeper forest — hover, footer */
  --ih-secondary:     #4C7A69;   /* Sage — links, interactive */
  --ih-secondary-soft: #6B9A89;  /* Sage highlight on dark */
  --ih-accent:        #C07A3A;   /* Brass — CTAs, accents */
  --ih-accent-light:  #E8A55F;   /* Brass light — on dark bg */
  --ih-accent-wash:   rgba(192, 122, 58, 0.12);

  /* Ground */
  --ih-bg:        #F7F3EE;   /* Parchment — page bg */
  --ih-bg-mid:    #EDE8E0;   /* Stone — card, section */
  --ih-bg-dark:   #2E3E36;   /* Forest — dark surfaces */
  --ih-bg-darker: #1F2B25;

  /* Text */
  --ih-text:      #1E1917;   /* Bark — body text */
  --ih-text-mid:  #4A433E;   /* Earth — secondary text */
  --ih-text-soft: #7A7067;   /* Muted */
  --ih-text-on-dark: #F2EDE5;

  /* Borders */
  --ih-border:    #D6CFC5;   /* Warm neutral */
  --ih-border-dark: rgba(242, 237, 229, 0.12);

  /* Status — risk, feedback */
  --ih-critical:  #9E2B2B;
  --ih-high:      #B85826;
  --ih-medium:    #C07A3A;
  --ih-low:       #3E7352;
  --ih-success:   #3E7352;
  --ih-warning:   #B85826;
  --ih-info:      #4C7A69;

  /* Typography */
  --ih-font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --ih-font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  --fs-xs:   0.75rem;   /* 12px */
  --fs-sm:   0.875rem;  /* 14px */
  --fs-base: 0.9375rem; /* 15px */
  --fs-md:   1.0625rem; /* 17px */
  --fs-lg:   1.25rem;   /* 20px */
  --fs-xl:   1.5rem;    /* 24px */
  --fs-2xl:  2rem;      /* 32px */
  --fs-3xl:  2.5rem;    /* 40px */
  --fs-4xl:  clamp(2.5rem, 5vw, 3.5rem);

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-body: 1.65;
  --lh-loose: 1.8;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.08em;
  --tracking-wider: 0.12em;
  --tracking-display: 0.18em;  /* used in Direction C logo */

  /* Spacing — Fibonacci */
  --sp-1:  8px;
  --sp-2: 13px;
  --sp-3: 21px;
  --sp-4: 34px;
  --sp-5: 55px;
  --sp-6: 89px;
  --sp-7: 144px;

  /* Radius — contextual hierarchy */
  --r-input: 2px;
  --r-card:  4px;
  --r-modal: 8px;
  --r-pill:  999px;

  /* Shadow — used sparingly */
  --shadow-soft: 0 2px 8px rgba(30, 25, 23, 0.06);
  --shadow-lift: 0 8px 24px rgba(30, 25, 23, 0.10);
  --shadow-forest: 0 4px 18px rgba(46, 62, 54, 0.14);

  /* Layout */
  --max-content: 1140px;
  --max-reading: 720px;
  --grid-golden-a: 61.8%;
  --grid-golden-b: 38.2%;

  /* Motion */
  --ease-standard: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-enter:    cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 360ms;
}

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

/* Default theme — parchment (client view, reports, most screens) */
body {
  --bg:        var(--ih-bg);
  --bg-raised: #FFFFFF;
  --bg-card:   #FFFFFF;
  --bg-inset:  var(--ih-bg-mid);
  --text:      var(--ih-text);
  --text-soft: var(--ih-text-mid);
  --text-muted: var(--ih-text-soft);
  --border:    var(--ih-border);
  background: var(--bg);
  color: var(--text);
}

/* Forest theme — surveyor portal nav, cover pages */
body.theme-forest {
  --bg:        var(--ih-bg-dark);
  --bg-raised: var(--ih-primary-deep);
  --bg-card:   rgba(255, 255, 255, 0.03);
  --bg-inset:  rgba(255, 255, 255, 0.05);
  --text:      var(--ih-text-on-dark);
  --text-soft: rgba(242, 237, 229, 0.75);
  --text-muted: rgba(242, 237, 229, 0.55);
  --border:    var(--ih-border-dark);
}

/* ------------------------------------------------------------
   Base reset + typography defaults
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--ih-font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-weight: 400;
}

h1, h2, h3 {
  font-family: var(--ih-font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ih-primary);
}
body.theme-forest h1,
body.theme-forest h2,
body.theme-forest h3 { color: var(--ih-text-on-dark); }

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }

h4, h5 {
  font-family: var(--ih-font-body);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}
h4 { font-size: var(--fs-md); }
h5 { font-size: var(--fs-sm); font-weight: 600; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--ih-secondary); }

p { line-height: var(--lh-body); }

a { color: var(--ih-secondary); text-decoration: none; transition: color var(--dur-fast) var(--ease-standard); }
a:hover { color: var(--ih-accent); }

code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  background: var(--bg-inset);
  padding: 1px 6px;
  border-radius: var(--r-input);
  font-size: 0.88em;
}

/* Eyebrow / kicker */
.eyebrow {
  font-family: var(--ih-font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--ih-secondary);
}
body.theme-forest .eyebrow { color: var(--ih-accent-light); }

/* Brass accent line */
.rule-brass {
  width: 48px;
  height: 2px;
  background: var(--ih-accent);
  border: none;
  border-radius: 1px;
}

/* ------------------------------------------------------------
   LOGO — Direction C (typographic mark)
   Used in nav, report covers, emails. Pure CSS, no image asset.
   ------------------------------------------------------------ */
.ih-logo {
  display: inline-block;
  text-align: center;
}
.ih-logo .wordmark {
  font-family: var(--ih-font-body);
  font-size: var(--fs-lg);
  font-weight: 300;
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  color: var(--ih-primary);
  line-height: 1;
}
.ih-logo .rule {
  width: 48px;
  height: 1px;
  background: var(--ih-accent);
  margin: 6px auto;
}
.ih-logo .descriptor {
  font-family: var(--ih-font-body);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ih-text-mid);
}
.ih-logo.logo-sm .wordmark { font-size: var(--fs-base); }
.ih-logo.logo-sm .rule     { width: 32px; margin: 4px auto; }
.ih-logo.logo-sm .descriptor { font-size: 0.55rem; }
.ih-logo.logo-lg .wordmark { font-size: var(--fs-2xl); letter-spacing: 0.22em; }
.ih-logo.logo-lg .rule     { width: 72px; margin: 10px auto; }
.ih-logo.logo-lg .descriptor { font-size: 0.75rem; }

/* Logo on dark background */
body.theme-forest .ih-logo .wordmark { color: var(--ih-text-on-dark); font-weight: 300; }
body.theme-forest .ih-logo .rule     { background: var(--ih-accent-light); }
body.theme-forest .ih-logo .descriptor { color: rgba(242, 237, 229, 0.65); }

.ih-logo.logo-on-dark .wordmark { color: var(--ih-text-on-dark); }
.ih-logo.logo-on-dark .rule     { background: var(--ih-accent-light); }
.ih-logo.logo-on-dark .descriptor { color: rgba(242, 237, 229, 0.65); }
