/* Madycare — landing.
 *
 * The identity is the app's, not a new one: the warm off-white page, the deep
 * green, and hairlines instead of cards (the 1a design direction). Every colour
 * here is a token from `lib/src/constants/app_colors.dart`.
 */

:root {
  --brand: #0f6b4f;
  --brand-ink: #ffffff;
  --brand-soft: #e1f0e8;

  --surface: #faf7f1;
  --surface-alt: #f4f0e8;
  --surface-raised: #ffffff;

  --ink: #1a1a17;
  --ink-muted: #5d5c57;
  --hairline: #e0dad0;

  --shadow: 0 18px 48px rgba(26, 26, 23, 0.1);

  --wrap: 1120px;
  --radius: 18px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand: #7fd3b0;
  --brand-ink: #0d0c0a;
  --brand-soft: #17392c;

  --surface: #13120f;
  --surface-alt: #1b1a16;
  --surface-raised: #1f1e1a;

  --ink: #f2efe8;
  --ink-muted: #a8a49b;
  --hairline: #423f37;

  --shadow: 0 18px 48px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* The top bar is sticky; an anchored heading must clear it. */
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand-mark {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-mark img {
  height: 26px;
  width: auto;
}

:root[data-theme="dark"] .brand-mark .mark-light,
:root:not([data-theme="dark"]) .brand-mark .mark-dark {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.lang a {
  color: var(--ink-muted);
  text-decoration: none;
  padding: 2px 2px;
}

.lang a.active {
  color: var(--brand);
  font-weight: 700;
}

.lang .sep {
  color: var(--hairline);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

:root[data-theme="dark"] .icon-sun,
:root:not([data-theme="dark"]) .icon-moon {
  display: none;
}

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

.hero {
  padding: 72px 0 56px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  font-weight: 700;
}

.hero-sub {
  font-size: 1.12rem;
  color: var(--ink-muted);
  margin: 0 0 28px;
  max-width: 34em;
}

.hero-note {
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin: 22px 0 0;
}

/* ---------- Store buttons ---------- */

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.store-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
}

.store-pill svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.store-pill.is-soon {
  opacity: 0.72;
  cursor: default;
}

/* ---------- Phone ---------- */

.phone {
  position: relative;
  margin: 0 auto;
  width: min(300px, 78vw);
  border-radius: 40px;
  padding: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}

.phone img {
  border-radius: 31px;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: top center;
  background: var(--surface-alt);
}

/* A capture that has not been taken yet must not leave a broken icon. */
.phone img:not([src]),
.phone img[src=""] {
  visibility: hidden;
}

/* ---------- Blocks ---------- */

.block {
  padding: 64px 0;
  border-top: 1px solid var(--hairline);
}

.section-head {
  max-width: 42em;
  margin: 0 0 40px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  font-weight: 700;
}

.section-description {
  color: var(--ink-muted);
  margin: 0;
}

/* ---------- Features grid ---------- */

#features-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0 40px;
}

#features-list li {
  padding: 26px 0;
  border-top: 1px solid var(--hairline);
}

#features-list h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
}

#features-list p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

/* ---------- Showcase ---------- */

.feature-item {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: center;
  padding: 48px 0;
  border-top: 1px solid var(--hairline);
}

.feature-item.reverse .feature-image {
  order: 2;
}

.feature-content h3 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  font-weight: 700;
}

.feature-content p {
  margin: 0;
  color: var(--ink-muted);
}

/* ---------- The veterinary notice ---------- */

.vet-notice {
  border-top: 1px solid var(--hairline);
  background: var(--surface-alt);
  padding: 40px 0;
}

.vet-notice .wrap {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.vet-notice svg {
  flex: none;
  width: 26px;
  height: 26px;
  stroke: var(--brand);
  fill: none;
  stroke-width: 1.8;
  margin-top: 2px;
}

.vet-notice h2 {
  font-size: 1.05rem;
  margin: 0 0 6px;
  font-weight: 700;
}

.vet-notice p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
  max-width: 60em;
}

/* ---------- Contact ---------- */

.contact-email-link {
  font-size: 1.15rem;
  font-weight: 600;
}

/* ---------- Legal documents ---------- */

.doc {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.doc-card {
  font-size: 1rem;
  line-height: 1.7;
}

.doc-card h1 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.doc-card h2 {
  font-size: 1.28rem;
  margin: 44px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  color: var(--brand);
}

.doc-card h3 {
  font-size: 1.05rem;
  margin: 26px 0 8px;
}

.doc-card hr {
  display: none;
}

.doc-card blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--brand);
  background: var(--surface-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink);
}

.doc-card blockquote p {
  margin: 0;
}

.doc-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.94rem;
}

.doc-card th,
.doc-card td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
}

.doc-card th {
  color: var(--ink-muted);
  font-weight: 600;
}

.doc-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface-alt);
  padding: 1px 5px;
  border-radius: 5px;
}

.table-scroll,
.doc-card .table-scroll {
  overflow-x: auto;
}

/* ---------- Changelog ---------- */

.version {
  padding: 26px 0;
  border-top: 1px solid var(--hairline);
}

.version h3 {
  margin: 0 0 8px;
  color: var(--brand);
}

.version ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-muted);
}

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

footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 0 48px;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
  justify-content: space-between;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

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

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

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero .wrap,
  .feature-item {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .feature-item.reverse .feature-image {
    order: 0;
  }

  .hero-visual {
    order: -1;
  }
}

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