/* ============================================
   Just Quality Consultancy — Design Tokens
   ============================================ */
:root {
  --ink: #1B4236;
  --forest: #1B4236;
  --forest-dark: #1B4236;
  --paper: #F4E9D8;
  --paper-raised: #FFFFFF;
  --sage: #6B847C;
  --sage-dim: #EAF6F2;
  --sage-dim-deep: #D3DDDA;
  --brass: #C9A227;
  --line: #DCD0BA;

  --font-display: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;

  --wrap: 1320px;
  --radius: 3px;
}

/* ============================================
   Reset & base
   ============================================ */
*, *::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;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--forest-dark);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }
a { color: var(--forest); text-decoration-color: var(--sage); text-underline-offset: 3px; }
a:hover { color: var(--brass); }

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

.sr-only {
  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: -999px; top: 0; background: var(--forest); color: #fff;
  padding: 0.75em 1.25em; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  display: block;
  margin-bottom: 0.9em;
}

/* ============================================
   Header / Nav — styled like a document header bar
   ============================================ */
.site-header {
  background: var(--forest);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 3px solid var(--brass);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
}
.brand-mark {
  display: block;
}
.brand-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: 0.01em;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}
.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #EDEAE2;
  text-decoration: none;
  padding: 0.4em 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--brass);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  width: 20px;
  margin: 0 auto;
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--forest-dark);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .site-nav.is-open { max-height: 300px; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 0.5rem 1.5rem 1rem; }
  .site-nav a { display: block; padding: 0.75em 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
}

/* ============================================
   Hero — framed like a controlled document header
   ============================================ */
.hero {
  padding: 4.5rem 0 4rem;
  position: relative;
}
.hero-logo-top {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}
.hero-logo-large {
  width: 100%;
  max-width: 420px;
  height: auto;
}
.hero-frame {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brass);
  background: var(--paper-raised);
  padding: clamp(1.75rem, 5vw, 3.5rem);
  position: relative;
}
.hero-ref {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.9em;
  margin-bottom: 1.4em;
}
.who-grid {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 380px);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.who-text { margin-bottom: 0; }
.who-logo-col {
  display: flex;
  justify-content: center;
}
.who-logo {
  width: 100%;
  max-width: 360px;
  height: auto;
}
@media (max-width: 760px) {
  .who-grid { grid-template-columns: 1fr; }
  .who-logo { max-width: 180px; margin: 0 auto; }
  .who-logo-col { order: -1; }
}
.hero-headline { max-width: 26ch; }
.hero-subhead {
  max-width: 90ch;
  font-size: 1.08rem;
  color: var(--ink);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
}

.seal {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 74px;
  height: 74px;
  color: var(--brass);
  opacity: 0.9;
}
@media (max-width: 640px) { .seal { display: none; } }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85em 1.6em;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--forest);
  color: #fff;
}
.btn-primary:hover { background: var(--forest-dark); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--forest-dark);
  border-color: var(--forest-dark);
}
.btn-secondary:hover { background: var(--forest); color: #fff; border-color: var(--forest); }

/* ============================================
   Sections
   ============================================ */
section { padding: 3.5rem 0; }
.section-alt { background: var(--sage-dim); }
.section-head { max-width: 68ch; margin-bottom: 2.2rem; }
.section-head-wide { max-width: none; }
.section-cream { background: var(--paper); }
.section-green { background: var(--sage-dim-deep); }

body.bg-green-swap { background: var(--sage-dim-deep); }
body.bg-green-swap .section-alt { background: var(--paper); }

.grid {
  display: grid;
  gap: 1.75rem;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-top: 3px solid var(--sage);
  padding: 1.6rem;
  border-radius: var(--radius);
}
.card-cream { background: var(--paper); }
.card-green { background: var(--sage-dim-deep); }
.card h3 { margin-bottom: 0.4em; }
.card p { margin-bottom: 0; color: var(--ink); font-size: 0.96rem; }

/* Ledger-style numbered service entries — echoes ISO clause numbering */
.ledger {
  border-top: 1px solid var(--line);
}
.ledger-item {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.ledger-icon {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--forest);
  margin-top: 0.2em;
}
.ledger-icon svg {
  width: 100%;
  height: 100%;
}
.ledger-item h3 { margin-bottom: 0.3em; }
.ledger-item p { margin-bottom: 0; color: var(--ink); }

@media (max-width: 560px) {
  .ledger-item { grid-template-columns: 1fr; gap: 0.3rem; }
}

.list-check {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-check li {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: 0.7em;
}
.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 8px;
  height: 8px;
  background: var(--brass);
  transform: rotate(45deg);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  padding: 0.4em 0.7em;
  border-radius: 2px;
  color: var(--forest-dark);
}

/* ============================================
   Closing CTA band
   ============================================ */
.cta-band {
  background: var(--forest);
  color: #F6F4EF;
  padding: 3.5rem 0;
  position: relative;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #D9E2DE; max-width: 60ch; }
.cta-band .seal { color: rgba(255,255,255,0.5); }
.cta-band .btn-primary { background: var(--brass); }
.cta-band .btn-primary:hover { background: #8E6C33; }
.cta-band .btn-secondary { border-color: #D9E2DE; color: #fff; }
.cta-band .btn-secondary:hover { background: #fff; color: var(--forest-dark); }

/* ============================================
   Contact form
   ============================================ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}
label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest-dark);
  margin-bottom: 0.4em;
}
input, select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 0.75em 0.9em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
  border-color: var(--brass);
}
textarea { resize: vertical; min-height: 130px; }

.contact-details {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 1rem;
}
.contact-side {
  /* No top offset: the grid uses align-items:start, so this naturally
     lines up the top of the logo with the top of the form's Name/Company
     row. */
  margin-top: 0;
}
.contact-logo {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto 1.75rem;
}
@media (max-width: 640px) {
  .contact-side { margin-top: 0; }
  .contact-logo { max-width: 220px; }
}
.contact-detail dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.3em;
}
.contact-detail dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--forest-dark);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--forest);
  color: #C9D2CD;
  margin-top: 3rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding: 3rem 0 2rem;
}
.footer-brand { display: flex; gap: 0.75rem; align-items: flex-start; }
.footer-brand img { opacity: 0.95; margin-top: 3px; }
.footer-name { font-family: var(--font-display); color: #fff; font-weight: 600; margin: 0 0 0.2em; }
.footer-tagline { margin: 0; font-size: 0.9rem; color: #9FAEA7; }
.footer-contact p { margin: 0 0 0.5em; }
.footer-contact a { color: #E4EAE6; }
.footer-meta { font-size: 0.82rem; color: #8FA098; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav a { color: #C9D2CD; text-decoration: none; font-size: 0.92rem; line-height: 2.1; }
.footer-nav a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1.25rem 0;
  font-size: 0.8rem;
  color: #7C8B84;
}

@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ============================================
   Page-load reveal (respects reduced motion via base rule above)
   ============================================ */
.reveal {
  animation: reveal-up 0.6s ease both;
}
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
