/*
Theme Name: HardPan
Theme URI: https://hardpan.io
Author: 25 Fathoms
Author URI: https://hardpan.io
Description: Compliance OS for multi-site waste operators. Marketing parent theme for HardPan — home, pricing, about, and contact. Slate / Ember / Cream palette, Inter + IBM Plex Mono. Hardcoded page templates (front-page, page-pricing, page-about, page-contact).
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hardpan
*/

/* HardPan — shared stylesheet
   Tokens, type, layout primitives, components.
   ============================================================ */

/* --- Tokens ------------------------------------------------- */
:root {
  --slate: #2A3340;
  --slate-90: #38414f;
  --slate-70: #5a6371;
  --slate-50: #8a929d;
  --slate-30: #b9bec5;
  --slate-12: #dfe1e4;
  --slate-06: #ececed;

  --ember: #D9531E;
  --ember-hover: #c0461a;
  --ember-tint: #f9e4d9;

  --cream: #F5F1EA;
  --cream-deep: #ece6da;
  --cream-light: #faf7f1;
  --paper: #ffffff;

  --forest: #4A6B4D;
  --forest-tint: #e3eae4;
  --rust: #A33A2A;
  --rust-tint: #f0dad6;

  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 48px);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --t-fast: 140ms cubic-bezier(.2,.7,.3,1);
  --t-base: 220ms cubic-bezier(.2,.7,.3,1);
}

/* --- Reset / base ------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  font-size: 17px;
  line-height: 1.55;
  color: var(--slate);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--slate-12); margin: 0; }

/* --- Type --------------------------------------------------- */
.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-70);
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 2px;
  background: var(--ember);
}
.eyebrow.no-mark::before { display: none; }

h1, h2, h3, h4 { font-family: inherit; margin: 0; color: var(--slate); letter-spacing: -0.02em; }
.h-display {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.h-section {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.h-sub {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.35;
}
.lede {
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--slate-70);
  max-width: 56ch;
}
.body-l { font-size: 18px; line-height: 1.55; color: var(--slate-70); }
.mono {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

/* --- Layout ------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: clamp(72px, 9vw, 128px) 0; }
.section.tight { padding: clamp(56px, 7vw, 96px) 0; }
.section.dark { background: var(--slate); color: var(--cream); }
.section.dark h1, .section.dark h2, .section.dark h3 { color: var(--cream); }
.section.dark .eyebrow { color: rgba(245,241,234,0.65); }
.section.paper { background: var(--paper); }

.grid { display: grid; gap: 24px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; }
.stack > * + * { margin-top: var(--gap, 16px); }

/* --- Buttons ------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  line-height: 1;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ember);
  color: #fff;
}
.btn-primary:hover { background: var(--ember-hover); }
.btn-ghost {
  background: transparent;
  color: var(--slate);
  border-color: var(--slate-12);
}
.btn-ghost:hover { border-color: var(--slate); }
.btn-dark {
  background: var(--slate);
  color: var(--cream);
}
.btn-dark:hover { background: #000; }
.btn-on-dark {
  background: var(--cream);
  color: var(--slate);
}
.btn-on-dark:hover { background: #fff; }
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--slate);
  font-weight: 500;
  border-bottom: 1px solid var(--slate-12);
  padding-bottom: 2px;
}
.btn-link:hover { border-color: var(--ember); color: var(--ember); }
.btn .arrow { transition: transform var(--t-fast); }
.btn:hover .arrow { transform: translateX(3px); }

/* --- Nav ---------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 241, 234, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-base);
}
.nav.scrolled { border-bottom-color: var(--slate-12); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-brand img { height: 30px; width: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--slate-70);
  transition: color var(--t-fast);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--slate); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-cta .btn { padding: 10px 18px; font-size: 14px; }

/* Mobile menu toggle — hidden on desktop */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin: 0 -10px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--slate);
  align-items: center;
  justify-content: center;
}
.nav-toggle .bars {
  position: relative;
  display: block;
  width: 22px;
  height: 16px;
}
.nav-toggle .bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--t-base), opacity var(--t-fast), top var(--t-base);
}
.nav-toggle .bars span:nth-child(1) { top: 0; }
.nav-toggle .bars span:nth-child(2) { top: 7px; }
.nav-toggle .bars span:nth-child(3) { top: 14px; }
.nav.menu-open .nav-toggle .bars span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.nav.menu-open .nav-toggle .bars span:nth-child(2) { opacity: 0; }
.nav.menu-open .nav-toggle .bars span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

@media (max-width: 800px) {
  .nav-toggle { display: inline-flex; }
  .nav-cta .ghost-mobile { display: none; }

  /* Links become a dropdown panel under the header */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 12px;
    background: var(--cream-light);
    border-bottom: 1px solid var(--slate-12);
    box-shadow: 0 14px 30px rgba(42, 51, 64, 0.1);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base);
  }
  .nav.menu-open .nav-links {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 12px var(--gutter);
    font-size: 16px;
    color: var(--slate);
    border-bottom: 1px solid var(--slate-06);
  }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ember); }
}

/* --- Footer ------------------------------------------------- */
.footer {
  background: var(--slate);
  color: rgba(245,241,234,0.7);
  padding: 80px 0 40px;
}
.footer a { color: rgba(245,241,234,0.7); transition: color var(--t-fast); }
.footer a:hover { color: var(--cream); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.footer-brand img { height: 34px; width: auto; }
.footer-brand p { margin-top: 18px; color: rgba(245,241,234,0.55); font-size: 14px; max-width: 32ch; }
.footer h5 { color: var(--cream); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; margin: 0 0 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14.5px; }
.footer-bottom {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid rgba(245,241,234,0.12);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(245,241,234,0.5);
  gap: 16px;
  flex-wrap: wrap;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* --- Stack mark glyph (inline) ------------------------------ */
.stackmark {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 28px;
}
.stackmark span { display: block; height: 4px; border-radius: 1px; background: var(--slate); }
.stackmark span:nth-child(1) { width: 78%; background: var(--ember); }
.stackmark span:nth-child(2) { width: 78%; }
.stackmark span:nth-child(3) { width: 78%; }
.stackmark span:nth-child(4) { width: 100%; }

/* --- Utilities ---------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--slate-06);
  color: var(--slate-70);
  letter-spacing: 0.005em;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-ember { color: var(--ember); background: var(--ember-tint); }
.tag-forest { color: var(--forest); background: var(--forest-tint); }
.tag-rust { color: var(--rust); background: var(--rust-tint); }
.tag-on-dark { background: rgba(245,241,234,0.08); color: rgba(245,241,234,0.8); }

.divider-rule {
  display: inline-block;
  width: 32px;
  height: 2px;
  background: var(--ember);
  margin-bottom: 20px;
}

.kbd {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11.5px;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--slate-12);
  background: var(--paper);
  color: var(--slate-70);
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms ease, transform 600ms cubic-bezier(.2,.7,.3,1); }
  .reveal.is-in { opacity: 1; transform: none; }
}
