/* Meds Taken marketing site.
   One bold element (the pill organizer in the hero); everything else quiet and readable.
   Typeface: Atkinson Hyperlegible Next, designed for low-vision readers. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3f6fb;
  --surface: #ffffff;
  --ink: #13213d;
  --ink-soft: #46546f;
  --blue: #2f6bf4;
  --blue-deep: #1d4fc7;
  --green: #1f9d55;
  --amber: #e8962e;
  --line: #d6deeb;
  --tray: #e7edf6;
  --font: "Atkinson Hyperlegible Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --measure: 66ch;
  --page: 1120px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto; /* keep the image's shape when it's scaled down */
  display: block;
}

a {
  color: var(--blue-deep);
  text-underline-offset: 0.18em;
}

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

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

h1,
h2,
h3 {
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.5rem);
  font-weight: 800;
}

h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: min(var(--page), 100% - 2.5rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Header ---------- */

.site-header {
  padding: 1.1rem 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 1rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

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

.site-nav a[aria-current="page"] {
  color: var(--blue-deep);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 1.6rem;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  border: 2px solid transparent;
}

.button--primary {
  background: var(--blue);
  color: #fff;
}

.button--primary:hover {
  background: var(--blue-deep);
  color: #fff;
}

.button--quiet {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.button--quiet:hover {
  border-color: var(--blue);
  color: var(--blue-deep);
}

.site-nav .button {
  min-height: 2.6rem;
  padding: 0 1.1rem;
  font-size: 1rem;
  color: #fff;
}

/* ---------- Hero ---------- */

.hero {
  padding: 2.5rem 0 4.5rem;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 3.5rem;
  align-items: center;
}

.hero__tagline {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--blue-deep);
  margin-bottom: 1.1rem;
  max-width: 26ch;
}

.hero__lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 38ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 2rem 0 1rem;
}

.hero__note {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- The pill organizer ---------- */

.organizer {
  margin: 0;
  background: var(--surface);
  border-radius: 30px;
  padding: 1.2rem 1.2rem 1.4rem;
  box-shadow: 0 1px 0 #fff inset, 0 24px 48px -24px rgba(19, 33, 61, 0.35), 0 2px 6px rgba(19, 33, 61, 0.08);
  border: 1px solid var(--line);
}

.organizer__grid {
  display: grid;
  grid-template-columns: 4.6rem repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
  align-items: stretch;
}

.organizer__day {
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink-soft);
  padding-bottom: 0.15rem;
}

.organizer__day--today {
  color: var(--blue-deep);
}

.organizer__row-label {
  align-self: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.cell {
  position: relative;
  aspect-ratio: 0.82;
  border-radius: 14px;
  background: var(--tray);
  box-shadow: inset 0 3px 6px rgba(19, 33, 61, 0.16);
  perspective: 500px;
}

/* Pills sitting in the compartment, seen through the translucent lid. */
.pills {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8%;
}

.pill {
  display: block;
  border-radius: 999px;
}

.pill--capsule {
  width: 16%;
  aspect-ratio: 0.42;
  background: linear-gradient(var(--blue) 50%, #fff 50%);
  transform: rotate(24deg);
  box-shadow: 0 1px 2px rgba(19, 33, 61, 0.3);
}

.pill--tablet {
  width: 22%;
  aspect-ratio: 1;
  background: #fff;
  box-shadow: 0 1px 2px rgba(19, 33, 61, 0.3), inset 0 -2px 0 rgba(19, 33, 61, 0.08);
}

.cell--empty .pills {
  opacity: 0;
}

.lid {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(47, 107, 244, 0.26);
  border: 2px solid rgba(47, 107, 244, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform-origin: 50% 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10%;
}

.lid__check {
  width: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--green);
  display: grid;
  place-items: center;
}

.lid__check svg {
  width: 62%;
  height: 62%;
}

/* Today's morning lid flips open once on load, showing it's been taken. */
.cell--open .lid {
  transform: rotateX(-82deg);
  animation: lid-open 0.9s cubic-bezier(0.3, 1.4, 0.5, 1) 0.5s backwards;
}

@keyframes lid-open {
  from {
    transform: rotateX(0deg);
  }
}

.tag {
  position: absolute;
  left: 50%;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  transform: translateX(-50%);
  z-index: 2;
}

/* Inside the open compartment: taken, and when. */
.taken-mark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  animation: mark-in 0.4s ease-out 1.1s backwards;
}

.taken-mark .lid__check {
  width: 48%;
}

.taken-mark__time {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--green);
}

@keyframes mark-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

.tag--due {
  bottom: -1.2rem;
  background: #fff4e3;
  color: #9a5a05;
  border: 2px solid var(--amber);
}

/* ---------- Sections ---------- */

.section {
  padding: 4.5rem 0;
}

.section--white {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.section__intro {
  max-width: 44rem;
  margin-bottom: 2.5rem;
}

.section__intro p {
  font-size: 1.2rem;
  color: var(--ink-soft);
}

/* How it works: four steps, each beside its screen. A real sequence, so they're numbered. */
.journey {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5rem;
}

.step {
  display: grid;
  grid-template-columns: minmax(0, 270px) minmax(0, 1fr);
  gap: 4.5rem;
  align-items: center;
}

/* Alternate the screen's side so the page reads like a path. */
.step:nth-child(even) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 270px);
}

.step:nth-child(even) .step__shot {
  order: 2;
}

.step__text {
  max-width: 38rem;
}

.step__text > p {
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.step__number {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.step__text h3 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.step__note {
  margin-top: 1.2rem;
  font-size: 1rem;
}

.phone {
  border-radius: 44px;
  border: 10px solid var(--ink);
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(19, 33, 61, 0.5);
}

/* Features styled like the colored stickers a pharmacy puts on a bottle. */
.labels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.label {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  border-radius: 10px;
  border: 2px solid var(--label-color);
  background: var(--label-tint);
  overflow: hidden;
}

.label__icon {
  background: var(--label-color);
  display: grid;
  place-items: start center;
  padding-top: 0.95rem;
}

.label__icon svg {
  width: 1.6rem;
  height: 1.6rem;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.label__text {
  padding: 0.9rem 1.1rem 1rem;
}

.label__text h4 {
  font-size: 1.1rem;
  line-height: 1.25;
  margin: 0 0 0.2rem;
}

.label__text p {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-soft);
}

.label--blue {
  --label-color: var(--blue);
  --label-tint: #eef3ff;
}

.label--amber {
  --label-color: var(--amber);
  --label-tint: #fff6e8;
}

.label--green {
  --label-color: var(--green);
  --label-tint: #ebf7f0;
}

.label--navy {
  --label-color: var(--ink);
  --label-tint: #eef1f6;
}

/* Privacy promise. */
.promise {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  max-width: 52rem;
}

.promise__icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--green);
  display: grid;
  place-items: center;
}

.promise__icon svg {
  width: 2.2rem;
  height: 2.2rem;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.promise p {
  font-size: 1.2rem;
  color: var(--ink-soft);
}

/* ---------- Document pages (privacy policy, support) ---------- */

.doc {
  padding: 2rem 0 5rem;
}

.doc__body {
  max-width: var(--measure);
}

.doc__body h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
}

.doc__body h2 {
  font-size: 1.6rem;
  margin-top: 2.4rem;
}

.doc__updated {
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

.doc__summary {
  background: #ebf7f0;
  border-left: 5px solid var(--green);
  padding: 1.1rem 1.3rem;
  border-radius: 0 10px 10px 0;
  margin: 0 0 2rem;
}

.doc__summary p:last-child {
  margin-bottom: 0;
}

.doc__body ul {
  padding-left: 1.3rem;
}

.doc__body li {
  margin-bottom: 0.45rem;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 0.3rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 0.9rem 0;
  list-style-position: outside;
}

.faq details[open] summary {
  color: var(--blue-deep);
}

.faq details > div {
  padding: 0 0 1rem;
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  color: var(--ink-soft);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
}

.site-footer nav {
  display: flex;
  gap: 1.4rem;
  margin-right: auto;
}

.site-footer a {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- Small screens ---------- */

@media (max-width: 880px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .journey {
    gap: 4rem;
  }

  .step,
  .step:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* On narrow screens, read each step before its screenshot. */
  .step__shot,
  .step:nth-child(even) .step__shot {
    order: 2;
    width: min(270px, 80%);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1.0625rem;
  }

  .site-nav a:not(.button) {
    display: none;
  }

  .organizer {
    padding: 0.9rem 0.7rem 1.1rem;
    border-radius: 22px;
  }

  .organizer__grid {
    grid-template-columns: 2.9rem repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .organizer__row-label {
    font-size: 0.72rem;
  }

  .cell,
  .lid {
    border-radius: 9px;
  }

  .tag {
    font-size: 0.68rem;
    padding: 0.2rem 0.45rem;
  }

  .taken-mark__time {
    font-size: 0.62rem;
  }

  .promise {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
}

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

  .cell--open .lid,
  .taken-mark {
    animation: none;
  }
}
