:root {
  --bg: #F3F2EE;
  --panel: #FFFEFB;
  --ink: #1A1A1A;
  --muted: #4E5656;
  --pine: #1F4F52;
  --pine-d: #14373A;
  --mint: #DBE8E8;
  --mint-2: #EDF4F4;
  --saffron: #EE9A62;
  --saffron-d: #B4521F;
  --line: #E1DED6;
  --on-pine: #FFFEFB;
  --radius: 18px;
  --head: "Funnel Display", "Segoe UI", sans-serif;
  --body: "Funnel Sans", "Segoe UI", sans-serif;
}

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

html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}

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

h1,
h2,
h3 {
  font-family: var(--head);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

a {
  color: var(--pine);
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--pine);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.pill-line {
  min-height: 38px;
  padding: 0 18px;
  font-size: .92rem;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.pill-line:hover {
  background: var(--ink);
  color: var(--panel);
}

.pill-solid {
  min-height: 54px;
  padding: 0 34px;
  background: var(--ink);
  color: var(--panel);
  font-size: 1.05rem;
}

.pill-solid:hover {
  background: var(--pine-d);
}

.pill:focus-visible {
  outline: 3px solid var(--pine);
  outline-offset: 3px;
  border-radius: 999px;
}

/* Header: logo left, small centred links, outlined pill right */
.top {
  position: static;
  background: var(--panel);
}

.top-in {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
}

.brand {
  justify-self: start;
}

.brand img {
  height: 34px;
  width: auto;
}

.top-nav {
  display: flex;
  gap: 30px;
}

.top-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
}

.top-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.top-in > .pill {
  justify-self: end;
}

/* Footer */
.foot {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

.foot-in {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px 48px;
  padding: 48px 28px 28px;
}

.foot-brand img {
  height: 28px;
  width: auto;
}

.foot-brand p {
  margin: 14px 0 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: .92rem;
}

.foot-nav {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 10px 36px;
  align-content: start;
}

.foot-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: .92rem;
}

.foot-nav a:hover {
  color: var(--pine);
  text-decoration: underline;
}

.copy {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px 36px;
  font-size: .85rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .top-in {
    grid-template-columns: 1fr auto;
    padding: 12px 16px;
  }

  .top-nav {
    display: none;
  }

  .brand img {
    height: auto;
    width: min(170px, 46vw);
  }

  .foot-in {
    padding: 40px 16px 24px;
  }

  .foot-nav {
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
  }

  .copy {
    padding: 0 16px 28px;
  }
}

/* Page hero */
.phero {
  border-bottom: 1px solid var(--line);
}

.phero-in {
  max-width: 860px;
  margin: 0 auto;
  padding: 72px 16px 48px;
}

.phero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 20ch;
}

.phero p {
  margin: 16px 0 0;
  font-size: 1.1rem;
  max-width: 56ch;
  color: var(--muted);
}

.phero .upd {
  font-size: .9rem;
}

/* Body */
.pwrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 16px 60px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.pwrap-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 860px;
}

.toc {
  position: sticky;
  top: 20px;
  padding: 22px;
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid var(--line);
}

.toc-t {
  margin: 0 0 10px;
  font-family: var(--head);
  font-weight: 700;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.toc a {
  color: var(--ink);
  text-decoration: none;
}

.toc a:hover {
  color: var(--pine);
  text-decoration: underline;
}

.pbody {
  padding: 40px 44px;
  background: var(--panel);
  border-radius: var(--radius);
  max-width: 100%;
}

.pbody section + section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.pbody section {
  scroll-margin-top: 20px;
}

.pbody h2 {
  font-size: 1.5rem;
  color: var(--pine-d);
  margin-bottom: 10px;
}

.pbody p,
.pbody li {
  max-width: 68ch;
}

.pbody p {
  margin: 0 0 12px;
}

.pbody ul {
  padding-left: 22px;
  margin: 0;
}

.pbody li + li {
  margin-top: 8px;
}

.mailcard {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 26px;
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid var(--line);
}

.mailcard-ic {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--mint);
  color: var(--pine);
}

.mailcard-ic svg {
  width: 24px;
  height: 24px;
}

.mailcard-t {
  margin: 0;
  font-size: .9rem;
  color: var(--muted);
}

.mailcard a {
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.2rem;
  word-break: break-all;
}


/* ---------- Contact form ---------- */
.cform {
  --cf-accent: var(--pine);
  --cf-on: var(--on-pine);
  padding: 0;
  margin: clamp(40px, 6vw, 72px) 0;
}

.cform-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-top: 4px solid var(--cf-accent);
  border-radius: 18px;
  background: color-mix(in srgb, currentColor 4%, transparent);
}

.cform-inner h2 {
  margin: 0 0 8px;
}

.cform-intro {
  margin: 0 0 24px;
  opacity: 0.85;
}

.cform-form {
  display: grid;
  gap: 18px;
}

.cform-row {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.cform-row label {
  font-weight: 600;
  font-size: 0.95rem;
}

.cform input[type="text"],
.cform input[type="email"],
.cform select,
.cform textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: color-mix(in srgb, currentColor 6%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: 10px;
}

.cform textarea {
  resize: vertical;
  min-height: 150px;
}

.cform option {
  color: #111111;
  background: #FFFFFF;
}

.cform input:focus,
.cform select:focus,
.cform textarea:focus,
.cform-btn:focus-visible {
  outline: 3px solid var(--cf-accent);
  outline-offset: 2px;
}

.cform-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.95rem;
}

.cform-consent input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--cf-accent);
}

.cform-consent a {
  color: inherit;
  text-decoration: underline;
}

.cform-btn {
  justify-self: start;
  min-height: 50px;
  padding: 0 28px;
  font: inherit;
  font-weight: 700;
  color: var(--cf-on);
  background: var(--cf-accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.cform-btn:hover {
  filter: brightness(1.08);
}

.cform-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cform-status {
  display: none;
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 600;
}

.cform-status:target {
  display: block;
}

.cform-ok {
  background: color-mix(in srgb, var(--cf-accent) 18%, transparent);
  border: 1px solid var(--cf-accent);
}

.cform-err {
  background: color-mix(in srgb, #C0392B 14%, transparent);
  border: 1px solid #C0392B;
}

@media (min-width: 720px) {
  .cform-form {
    grid-template-columns: 1fr 1fr;
  }

  .cform-wide,
  .cform-btn {
    grid-column: 1 / -1;
  }
}

.cform-inner {
  background: var(--panel);
}

.pbody {
  padding: 0;
  background: none;
  border-radius: 0;
}

.pbody h2 {
  color: var(--ink);
}

@media (max-width: 900px) {
  .pwrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .phero-in {
    padding: 48px 16px 36px;
  }

  .pwrap {
    padding: 32px 16px 44px;
  }
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Header: on phones only the Blog link stays visible next to the pill */
@media (max-width: 760px) {
  .top-in {
    grid-template-columns: 1fr auto auto;
    gap: 14px;
  }

  .top-nav {
    display: flex;
  }

  .top-nav a:not(.nav-blog) {
    display: none;
  }
}
