/* Pingloom — design system (TZ.md §2) */
:root {
  --bg: #FFFFFF;
  --bg-alt: #F6F8FA;
  --text: #0B1220;
  --text-2: #4B5563;
  --accent: #0E7C7B;
  --accent-hover: #0B6463;
  --accent-soft: #E6F4F3;
  --border: #E5E7EB;
  --success: #15803D;
  --error: #B91C1C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --radius-card: 16px;
  --radius-btn: 12px;
  --max: 1040px;
  --block: 64px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (min-width: 768px) { :root { --block: 96px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.has-sticky { padding-bottom: 72px; }
@media (min-width: 768px) { body.has-sticky { padding-bottom: 0; } }

img, svg, iframe { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding-left: 1.25em; }
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 32px; line-height: 38px; }
h2 { font-size: 28px; line-height: 1.25; }
h3 { font-size: 20px; line-height: 1.3; }
@media (min-width: 768px) { h1 { font-size: 44px; line-height: 52px; } }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

.block { padding: var(--block) 0; }
.block--alt { background: var(--bg-alt); }
.block > .container > h2 { margin-bottom: 12px; }
.block__intro { color: var(--text-2); margin-bottom: 40px; max-width: 640px; }
.muted { color: var(--text-2); }
.small { font-size: 15px; line-height: 1.5; }
section[id] { scroll-margin-top: 24px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.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;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px;
  font: inherit; font-size: 16px; font-weight: 600; line-height: 1;
  border-radius: var(--radius-btn); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--secondary { background: #fff; color: var(--text); border-color: var(--text); }
.btn--secondary:hover { background: var(--bg-alt); color: var(--text); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }

/* Cards */
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 24px; box-shadow: var(--shadow);
}

/* Badge */
.badge {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-hover);
  font-size: 14px; font-weight: 500; line-height: 1.3;
}

/* Wordmark */
.wordmark { font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.wordmark:hover { color: var(--text); text-decoration: none; }

/* Block 0 — Top bar */
.topbar { padding: 18px 0; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar__nav { display: none; align-items: center; gap: 28px; }
.topbar__nav a:not(.btn) { color: var(--text-2); font-weight: 500; }
.topbar__nav a:not(.btn):hover { color: var(--text); text-decoration: none; }
.topbar__mobile-cta { display: inline-flex; }
@media (min-width: 768px) { .topbar__nav { display: flex; } .topbar__mobile-cta { display: none; } }

/* Block 1 — Hero */
.hero { padding: 24px 0 var(--block); }
.hero .container { display: grid; gap: 40px; align-items: center; }
.hero__text { max-width: 640px; }
.hero__text .badge { margin-bottom: 20px; }
.hero h1 {
  text-decoration: underline; text-decoration-color: transparent;
  text-decoration-thickness: 2px; text-underline-offset: 8px;
  transition: text-decoration-color .3s;
}
.hero h1:hover { text-decoration-color: var(--accent); }
.hero__sub { margin: 20px 0 28px; font-size: 18px; color: var(--text-2); }
.hero__cta { display: flex; flex-direction: column; gap: 12px; }
.hero__note { margin-top: 16px; }
.hero__media figcaption { margin-top: 12px; }
@media (min-width: 768px) {
  .hero { padding-top: 48px; }
  .hero .container { grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 56px; }
  .hero__cta { flex-direction: row; flex-wrap: wrap; }
}

/* Loom tiles */
.loom { margin: 0; }
.loom__frame {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: var(--radius-card); overflow: hidden;
  background: var(--accent-soft); border: 1px solid var(--border);
}
.loom__btn {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; font: inherit;
}
.loom__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.loom__play {
  position: relative; z-index: 1;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  transition: background-color .15s, transform .15s;
}
.loom__btn:hover .loom__play { background: var(--accent-hover); transform: scale(1.04); }
.loom__play svg { width: 24px; height: 24px; margin-left: 3px; }
.loom__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.loom__frame.is-pending .loom__btn { cursor: default; }
.loom figcaption { margin-top: 12px; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.loom h3 { font-size: 17px; margin-bottom: 12px; }

/* Block 2 — Who it's for */
.segments { display: grid; gap: 24px; }
.segments .card h3 { margin-bottom: 12px; }
.segments .card ul { margin: 16px 0 20px; display: grid; gap: 6px; }
.segments .card .link { font-weight: 500; }
@media (min-width: 768px) { .segments { grid-template-columns: 1fr 1fr; } }

/* Block 3 — Demos */
.demos { display: grid; gap: 32px; }
@media (min-width: 768px) { .demos { grid-template-columns: repeat(3, 1fr); gap: 24px; } }

/* Block 4 — How it works: the thread */
.steps { position: relative; display: grid; gap: 40px; margin-top: 40px; }
.step { position: relative; padding-left: 56px; }
.step__dot {
  position: absolute; left: 0; top: 0;
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; border: 1px solid var(--accent); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px; z-index: 1;
}
.step:not(:last-child)::after {
  content: ""; position: absolute; left: 20px; top: 40px; bottom: -40px; width: 1px; background: var(--accent);
}
.step h3 { margin-bottom: 8px; font-size: 18px; }
.step p { color: var(--text-2); }
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .step { padding-left: 0; padding-top: 60px; }
  .step:not(:last-child)::after { display: none; }
  .steps::before {
    content: ""; position: absolute; top: 20px; left: 20px;
    right: calc((100% - 64px) / 3 - 20px); height: 1px; background: var(--accent);
  }
}

/* Block 5 — Pricing */
.pricing { display: grid; gap: 24px; }
.price-card { display: flex; flex-direction: column; position: relative; }
.price-card__badge { position: absolute; top: -14px; left: 24px; }
.price-card h3 { margin-bottom: 4px; }
.price-card__price { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 16px; }
.price-card__price small { font-size: 16px; font-weight: 500; color: var(--text-2); }
.price-card__body { color: var(--text-2); flex: 1; }
.price-card__note { margin: 16px 0 20px; font-size: 15px; }
.pricing-addons { margin-top: 32px; color: var(--text-2); }
@media (min-width: 768px) { .pricing { grid-template-columns: repeat(3, 1fr); } }

/* Block 6 — About */
.about { display: grid; gap: 28px; align-items: start; }
.about__portrait {
  width: 160px; height: 160px; border-radius: var(--radius-card);
  object-fit: cover; border: 1px solid var(--border); background: var(--accent-soft);
}
.about__links { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.about__links .sep { color: var(--text-2); }
@media (min-width: 768px) {
  .about { grid-template-columns: 200px 1fr; gap: 40px; }
  .about__portrait { width: 200px; height: 200px; }
}

/* Block 7 — Case study (hidden until ready) */
.case .card { display: grid; gap: 24px; }
.case__cols { display: grid; gap: 24px; }
.case__cols h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin-bottom: 10px; }
.case__nums { display: grid; gap: 16px; border-top: 1px solid var(--border); padding-top: 24px; }
.case__num strong { display: block; font-size: 28px; font-weight: 600; }
.case__num span { color: var(--text-2); font-size: 15px; }
@media (min-width: 768px) { .case__cols, .case__nums { grid-template-columns: repeat(2, 1fr); } .case__nums { grid-template-columns: repeat(3, 1fr); } }

/* Block 8 — Contact */
.contact { display: grid; gap: 32px; align-items: start; }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 500; font-size: 15px; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; color: var(--text);
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-btn); background: #fff;
}
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%234B5563' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.field--check { grid-template-columns: auto 1fr; align-items: start; gap: 10px; }
.field--check input { width: 20px; height: 20px; min-height: 0; margin: 3px 0 0; padding: 0; accent-color: var(--accent); }
.field--check label { font-weight: 400; font-size: 16px; }
.form__error { color: var(--error); font-size: 15px; }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form__success h3 { color: var(--success); margin-bottom: 8px; }
.turnstile:empty { display: none; }
.talk h3 { margin-bottom: 6px; }
.talk .muted { margin-bottom: 20px; }
.calendly-inline-widget { min-width: 280px; height: 700px; border-radius: var(--radius-card); overflow: hidden; }
@media (min-width: 768px) {
  .contact { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; }
}

/* Block 9 — FAQ */
.faq { display: grid; gap: 0; border-top: 1px solid var(--border); margin-top: 24px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
  font-weight: 600; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px;
  border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 0 20px; color: var(--text-2); max-width: 760px; }

/* Block 10 — Footer */
.footer { padding: 40px 0 48px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 15px; }
.footer .container { display: grid; gap: 12px; }
.footer .wordmark { font-size: 18px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.footer__links .sep { color: var(--border); }

/* Mobile sticky CTA */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); border-top: 1px solid var(--border);
  backdrop-filter: blur(6px);
  transform: translateY(100%); transition: transform .25s;
}
.sticky-cta.is-visible { transform: translateY(0); }
@media (min-width: 768px) { .sticky-cta { display: none; } }

/* Simple pages (404, privacy) */
.page { padding: 48px 0 var(--block); max-width: 720px; }
.page h1 { margin-bottom: 16px; }
.page h2 { font-size: 20px; margin: 32px 0 8px; }
.page p, .page li { color: var(--text-2); }

/* Links inside running text must not rely on colour alone (WCAG 1.4.1) */
.footer a:not(.wordmark), .segments .link, .about__links a, .page a, .form__error a, .faq a {
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(14, 124, 123, .45);
}
.footer a:not(.wordmark):hover, .segments .link:hover, .about__links a:hover, .page a:hover { text-decoration-color: currentColor; }
