/* MediMate web — same pill-box language as the app (AppColors.swift, AppTypography.swift). */

/* Fallback for devices without SF Pro Rounded. Only fetched when ui-rounded is missing. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  --ground: #FBF5F5;
  --well: #F3E4E6;
  --raised: #FFFFFF;
  --lid: #EDD9DD;
  --lid-edge: #DFC5CB;
  --ink: #2B1319;
  --ink2: #684850;
  --rule: #EAD9DC;
  --accent: #F7446B;
  --accent-deep: #C4204A;
  --field-ink: #35061A;
  --field-sun: #FF6E8E;
  --positive: #1C7445;
  --negative: #B3261E;

  --well-in: inset 0 4px 10px rgba(110, 19, 48, .10), inset 0 -2px 0 #fff;
  --rounded: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 20px;
  --r-lid: 14px;
  --r-well: 34px;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 500 17px/1.5 var(--rounded);
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent-deep);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

strong {
  font-weight: 700;
  color: var(--ink);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- top bar ---- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font: 800 22px/1 var(--rounded);
  letter-spacing: -0.4px;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 22px;
  color: var(--ink2);
  font: 700 15px/1 var(--rounded);
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.nav a[aria-current="page"] {
  background: var(--well);
  color: var(--ink);
}

/* ---- buttons: capsules with a bottom edge, like the app's PillBoxButtonStyle ---- */
.btn {
  display: inline-grid;
  place-items: center;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 28px;
  font: 700 20px/1 var(--rounded);
  text-decoration: none;
  transition: transform .08s ease-out, box-shadow .08s ease-out;
}

.btn:active {
  transform: translateY(4px);
  box-shadow: none;
}

.btn.on-field {
  background: var(--raised);
  color: var(--field-ink);
  box-shadow: 0 4px 0 var(--accent-deep);
}

.btn.quiet {
  background: var(--raised);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--rule);
  font-size: 17px;
}

.btn.on-field:active,
.btn.quiet:active {
  box-shadow: none;
}

/* ---- the pink field (onboarding voice) ---- */
.field {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  min-height: 460px;
  border-radius: var(--r-well);
  background: var(--accent);
  color: #fff;
}

.field .say {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 56px 0 60px 56px;
}

.field h1 {
  font: 800 clamp(44px, 6.4vw, 72px)/0.98 var(--rounded);
  letter-spacing: -0.03em;
}

.field p {
  max-width: 30em;
  margin-top: 20px;
  color: var(--field-ink);
  font: 600 19px/1.4 var(--rounded);
}

.field .acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 32px;
}

.field .acts a:not(.btn) {
  color: var(--field-ink);
  font: 700 17px/1.2 var(--rounded);
}

.field .mail {
  margin-top: 20px;
  font: 600 15px/1.3 var(--rounded);
  overflow-wrap: anywhere;
}

.field .stage {
  position: relative;
  min-height: 300px;
}

.field .sun {
  position: absolute;
  left: 50%;
  bottom: -46%;
  width: 600px;
  aspect-ratio: 1;
  margin-left: -300px;
  border-radius: 50%;
  background: #FF8FA8;
}

.field .stage img {
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: min(380px, 92%);
  transform: translateX(-50%);
}

/* ---- intro: the app icon fills the screen, then its plus grows into a window onto the page.
   Once per session (see index.html). The plus is a hole cut in the pink layer; the layer
   behind it is the ground colour, so the hole reads as the icon's plus until it opens. ---- */
.intro-line {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .intro .intro-line {
    display: block;
    position: fixed;
    top: 0;
    z-index: 101;
    width: 50vw;
    height: 100vh;
    pointer-events: none;
    animation: intro-out .3s linear 1s forwards;
  }

  .intro .intro-line.right {
    right: 0;
  }

  .intro .intro-line.left {
    left: 0;
  }

  .intro .intro-line path {
    fill: none;
    stroke: #FFB8C6;
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: .55 1.5;
    animation: intro-line 1.2s cubic-bezier(.4, 0, .5, 1) .1s both;
  }

  .intro body::before,
  .intro body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 100;
  }

  .intro body::before {
    background: var(--ground);
    animation: intro-out .3s linear 1.2s forwards;
  }

  .intro body::after {
    background: linear-gradient(#F94970, #FF6786);
    clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, calc(50% - 15.5px) calc(50% - 48px), calc(50% + 15.5px) calc(50% - 48px), calc(50% + 18px) calc(50% - 45.5px), calc(50% + 18px) calc(50% - 18px), calc(50% + 45.5px) calc(50% - 18px), calc(50% + 48px) calc(50% - 15.5px), calc(50% + 48px) calc(50% + 15.5px), calc(50% + 45.5px) calc(50% + 18px), calc(50% + 18px) calc(50% + 18px), calc(50% + 18px) calc(50% + 45.5px), calc(50% + 15.5px) calc(50% + 48px), calc(50% - 15.5px) calc(50% + 48px), calc(50% - 18px) calc(50% + 45.5px), calc(50% - 18px) calc(50% + 18px), calc(50% - 45.5px) calc(50% + 18px), calc(50% - 48px) calc(50% + 15.5px), calc(50% - 48px) calc(50% - 15.5px), calc(50% - 45.5px) calc(50% - 18px), calc(50% - 18px) calc(50% - 18px), calc(50% - 18px) calc(50% - 45.5px), calc(50% - 15.5px) calc(50% - 48px), 0 0);
    animation: intro-in .4s ease-out both, intro-grow .7s cubic-bezier(.7, 0, .9, .4) .9s forwards, intro-out 0s linear 1.6s forwards;
  }
}

@keyframes intro-line {
  from {
    stroke-dashoffset: .55;
  }

  to {
    stroke-dashoffset: -1;
  }
}

@keyframes intro-in {
  from {
    opacity: 0;
  }
}

@keyframes intro-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes intro-grow {
  to {
    clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, calc(50% - 52vmax) calc(50% - 160vmax), calc(50% + 52vmax) calc(50% - 160vmax), calc(50% + 60vmax) calc(50% - 152vmax), calc(50% + 60vmax) calc(50% - 60vmax), calc(50% + 152vmax) calc(50% - 60vmax), calc(50% + 160vmax) calc(50% - 52vmax), calc(50% + 160vmax) calc(50% + 52vmax), calc(50% + 152vmax) calc(50% + 60vmax), calc(50% + 60vmax) calc(50% + 60vmax), calc(50% + 60vmax) calc(50% + 152vmax), calc(50% + 52vmax) calc(50% + 160vmax), calc(50% - 52vmax) calc(50% + 160vmax), calc(50% - 60vmax) calc(50% + 152vmax), calc(50% - 60vmax) calc(50% + 60vmax), calc(50% - 152vmax) calc(50% + 60vmax), calc(50% - 160vmax) calc(50% + 52vmax), calc(50% - 160vmax) calc(50% - 52vmax), calc(50% - 152vmax) calc(50% - 60vmax), calc(50% - 60vmax) calc(50% - 60vmax), calc(50% - 60vmax) calc(50% - 152vmax), calc(50% - 52vmax) calc(50% - 160vmax), 0 0);
  }
}

/* ---- facts: four lids ---- */
.lids {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.lid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px 19px;
  border-radius: var(--r-lid);
  background: var(--lid);
  box-shadow: inset 0 -3px 0 var(--lid-edge);
}

.lid dt {
  color: var(--ink2);
  font: 600 13px/1.2 var(--rounded);
}

.lid dd {
  margin: 0;
  font: 700 17px/1.2 var(--rounded);
}

dl {
  margin: 0;
}

/* ---- sections ---- */
.section {
  padding-top: 96px;
}

.split {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0 64px;
  align-items: start;
}

.split > .lead {
  position: sticky;
  top: 24px;
}

.section h2 {
  font: 800 40px/1.02 var(--rounded);
  letter-spacing: -1px;
}

.lead p {
  margin-top: 12px;
  color: var(--ink2);
}

.lead img {
  width: 190px;
  margin-top: 28px;
}

.qa > li {
  padding: 22px 0 24px;
  border-top: 1px solid var(--rule);
}

.qa > li:first-child {
  padding-top: 6px;
  border-top: 0;
}

.qa h3 {
  font: 700 20px/1.25 var(--rounded);
  letter-spacing: -0.2px;
}

.qa p {
  max-width: 38em;
  margin-top: 6px;
  color: var(--ink2);
}

/* ---- the open compartment ---- */
.well {
  position: relative;
  border-radius: var(--r-well);
  background: var(--well);
  box-shadow: var(--well-in);
  padding: 48px 56px 28px;
}

.well .well-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 150px;
  padding-bottom: 20px;
}

.well .well-head p {
  max-width: 26em;
  margin-top: 12px;
  color: var(--ink2);
}

.well .well-head img {
  flex: none;
  width: 170px;
  margin: -84px 8px -20px 0;
}

.fixes > li {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 4px 40px;
  padding: 20px 0;
  border-top: 1px solid var(--lid-edge);
  color: var(--ink2);
}

.fixes strong {
  font: 700 19px/1.3 var(--rounded);
}

/* ---- privacy: plain ground, mascot holds the box ---- */
.keep {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 0 64px;
  align-items: center;
}

.keep p {
  max-width: 34em;
  margin-top: 16px;
  color: var(--ink2);
}

.keep .btn {
  margin-top: 28px;
}

.keep img {
  width: 260px;
}

/* ---- footer ---- */
.foot {
  margin-top: 96px;
  padding: 28px 0 56px;
  border-top: 1px solid var(--rule);
  color: var(--ink2);
  font: 500 15px/1.5 var(--rounded);
}

.foot .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.foot .links a {
  color: var(--ink);
  font-size: 17px;
}

.foot p {
  max-width: 46em;
  margin-top: 14px;
}

/* ---- legal pages ---- */
.doc-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--rule);
}

.doc-head h1 {
  font: 800 clamp(40px, 7vw, 64px)/1 var(--rounded);
  letter-spacing: -0.03em;
}

.doc-head p {
  margin-top: 14px;
  color: var(--ink2);
  font: 600 15px/1.3 var(--rounded);
}

.doc-head img {
  flex: none;
  width: 150px;
  margin-bottom: -28px;
}

.doc {
  max-width: 700px;
  padding-top: 40px;
  color: var(--ink2);
}

.doc h2 {
  margin: 48px 0 10px;
  color: var(--ink);
  font: 800 24px/1.2 var(--rounded);
  letter-spacing: -0.4px;
}

.doc h3 {
  margin: 24px 0 8px;
  color: var(--ink);
  font: 700 17px/1.3 var(--rounded);
}

.doc p {
  margin: 12px 0;
}

.doc ul {
  margin: 10px 0 14px;
}

.doc li {
  position: relative;
  margin: 8px 0;
  padding-left: 24px;
}

.doc li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lid-edge);
}

/* "not used" list: a drawn cross instead of a bullet */
.doc ul.no li::before,
.doc ul.no li::after {
  content: "";
  position: absolute;
  left: 1px;
  top: .72em;
  width: 13px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--negative);
  transform: rotate(45deg);
}

.doc ul.no li::after {
  transform: rotate(-45deg);
}

.doc .note {
  margin: 20px 0;
  padding: 20px 24px;
  border-radius: var(--r-lid);
  background: var(--well);
  box-shadow: var(--well-in);
  color: var(--ink);
}

.doc .note > :first-child {
  margin-top: 0;
}

.doc .note > :last-child {
  margin-bottom: 0;
}

.doc > :first-child {
  margin-top: 0;
}

.tag {
  display: inline-block;
  padding: 3px 10px 4px;
  border-radius: 12px;
  background: var(--lid);
  box-shadow: inset 0 -2px 0 var(--lid-edge);
  color: var(--ink);
  font: 700 13px/1.2 var(--rounded);
}

/* ---- narrow screens ---- */
@media (max-width: 860px) {
  .field {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .field .say {
    padding: 36px 24px 36px;
  }

  .field p {
    font-size: 17px;
  }

  /* The mascot moves into the top right corner, beside the headline. */
  .field .stage {
    position: absolute;
    inset: 0;
    min-height: 0;
  }

  .field .sun {
    top: -44px;
    right: -44px;
    bottom: auto;
    left: auto;
    width: clamp(150px, 48vw, 204px);
    margin-left: 0;
  }

  .field .stage img {
    top: 26px;
    right: 20px;
    bottom: auto;
    left: auto;
    width: clamp(80px, 26vw, 112px);
    transform: none;
  }

  .lids {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section {
    padding-top: 72px;
  }

  .split,
  .keep {
    grid-template-columns: minmax(0, 1fr);
  }

  .split > .lead {
    position: static;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
  }

  .lead img {
    flex: none;
    width: 112px;
    margin: 0;
  }

  .well {
    padding: 32px 24px 16px;
  }

  .well .well-head {
    min-height: 0;
  }

  .well .well-head img {
    position: absolute;
    top: -104px;
    right: 20px;
    width: 96px;
    margin: 0;
  }

  .fixes > li {
    grid-template-columns: minmax(0, 1fr);
  }

  .keep img {
    width: 168px;
    margin-top: 24px;
    justify-self: end;
  }

  .doc-head img {
    width: 104px;
  }
}

@media (max-width: 480px) {
  .brand span {
    display: none;
  }

  .section h2 {
    font-size: 34px;
  }

  .btn {
    width: 100%;
  }

  .keep .btn {
    width: auto;
  }
}

@media (max-width: 360px) {
  .field h1 {
    font-size: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn {
    transition: none;
  }
}
