/* =========================================================
   Tonal Digital Solutions: site styles (v2, editorial)
   Ink navy · warm off-white · emerald accent · serif display
   ========================================================= */

:root {
  --ink: #0B1B33;
  --ink-2: #12274A;
  --ink-3: #1B3560;
  --text: #111827;
  --text-2: #475467;
  --text-3: #5B6775;
  --green: #0E6B4E;
  --green-600: #0A5740;
  --green-100: #E7F1EC;
  --green-on-dark: #3FB58B;
  --paper: #FFFFFF;
  --paper-2: #F5F4F0;
  --line: rgba(11, 27, 51, 0.14);
  --line-strong: rgba(11, 27, 51, 0.30);
  --line-dark: rgba(255, 255, 255, 0.16);
  --radius: 4px;
  --container: 1200px;
  --nav-h: 76px;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--ink); text-decoration: none; }
p { margin: 0; }
ul, ol { margin: 0; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 5.4vw, 4.4rem); line-height: 1.04; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.1; }
h3 { font-size: 1.45rem; line-height: 1.25; }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 32px;
}
@media (max-width: 640px) {
  .container { padding-inline: 20px; }
}

.section { padding-block: 112px; }
.section-alt { background: var(--paper-2); }
.section-ink { background: var(--ink); color: #fff; }
@media (max-width: 768px) {
  .section { padding-block: 72px; }
}

.section-head { max-width: 780px; margin-bottom: 56px; }
.section-head h2 { margin-top: 20px; }
.section-sub { margin-top: 18px; color: var(--text-2); font-size: 1.1rem; max-width: 60ch; }
.on-dark h2, .on-dark h3 { color: #fff; }
.on-dark .section-sub { color: rgba(255, 255, 255, 0.72); }
@media (max-width: 768px) {
  .section-head { margin-bottom: 40px; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  flex: none;
}
.on-dark .eyebrow { color: var(--green-on-dark); }

.index {
  display: block;
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--green);
  margin-bottom: 22px;
}
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.tag-accent { color: var(--green); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 600 0.92rem/1.2 var(--sans);
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn .arrow { width: 16px; height: 16px; transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.on-dark .btn-outline { border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.on-dark .btn-outline:hover { border-color: #fff; background: rgba(255, 255, 255, 0.06); }
.btn-lg { padding: 1rem 1.75rem; font-size: 0.98rem; }
.btn-sm { padding: 0.65rem 1.1rem; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.65; cursor: default; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: var(--nav-h);
}

/* Wordmark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  white-space: nowrap;
}
.brand-word {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand-divider { width: 1px; height: 28px; background: var(--line-strong); }
.brand-sub {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
  line-height: 1.35;
}
.brand-light .brand-word { color: #fff; }
.brand-light .brand-divider { background: rgba(255, 255, 255, 0.35); }
.brand-light .brand-sub { color: rgba(255, 255, 255, 0.72); }

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  opacity: 0.78;
  transition: opacity 0.15s ease;
}
.nav-links a:hover, .nav-links a.is-active { opacity: 1; }
.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 1px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-links a.is-active::after, .nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-cta { opacity: 1; margin-left: 8px; color: #fff; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 960px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 32px 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(11, 27, 51, 0.3);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a {
    padding: 15px 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
    opacity: 1;
  }
  .nav-links a:not(.nav-cta)::after { display: none; }
  .nav-links .nav-cta {
    margin: 20px 0 0;
    border-bottom: 0;
    padding: 0.95rem 1rem;
    font-size: 0.98rem;
  }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 640px) {
  .nav-links { padding-inline: 20px; }
}
@media (max-width: 380px) {
  .brand-divider, .brand-sub { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  padding: 120px 0 0;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(27, 53, 96, 0.95), transparent 62%),
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  align-items: end;
}
.hero-copy { padding-bottom: 120px; }
.hero h1 { color: #fff; max-width: 20ch; margin: 26px 0 28px; }
.hero .lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.76);
  max-width: 58ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.hero-points {
  list-style: none;
  padding: 24px 0 0;
  margin: 48px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 0;
  border-top: 1px solid var(--line-dark);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.hero-points li { padding-right: 28px; margin-right: 28px; border-right: 1px solid var(--line-dark); }
.hero-points li:last-child { padding-right: 0; margin-right: 0; border-right: 0; }
.hero-visual { display: flex; justify-content: flex-end; align-self: end; }
.hero-lines { width: 100%; max-width: 440px; height: auto; }
@media (max-width: 1000px) {
  .hero { padding-top: 80px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 88px; }
  .hero-visual { display: none; }
}
@media (max-width: 640px) {
  .hero { padding-top: 56px; }
  .hero-copy { padding-bottom: 64px; }
  .hero-actions .btn { width: 100%; }
  .hero-points li { padding-right: 16px; margin-right: 16px; }
}

/* ---------- Why us (pillars) ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.pillar { border-top: 1px solid var(--ink); padding-top: 26px; }
.pillar h3 { margin-bottom: 14px; font-size: 1.5rem; }
.pillar p { color: var(--text-2); }
@media (max-width: 900px) {
  .pillars { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- Services (tiles) ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.tile {
  background: var(--paper);
  padding: 36px 32px 40px;
  display: flex;
  flex-direction: column;
}
.tile h3 { font-size: 1.4rem; }
.tile .tag { margin: 12px 0 16px; }
.tile p:last-child { color: var(--text-2); font-size: 0.97rem; }
@media (max-width: 960px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tiles { grid-template-columns: 1fr; } .tile { padding: 28px 24px 32px; } }

.note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
}
.note::before { content: ""; width: 8px; height: 8px; background: var(--green); flex: none; }

/* ---------- Industries ---------- */
.industries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.industry { padding: 4px 40px 4px 0; }
.industry + .industry { border-left: 1px solid var(--line); padding-left: 40px; }
.industry:last-child { padding-right: 0; }
.industry h3 { font-size: 1.65rem; margin: 14px 0 30px; }
.industry-sub {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}
.problems { list-style: none; padding: 0; }
.problems li {
  position: relative;
  padding: 16px 0 16px 24px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.97rem;
}
.problems li:last-child { border-bottom: 1px solid var(--line); }
.problems li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 29px;
  width: 10px;
  height: 1px;
  background: var(--green);
}
@media (max-width: 900px) {
  .industries { grid-template-columns: 1fr; }
  .industry { padding: 0; }
  .industry + .industry { border-left: 0; padding: 0; margin-top: 56px; }
}

/* ---------- How we work (steps) ---------- */
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-dark);
}
.step { position: relative; padding: 44px 40px 8px 0; }
.step + .step { border-left: 1px solid var(--line-dark); padding-left: 40px; }
.step:last-child { padding-right: 0; }
.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 56px;
  height: 2px;
  background: var(--green-on-dark);
}
.step + .step::before { left: 40px; }
.step .num {
  display: block;
  font-family: var(--serif);
  font-size: 3rem;
  line-height: 1;
  color: var(--green-on-dark);
  margin-bottom: 26px;
}
.step h3 { font-size: 1.6rem; }
.step-meta {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin: 10px 0 16px;
}
.step p:last-child { color: rgba(255, 255, 255, 0.76); font-size: 0.97rem; }
@media (max-width: 800px) {
  .steps { grid-template-columns: 1fr; border-top: 0; }
  .step { padding: 36px 0 36px; border-top: 1px solid var(--line-dark); }
  .step + .step { border-left: 0; padding-left: 0; }
  .step + .step::before { left: 0; }
  .step:last-child { padding-bottom: 0; }
}

/* ---------- Team ---------- */
.team { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px; }
.member { border-top: 1px solid var(--ink); padding-top: 26px; }
.ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 24px;
}
.member h3 { font-size: 1.2rem; line-height: 1.3; margin-bottom: 12px; }
.member p { font-size: 0.92rem; color: var(--text-2); }
@media (max-width: 1100px) { .team { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .team { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; } }
@media (max-width: 480px) { .team { grid-template-columns: 1fr; } }

/* ---------- Clients (hidden) ---------- */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 32px;
  align-items: center;
}
.logo-grid img { max-height: 40px; margin: 0 auto; filter: grayscale(1); opacity: 0.7; }
section[hidden] { display: none !important; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 32px;
  align-items: stretch;
}
.form-panel { border: 1px solid var(--line); background: var(--paper); padding: 40px; }
.book-panel { background: var(--ink); color: #fff; padding: 40px; display: flex; flex-direction: column; }
.book-panel h3 { font-size: 1.75rem; margin: 18px 0 16px; }
.book-panel > p { color: rgba(255, 255, 255, 0.74); }
.book-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.book-list li { position: relative; padding-left: 22px; color: rgba(255, 255, 255, 0.82); font-size: 0.95rem; line-height: 1.55; }
.book-list li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 10px; height: 1px; background: var(--green-on-dark); }
.book-cta { margin-top: auto; padding-top: 36px; }
@media (max-width: 960px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .form-panel, .book-panel { padding: 28px 20px; }
}


/* Form */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.req { color: var(--green); }
.opt { color: var(--text-3); font-weight: 500; }
.field.is-invalid input, .field.is-invalid textarea, .field.is-invalid select { border-color: #B42318; }

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.8rem 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: #98A2B3; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(14, 107, 78, 0.14);
}
textarea { resize: vertical; min-height: 140px; }
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 18px;
}
.field-check { flex-direction: row; align-items: flex-start; gap: 12px; }
.field-check input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  padding: 0;
  flex: none;
  accent-color: var(--green);
}
.field-check label { font-weight: 500; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 28px; margin-top: 8px; }
.form-privacy { font-size: 0.8rem; color: var(--text-3); }
.form-privacy a { text-decoration: underline; text-underline-offset: 2px; }
.form-status {
  display: none;
  margin-top: 20px;
  padding: 14px 16px;
  border-left: 3px solid;
  font-weight: 500;
  font-size: 0.95rem;
}
.form-status.is-success { display: block; background: var(--green-100); color: #0A5740; border-color: var(--green); }
.form-status.is-error { display: block; background: #FEF3F2; color: #B42318; border-color: #B42318; }
@media (max-width: 560px) { .form-actions .btn { width: 100%; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.72);
  padding: 64px 0 32px;
  font-size: 0.9rem;
  border-top: 1px solid var(--line-dark);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line-dark);
}
.footer-brand p { margin-top: 22px; max-width: 46ch; line-height: 1.7; }
.footer-links { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.footer-links a { color: #fff; font-weight: 500; display: inline-flex; align-items: center; gap: 12px; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-links svg { width: 16px; height: 16px; color: var(--green-on-dark); flex: none; }
.footer-bottom { padding-top: 24px; color: rgba(255, 255, 255, 0.5); font-size: 0.82rem; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- Privacy page ---------- */
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(2.2rem, 4vw, 3rem); margin: 20px 0 10px; }
.prose .updated { color: var(--text-3); font-size: 0.9rem; margin-bottom: 40px; }
.prose h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.prose p, .prose li { color: var(--text-2); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 22px; margin-top: 10px; display: grid; gap: 8px; }
.prose a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: 0.9rem; }
.back-link svg { width: 16px; height: 16px; }
