/* =========================================================================
   Nes Digital — "Ink and Ivory"
   One stylesheet for the whole site. Rules live in design-system/DESIGN-SYSTEM.md.
   Jost only. Square corners. 1px rules. No shadows, no gradients.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --ink: #141414;
  --ink-raised: #1D1B19;
  --ivory: #F6F2EA;
  --sand: #EFE9DF;
  --white: #FFFFFF;

  --copper: #9A5530;
  --copper-hover-dark: #B0663C; /* not used: white text on it is 4.36:1, so buttons hover to --copper-deep on dark too */
  --copper-pressed: #7E4425;
  --copper-deep: #8A4522;
  --copper-soft: #C98A62;

  --text-body: #3D3731;
  --text-muted: #5E554C;
  --text-on-dark: #EFE9DF;
  --text-on-dark-2: #CFC7BB;
  --text-on-dark-muted: #A89E92;

  --rule-light: #CFC6B8;
  --rule-dark: #3A332D;
  --field-border: #A89E92;

  --error: #A3322A;
  --error-on-dark: #E8958C;
  --error-bg: #FBEDEB;
  --success: #2F6B47;
  --success-bg: #EEF5F0;

  --font: 'Jost', system-ui, sans-serif;

  /* 8-point scale */
  --s-4: 4px; --s-8: 8px; --s-12: 12px; --s-16: 16px; --s-24: 24px;
  --s-32: 32px; --s-48: 48px; --s-64: 64px; --s-96: 96px; --s-128: 128px;

  --max: 1200px;
  --gutter: 6%;
  --pad-light: 96px;
  --pad-dark: 112px;

  --fade: 200ms ease;

  /* Context colours (light by default; .dark overrides) */
  --focus: var(--ink);
  --link: var(--copper-deep);
  --link-hover: var(--ink);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  color: var(--ink);
  background: var(--ivory);
}

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

h1, h2, h3 { font-weight: 500; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

a { color: var(--link); transition: color var(--fade), background-color var(--fade), border-color var(--fade); }
a:hover { color: var(--link-hover); }

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

.dark {
  background: var(--ink);
  color: var(--text-on-dark);
  --focus: var(--copper-soft);
  --link: var(--text-on-dark);
  --link-hover: var(--copper-soft);
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--ivory); color: var(--ink); padding: 12px 18px;
}
.skip-link:focus { top: 16px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; }

.section { padding: var(--pad-light) var(--gutter); }
.section--sand { background: var(--sand); }
.section--tight { padding-top: 72px; padding-bottom: 72px; }
.section--dark { padding-top: var(--s-96); padding-bottom: var(--s-96); }
.rule-top { border-top: 1px solid var(--ink); }
.rule-bottom { border-bottom: 1px solid var(--ink); }

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 56px;
}
.split--wide-gap { gap: 64px; }
.split--start { align-items: start; }

/* ---------- Type ---------- */
.label {
  font-size: 13px; letter-spacing: 3px; font-weight: 500; text-transform: uppercase;
  color: var(--copper-deep); margin-bottom: 14px;
}
.dark .label { color: var(--copper-soft); }

.sublabel {
  font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: var(--s-8);
}
.dark .sublabel { color: var(--text-on-dark-muted); }

.display { font-size: clamp(44px, 6vw, 80px); line-height: 1.05; max-width: 940px; margin-bottom: var(--s-32); }
.h1 { font-size: clamp(38px, 5vw, 64px); line-height: 1.08; max-width: 900px; margin-bottom: var(--s-24); }
.h2 { font-size: 40px; line-height: 1.15; margin-bottom: 20px; }
.h2--sm { font-size: 36px; line-height: 1.15; margin-bottom: 20px; }
.h2--xs { font-size: 32px; line-height: 1.2; margin-bottom: var(--s-12); }
.h3 { font-size: 24px; line-height: 1.33; }

.lead { font-size: 20px; line-height: 1.6; max-width: 680px; }
.dark .lead { color: var(--text-on-dark-2); }

.body-text { color: var(--text-body); }
.dark .body-text { color: var(--text-on-dark-2); }
.muted { color: var(--text-muted); }
.small { font-size: 14px; line-height: 1.5; }
.note { margin-top: var(--s-24); font-size: 14px; color: var(--text-muted); }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-block;
  font: inherit; font-weight: 500; line-height: 1.4;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 0;
  transition: color var(--fade), background-color var(--fade), border-color var(--fade);
}

.btn-primary { background: var(--copper); color: var(--white); padding: 18px 32px; }
.btn-primary:hover { background: var(--copper-deep); color: var(--white); }
.btn-primary:active, .dark .btn-primary:active { background: var(--copper-pressed); }
.btn-sm { padding: 12px 22px; }

.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); padding: 14px 26px; }
.btn-secondary:hover { background: var(--ink); color: var(--ivory); }
.dark .btn-secondary { color: var(--text-on-dark); border-color: var(--copper-soft); }
.dark .btn-secondary:hover { background: var(--text-on-dark); border-color: var(--text-on-dark); color: var(--ink); }

/* Text link on dark: cream text, copper underline */
.text-link-dark {
  color: var(--text-on-dark); text-decoration: none;
  border-bottom: 1px solid var(--copper-soft); padding-bottom: 4px;
}
.text-link-dark:hover { color: var(--copper-soft); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }

/* ---------- Header and navigation ---------- */
.site-header { border-bottom: 1px solid var(--rule-dark); padding: 14px var(--gutter); }

.header-inner { display: flex; align-items: center; gap: 16px 32px; }

.brand { display: flex; align-items: center; margin-right: auto; }
.brand img { height: 68px; width: auto; }

.nav-list { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; }
.nav-list a {
  color: var(--text-on-dark); text-decoration: none;
  font-size: 15px; letter-spacing: 1px; padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}
.nav-list a:hover { color: var(--copper-soft); }
.nav-list a[aria-current="page"] { border-bottom-color: var(--copper-soft); }

.menu-toggle {
  display: none;
  font: inherit; font-size: 15px; letter-spacing: 1px;
  color: var(--text-on-dark); background: transparent;
  border: 1px solid var(--copper-soft); border-radius: 0;
  padding: 10px 18px; cursor: pointer;
}
.menu-toggle:hover { background: var(--text-on-dark); color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 96px var(--gutter) 88px; }
.hero--home { padding: 120px var(--gutter) 104px; }
.hero .lead + .actions { margin-top: var(--s-48); }
.hero .lead + .hero-cta { margin-top: 40px; }

/* Experience strip under the home hero */
.strip { border-top: 1px solid var(--rule-dark); padding: 40px var(--gutter); }
.strip-groups { display: flex; flex-wrap: wrap; gap: 24px 64px; }
.strip .sublabel { font-size: 12px; }
.strip-heading { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-on-dark-muted); margin-bottom: var(--s-16); }
.strip-text { font-size: 19px; }
.strip-more { border-top: 1px solid var(--rule-dark); margin-top: var(--s-32); padding-top: var(--s-24); }

/* ---------- Home: service rows ---------- */
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--ink); padding-bottom: 16px; margin-bottom: var(--s-8);
}
.section-head .h2 { margin: 0; }

.service-rows {
  list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); column-gap: 56px;
}
.service-row { display: flex; gap: 20px; padding: 28px 0; border-bottom: 1px solid var(--rule-light); }
.num { color: var(--copper-deep); font-size: 18px; line-height: 1.6; }
.dark .num { color: var(--copper-soft); }
.service-row .h3 { margin-bottom: 6px; }

/* ---------- Promise band ---------- */
.promise-text { font-weight: 500; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.2; max-width: 980px; }

/* ---------- Lists with rules ---------- */
.rule-list { list-style: none; }
.rule-list li { padding: 20px 0; border-top: 1px solid var(--rule-light); }
.rule-list li:first-child { border-top-color: var(--ink); }
.rule-list li:last-child { border-bottom: 1px solid var(--ink); }

.numbered-list { list-style: none; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.numbered-list li { display: flex; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--rule-light); }
.numbered-list li:last-child { border-bottom: 0; }
.numbered-list .num { font-size: inherit; line-height: inherit; }

.list-heading { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); padding-bottom: 12px; }

.tick-list { list-style: none; border-top: 1px solid var(--ink); }
.tick-list li { padding: 10px 0; border-bottom: 1px solid var(--rule-light); }

/* ---------- Founder ---------- */
.founder { display: flex; flex-wrap: wrap; gap: 64px; align-items: center; }
.founder-photo { flex: 0 1 380px; width: 380px; border: 1px solid var(--ink); }
.founder-photo--about { flex-basis: 360px; width: 360px; }
.founder-body { flex: 1 1 420px; }
.founder-intro { font-size: 18px; margin-bottom: 28px; }
.founder-name { font-size: clamp(34px, 4vw, 52px); line-height: 1.1; margin-bottom: 12px; }
.founder-role { font-size: 20px; color: var(--copper-deep); margin-bottom: var(--s-24); }
.founder-bio { font-size: 19px; color: var(--text-body); margin-bottom: var(--s-32); }

/* ---------- Certification chips ---------- */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { border: 1px solid var(--ink); padding: 8px 14px; font-size: 14px; line-height: 1.5; }
.founder .chips { margin-bottom: 28px; }

/* ---------- Closing CTA band ---------- */
.cta-band { padding: var(--pad-dark) var(--gutter); }
.cta-inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 40px; }
.cta-copy { max-width: 640px; }
.cta-copy h2 { font-size: 48px; line-height: 1.1; margin-bottom: 20px; }
.cta-copy p { color: var(--text-on-dark-2); }
.cta-band .actions { gap: 24px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule-dark);
  padding: 64px var(--gutter) 40px;
  color: var(--text-on-dark-muted);
  font-size: 14px; line-height: 1.6;
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; }
.footer-brand { flex: 1 1 280px; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.footer-brand img { height: 84px; width: auto; align-self: flex-start; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col--pages { flex: 0 1 180px; }
.footer-col--contact { flex: 0 1 300px; }
.footer-heading { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-on-dark); margin-bottom: 4px; }
.footer-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: var(--text-on-dark-muted); }
.site-footer a:hover { color: var(--copper-soft); }
.site-footer a.footer-email { color: var(--copper-soft); }
.site-footer a.footer-email:hover { color: var(--text-on-dark); }
.footer-social { display: flex; gap: 16px; margin-top: 6px; }
.footer-base {
  flex-basis: 100%;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--rule-dark); padding-top: 20px;
}

/* ---------- Services page ---------- */
.service-detail {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 48px;
}
.service-detail .num { margin-bottom: var(--s-8); }
.service-detail .h2 { font-size: 36px; margin-bottom: 16px; }
.service-summary { font-size: 19px; }

/* ---------- For agencies ---------- */
.cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.card { background: var(--white); border: 1px solid var(--rule-light); padding: 28px; }
.card h3 { font-size: 22px; line-height: 1.3; margin-bottom: var(--s-8); }

.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 40px; }
.step { border-top: 1px solid var(--copper-soft); padding-top: 20px; }
.step-label { color: var(--copper-soft); font-size: 14px; letter-spacing: 2px; text-transform: uppercase; }
.step h3 { font-size: 26px; line-height: 1.3; margin: var(--s-8) 0; }
.values .step h3 { font-size: 24px; margin: 0 0 var(--s-8); }
.steps-heading { margin-bottom: 40px; }

/* ---------- Sample work ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; margin-bottom: 40px; }
.fact { background: var(--white); border: 1px solid var(--rule-light); padding: var(--s-24); }

.table-wrap { overflow-x: auto; }
.plan-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 16px; }
.plan-table caption {
  text-align: left; font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-muted); padding-bottom: 10px;
}
.plan-table thead tr { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.plan-table th { text-align: left; font-weight: 500; padding: 12px; }
.plan-table td { padding: 14px 12px; vertical-align: top; }
.plan-table tbody tr { border-bottom: 1px solid var(--rule-light); }
.plan-table th:first-child, .plan-table td:first-child { padding-left: 0; }
.plan-table th:last-child, .plan-table td:last-child { padding-right: 0; }
.plan-table td:first-child { font-weight: 500; }

.posts { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: var(--s-24); }
.post { margin: 0; background: var(--white); border: 1px solid var(--rule-light); height: 100%; }
.post img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.post figcaption { padding: 16px 20px; font-size: 15px; color: var(--text-body); }

/* ---------- About ---------- */
.story p + p { margin-top: 16px; }

.timeline { border-top: 1px solid var(--ink); list-style: none; }
.timeline-item {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 8px 32px;
  padding: var(--s-24) 0; border-bottom: 1px solid var(--rule-light);
}
.timeline-years { color: var(--copper-deep); }
.timeline-item h3 { font-size: 21px; line-height: 1.35; }
.timeline-place { color: var(--text-muted); font-size: 15px; }

.industries { display: flex; flex-direction: column; gap: 16px; }
.industries .sublabel { margin-bottom: 0; }
.h2--spaced { margin-top: var(--s-48); }

/* ---------- Contact ---------- */
.contact-details { margin-top: var(--s-48); border-top: 1px solid var(--ink); padding-top: var(--s-24); display: flex; flex-direction: column; gap: 10px; }
.contact-details dt { color: var(--text-muted); }
.contact-details dd { margin: 0; }
.contact-details div + div { margin-top: 0; }

.form { background: var(--white); border: 1px solid var(--rule-light); padding: 40px; display: flex; flex-direction: column; gap: 20px; }
.form .label { margin-bottom: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink);
  background: var(--white); border: 1px solid var(--field-border); border-radius: 0;
  padding: 12px 14px; width: 100%;
  transition: border-color var(--fade);
}
.field textarea { resize: vertical; min-height: 140px; }
.field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23141414' stroke-width='1.5'/%3E%3C/svg%3E");
  background-position: right 16px center;
  background-size: 12px 8px; background-repeat: no-repeat;
  padding-right: 40px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ink); outline: 2px solid var(--copper-soft); outline-offset: 0;
}
.field [aria-invalid="true"] { border: 2px solid var(--error); padding: 11px 13px; }
.field select[aria-invalid="true"] { padding-right: 39px; }
.field-error { font-size: 13px; color: var(--error); }
.field-error:empty { display: none; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--copper); }
.check input[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 2px; }

.form-message { padding: 14px 18px; font-size: 15px; border: 1px solid; }
.form-message[hidden] { display: none; }
.form-message--success { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.form-message--error { border-color: var(--error); background: var(--error-bg); color: var(--error); }

.form .btn-primary { align-self: flex-start; padding: 16px 30px; }

/* ---------- Privacy policy ---------- */
.policy { max-width: 1100px; border-top: 1px solid var(--ink); }
.policy-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px 48px;
  padding: 28px 0; border-bottom: 1px solid var(--rule-light);
}
.policy-row h2 { font-size: 24px; line-height: 1.33; }
.policy-row p { color: var(--text-body); }
.section--policy { padding-top: 72px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .js .menu-toggle { display: inline-block; order: 3; }
  .header-inner { flex-wrap: wrap; gap: 16px; }
  .header-book { order: 2; }
  .main-nav { order: 4; flex-basis: 100%; }
  .js .main-nav { display: none; }
  .js .main-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid var(--rule-dark); }
  .nav-list li { border-bottom: 1px solid var(--rule-dark); }
  .nav-list a { display: block; padding: 16px 0; font-size: 17px; border-bottom: 0; }
  .nav-list a[aria-current="page"] { color: var(--copper-soft); }
}

@media (max-width: 760px) {
  :root { --gutter: 24px; --pad-light: 64px; --pad-dark: 64px; }
  .section--tight, .section--dark, .hero, .hero--home { padding-top: 64px; padding-bottom: 64px; }
  .h2, .h2--sm, .service-detail .h2, .cta-copy h2 { font-size: 30px; line-height: 1.2; }
  .h2--xs { font-size: 28px; }
  .h3 { font-size: 22px; line-height: 1.35; }
  .lead { font-size: 18px; }
  .label { font-size: 12px; }
  .brand img { height: 52px; }
  .btn-sm { padding: 10px 16px; }
  .header-book { margin-left: auto; }
  .brand { margin-right: 0; }
  .founder { gap: 40px; }
  .founder-photo, .founder-photo--about { flex-basis: 100%; width: 100%; max-width: 380px; }
  .form { padding: 24px; }
  .policy-row { grid-template-columns: 1fr; }
  .strip-text { font-size: 17px; }
}

@media (max-width: 380px) {
  .btn-sm { padding: 10px 12px; font-size: 15px; }
  .menu-toggle { padding: 9px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Small spacing helpers ---------- */
.mb-16 { margin-bottom: 16px; }
.mb-28 { margin-bottom: 28px; }
.mb-32 { margin-bottom: 32px; }
.measure { max-width: 760px; }
