/* ===========================================================================
   Diabeasy — public site
   ---------------------------------------------------------------------------
   The visitor is usually mid-search: "hba1c 8.4 meaning", "creatinine high
   in diabetes", or a daughter looking for something to help her father. They
   arrive anxious and they arrive on a phone.

   The organising idea is TRANSLATION. A lab report is a wall of codes and
   asterisks that means nothing to the person holding it. The whole site is
   built around showing that wall turning into a sentence — the .render block
   below is that motif, and it repeats down the page rather than being a
   one-off hero trick.

   Palette and type continue the portal (indigo / sage / ochre, Baloo 2 +
   Hind) so arriving at the product feels like the same place. The public
   site is allowed more air and bigger type; nothing else changes.
   =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Hind:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --indigo:      #2c3563;
  --indigo-deep: #1d2447;
  --indigo-soft: #eef0f7;
  --sage:        #4a7c59;
  --sage-bg:     #eaf2ec;
  --ochre:       #a86a1f;
  --ochre-bg:    #fbf2e4;
  --clay:        #a83e32;

  --bg:      #ffffff;
  --alt:     #f7f7fa;
  --line:    #e4e5ec;
  --text:    #22242e;
  --muted:   #61657a;
  --faint:   #9297a8;

  --r: 12px;
  --display: 'Baloo 2', system-ui, sans-serif;
  --ui:      'Hind', system-ui, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;
  --wrap:    1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--ui); font-size: 17px; line-height: 1.65;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(2rem, 5.5vw, 3.1rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; }

a { color: var(--indigo); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 720px; }
section { padding: 4rem 0; }
section.alt { background: var(--alt); }
.lede { font-size: 1.15rem; color: var(--muted); }

/* ------------------------------------------------------------------- nav */

.nav { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); z-index: 50; }
.nav .wrap { display: flex; align-items: center; gap: 1.5rem; height: 66px; }
.nav .logo { font-family: var(--display); font-weight: 800; font-size: 1.35rem; color: var(--indigo); text-decoration: none; display: inline-flex; align-items: center; }
.nav .logo img { display: block; height: 36px; width: auto; max-width: 100%; }
@media (max-width: 380px) { .nav .logo img { height: 30px; } }
.nav .links { display: flex; gap: 1.25rem; margin-left: auto; align-items: center; }
.nav .links a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav .links a:hover { color: var(--text); }
@media (max-width: 640px) { .nav .links a.hide-sm { display: none; } }

/* ----------------------------------------------------------------- button */

.btn {
  display: inline-block; font-family: var(--ui); font-weight: 600; font-size: 1rem;
  padding: .75rem 1.4rem; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer;
}
.btn:hover { background: var(--indigo-soft); }
.btn.primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn.primary:hover { background: var(--indigo-deep); }
.btn.wa { background: #1da851; border-color: #1da851; color: #fff; }
.btn.wa:hover { background: #178c43; }
.btn.lg { font-size: 1.08rem; padding: .9rem 1.7rem; }

/* ============================================== THE TRANSLATION MOTIF */

.render {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: stretch;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.render .side { padding: 1.25rem 1.4rem; }
.render .from { background: var(--alt); border-right: 1px solid var(--line); }
.render .arrow {
  display: grid; place-items: center; padding: 0 .25rem;
  color: var(--faint); font-size: 1.4rem; background: var(--alt); border-right: 1px solid var(--line);
}
.render .cap {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin-bottom: .5rem;
}
.render .from .row {
  font-family: var(--mono); font-size: .92rem; display: flex; gap: .5rem;
  justify-content: space-between; padding: .18rem 0; color: var(--muted);
}
.render .from .row b { color: var(--text); font-weight: 600; }
.render .from .row .h { color: var(--clay); font-weight: 600; }
.render .to p { margin: 0 0 .6rem; }
.render .to p:last-child { margin-bottom: 0; }
.render .to .big { font-family: var(--display); font-size: 1.2rem; font-weight: 600; line-height: 1.35; }
.render .to .ok { color: var(--sage); font-weight: 600; }
.render .to .watch { color: var(--ochre); font-weight: 600; }

@media (max-width: 720px) {
  .render { grid-template-columns: 1fr; }
  .render .from { border-right: 0; border-bottom: 1px solid var(--line); }
  .render .arrow { background: var(--alt); border-right: 0; border-bottom: 1px solid var(--line); padding: .35rem; transform: rotate(90deg); }
}

/* ------------------------------------------------------------------ hero */

.hero { padding: 4.5rem 0 3.5rem; background: linear-gradient(180deg, var(--indigo-soft) 0%, #fff 100%); }
.hero h1 { max-width: 16ch; }
.hero .lede { max-width: 46ch; font-size: 1.2rem; }
.hero .cta { display: flex; gap: .7rem; flex-wrap: wrap; margin: 1.75rem 0 .75rem; }
.hero .fine { font-size: .9rem; color: var(--muted); }
.hero .render { margin-top: 2.5rem; box-shadow: 0 10px 40px rgba(44,53,99,.09); }

/* ----------------------------------------------------------------- steps */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.5rem; margin-top: 2rem; counter-reset: s; }
.step { counter-increment: s; }
.step::before {
  content: counter(s); display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--indigo); color: #fff; font-family: var(--display); font-weight: 700;
  margin-bottom: .7rem;
}
.step h3 { margin-bottom: .25rem; }
.step p { color: var(--muted); margin: 0; }

/* ----------------------------------------------------------------- cards */

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem; }
.tile h3 { margin-bottom: .3rem; }
.tile p { color: var(--muted); margin: 0; }
.tile .icon { font-size: 1.5rem; margin-bottom: .5rem; }

.quote { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--sage); border-radius: var(--r); padding: 1.35rem; }
.quote p { font-size: 1.02rem; margin: 0 0 .8rem; }
.quote .who { font-size: .9rem; color: var(--muted); font-weight: 600; }
.quote .who span { font-weight: 400; color: var(--faint); }

/* ------------------------------------------------------------------- faq */

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; padding: 1.1rem 2rem 1.1rem 0; font-family: var(--display);
  font-weight: 600; font-size: 1.08rem; list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: .3rem; top: 1rem; color: var(--faint); font-size: 1.4rem; font-weight: 400; }
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--muted); padding-bottom: 1rem; margin: 0; }

/* --------------------------------------------------------------- closing */

.closer { background: var(--indigo); color: #fff; text-align: center; }
.closer h2 { color: #fff; }
.closer p { color: #c6cade; max-width: 46ch; margin-left: auto; margin-right: auto; }
.closer .btn { margin-top: 1.25rem; }

.trust { display: flex; gap: 2.5rem; flex-wrap: wrap; justify-content: center; margin-top: 2rem; }
.trust div { text-align: center; }
.trust .n { font-family: var(--mono); font-size: 1.9rem; font-weight: 600; color: var(--indigo); }
.trust .k { font-size: .85rem; color: var(--muted); }

/* ------------------------------------------------------------------ blog */

.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.post-card { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.post-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: var(--alt); }
.post-card .b { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; }
.post-card h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h3 a:hover { color: var(--indigo); }
.post-card p { color: var(--muted); font-size: .95rem; margin: 0 0 .8rem; }
.post-card .meta { margin-top: auto; font-size: .82rem; color: var(--faint); }

.article { max-width: 680px; margin: 0 auto; }
.article header { margin-bottom: 2rem; }
.article h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
.article .byline { font-size: .9rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.article .byline .rev { color: var(--sage); font-weight: 600; }
.article .content { font-size: 1.08rem; }
.article .content h2 { margin: 2.25rem 0 .6rem; }
.article .content h3 { margin: 1.75rem 0 .4rem; }
.article .content ul, .article .content ol { padding-left: 1.3rem; }
.article .content li { margin-bottom: .4rem; }
.article .content img { max-width: 100%; border-radius: var(--r); }
.article .content blockquote { border-left: 3px solid var(--sage); margin: 1.5rem 0; padding: .2rem 0 .2rem 1.1rem; color: var(--muted); }

/* Answer-first block. Search engines and anxious readers want the same
   thing: the answer before the essay. */
.takeaways { background: var(--sage-bg); border-radius: var(--r); padding: 1.2rem 1.4rem; margin: 0 0 2rem; }
.takeaways h2 { font-size: 1rem; color: var(--sage); margin-bottom: .5rem; }
.takeaways ul { margin: 0; padding-left: 1.2rem; }
.takeaways li { margin-bottom: .35rem; }

.inline-cta { background: var(--indigo-soft); border-radius: var(--r); padding: 1.4rem; margin: 2.5rem 0; text-align: center; }
.inline-cta h3 { margin-bottom: .3rem; }
.inline-cta p { color: var(--muted); margin-bottom: 1rem; }

.medical-note { font-size: .88rem; color: var(--muted); background: var(--alt); border-radius: var(--r); padding: 1rem 1.15rem; margin-top: 2.5rem; }

/* ---------------------------------------------------------------- footer */

.foot { background: var(--indigo-deep); color: #c6cade; padding: 3rem 0 2rem; font-size: .93rem; }
.foot a { color: #c6cade; text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }
.foot .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; }
.foot .foot-logo { display: block; height: 33px; width: auto; margin-bottom: .85rem; }
.foot h4 { font-family: var(--display); color: #fff; font-size: 1rem; margin-bottom: .6rem; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: .35rem; }
.foot .base { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1.25rem; color: #8f97b5; font-size: .85rem; }
