/* ============================================================
   SMARDEN.CORE — Engineering Blueprint Design System
   Light "datasheet" aesthetic derived from product packaging
   ============================================================ */

/* Fonts are loaded async via <link> in each HTML <head> — never via @import
   (CSS @import is render-blocking and serializes the network waterfall). */

:root {
  /* Palette — sampled from the packaging sticker */
  --paper:        #f4f3ed;
  --paper-pure:   #ffffff;
  --ink:          #111310;
  --ink-soft:     #585c50;
  --ink-faint:    #8a8d80;
  --green:        #46a82b;
  --green-700:    #2f7a1c;
  --green-glow:   #1fce0e;
  --green-wash:   rgba(70, 168, 43, 0.10);
  --green-wash-2: rgba(70, 168, 43, 0.18);
  --line:         rgba(17, 19, 16, 0.14);
  --line-strong:  rgba(17, 19, 16, 0.30);
  --panel:        #0d0f0c;
  --panel-2:      #15180f;

  --font-display: 'Bricolage Grotesque', 'Archivo', sans-serif;
  --font-body:    'Archivo', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --maxw: 1240px;
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  /* Blueprint graph-paper grid */
  background-image:
    linear-gradient(rgba(17,19,16,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,19,16,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
}

::selection { background: var(--green); color: #fff; }

img { max-width: 100%; display: block; }

a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Typography helpers ---------- */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--green-700);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker::before {
  content: '';
  width: 26px;
  height: 1px;
  background: var(--green);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.section-head { max-width: 720px; margin-bottom: 64px; }
.section-head h2 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin: 18px 0 16px;
}
.section-head p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 560px;
}

/* ---------- Buttons ---------- */
.btn {
  --b: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 30px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--b);
  border: 1.5px solid var(--b);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), color .35s var(--ease);
  isolation: isolate;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--green);
  transform: translateY(101%);
  transition: transform .45s var(--ease);
  z-index: -1;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -12px rgba(70,168,43,0.6); }
.btn:hover::after { transform: translateY(0); }

.btn--green { --b: var(--green); }
.btn--green::after { background: var(--ink); }

.btn--ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}
.btn--ghost::after { background: var(--ink); }
.btn--ghost:hover { color: var(--paper); border-color: var(--ink); }

.btn .arr { transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translateX(5px); }

.textlink {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--green-700);
  border-bottom: 1.5px solid var(--green);
  padding-bottom: 3px;
  transition: color .25s, border-color .25s;
}
.textlink:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--panel);
  color: rgba(255,255,255,0.62);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 34px;
}
.topbar .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--green-glow);
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: middle;
  animation: blink 2.4s infinite;
}
.topbar span:last-child { color: rgba(255,255,255,0.4); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244,243,237,0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: padding .3s var(--ease), background .3s;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.navbar.scrolled { padding-top: 0; padding-bottom: 0; }
.navbar.scrolled .container { padding-top: 12px; padding-bottom: 12px; }

.logo { display: flex; align-items: center; gap: 13px; text-decoration: none; color: var(--ink); }
.logo svg, .logo img { width: auto; height: 40px; flex: none; display: block; transition: height .3s; }
.navbar.scrolled .logo svg, .navbar.scrolled .logo img { height: 32px; }
.logo-type { display: flex; flex-direction: column; line-height: 1; }
.logo-type b {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.logo-type small {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  color: var(--green-700);
  margin-top: 3px;
}

.nav-links { display: flex; align-items: center; gap: 38px; list-style: none; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  position: relative;
  padding: 6px 0;
  transition: color .25s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--green);
  transition: width .3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
/* Shop CTA inside nav: restore full button styling (beats .nav-links a) */
.nav-links a.btn {
  padding: 13px 24px;
  color: var(--paper);
  border-radius: 6px;
  margin-left: 6px;
}
.nav-links a.btn::after {
  inset: 0;
  width: auto;
  height: auto;
  background: var(--ink);
  transform: translateY(101%);
}
.nav-links a.btn:hover { color: var(--paper); }
.nav-links a.btn:hover::after { width: auto; transform: translateY(0); }

.hamburger { display: none; cursor: pointer; background: none; border: 0; padding: 6px; }
.hamburger span {
  display: block;
  width: 26px; height: 2px;
  background: var(--ink);
  margin: 6px 0;
  transition: all .3s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Footer ---------- */
.footer {
  background: var(--panel);
  color: rgba(255,255,255,0.62);
  padding: 80px 0 30px;
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--green) 0 14px, transparent 14px 26px);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 50px;
  padding-bottom: 50px;
}
.footer-brand .logo { color: #fff; margin-bottom: 20px; }
.footer-brand .logo svg { color: var(--green-glow); }
.footer-brand p { max-width: 340px; font-size: 0.94rem; line-height: 1.7; }
.footer h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--green-glow);
  margin-bottom: 22px;
  text-transform: uppercase;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 13px; }
.footer ul a {
  text-decoration: none;
  color: rgba(255,255,255,0.62);
  font-size: 0.92rem;
  transition: color .25s, padding-left .25s;
}
.footer ul a:hover { color: #fff; padding-left: 6px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .08s; }
.reveal[data-d="2"] { transition-delay: .16s; }
.reveal[data-d="3"] { transition-delay: .24s; }
.reveal[data-d="4"] { transition-delay: .32s; }
.reveal[data-d="5"] { transition-delay: .40s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Legal pages ---------- */
.page-hero {
  padding: 90px 0 70px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.page-hero::after {
  content: '';
  position: absolute;
  left: 28px; bottom: -1px;
  width: 120px; height: 3px;
  background: var(--green);
}
.page-hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
.page-hero p { color: var(--ink-soft); font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.08em; margin-top: 14px; }

.legal { padding: 70px 0 100px; }
.legal-wrap {
  max-width: 880px;
  background: var(--paper-pure);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 60px;
  position: relative;
}
.legal-wrap::before, .legal-wrap::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--green);
  border-style: solid;
}
.legal-wrap::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.legal-wrap::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.legal-wrap h2 {
  font-size: 1.5rem;
  margin: 42px 0 18px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.legal-wrap h2:first-of-type { margin-top: 0; }
.legal-wrap h3 { font-size: 1.1rem; margin: 26px 0 12px; color: var(--green-700); }
.legal-wrap p { color: var(--ink-soft); margin-bottom: 15px; }
.legal-wrap a { color: var(--green-700); text-decoration: none; border-bottom: 1px solid var(--green-wash-2); transition: border-color .2s; }
.legal-wrap a:hover { border-color: var(--green); }
.legal-wrap ul, .legal-wrap ol { margin: 12px 0 22px 22px; color: var(--ink-soft); }
.legal-wrap li { margin-bottom: 9px; }
.legal-wrap code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--green-wash);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--green-700);
}
.info-block {
  background: var(--green-wash);
  border-left: 3px solid var(--green);
  padding: 20px 24px;
  border-radius: 0 8px 8px 0;
  margin: 22px 0;
}
.info-block p { color: var(--ink); margin: 0; }
.placeholder-note {
  background: #fff8e6;
  border: 1px dashed #d8a72b;
  color: #7a5a10;
  padding: 16px 20px;
  border-radius: 8px;
  margin: 0 0 30px;
  font-size: 0.92rem;
}
.toc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px 30px;
  margin: 0 0 36px;
}
.toc h3 { margin: 0 0 14px; color: var(--ink); font-size: 0.95rem; }
.toc ol { margin: 0 0 0 20px; }
.toc li { margin-bottom: 7px; }
.toc a { font-size: 0.92rem; }
.service-table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 0.9rem;
}
.service-table th, .service-table td {
  border: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
}
.service-table th {
  background: var(--green-wash);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-700);
}
.service-table td { color: var(--ink-soft); }

/* ---------- Responsive (shared) ---------- */
@media (max-width: 940px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .container { padding: 0 20px; }
  .hamburger { display: block; position: relative; z-index: 120; }
  /* backdrop-filter on an ancestor makes it the containing block for
     position:fixed children — that breaks the off-canvas drawer.
     Disable it on mobile and use a solid navbar background instead. */
  .navbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
  .nav-links {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(82vw, 340px);
    height: 100vh;
    height: 100dvh;
    background: var(--paper-pure);
    border-left: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 28px;
    padding: 100px 40px 40px;
    transform: translateX(100%);
    transition: transform .45s var(--ease);
    box-shadow: -30px 0 60px -30px rgba(0,0,0,0.35);
    z-index: 110;
    overflow-y: auto;
  }
  .nav-links.active { transform: translateX(0); }
  .nav-links a { font-size: 1.05rem; }
  .nav-links a.btn { margin-left: 0; margin-top: 8px; }
  .legal-wrap { padding: 36px 24px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
  .legal-wrap { padding: 28px 18px; }
}
