/*
 * Manfred web pages. Design language from the App Store artboards
 * (manfred_app/store_assets/design): deep violet ground, a tilted violet band,
 * heavy tight headlines with a lavender subline, phones in a near-black bezel.
 * Light mode is derived from it for visitors who prefer a light scheme.
 */

:root {
  color-scheme: light dark;

  /* Light scheme */
  --ground: #f6f3fe;
  --ground-deep: #ece6fb;
  --band: #4c3a8f;
  --band-ink: #ffffff;
  --surface: #ffffff;
  --ink: #1b1530;
  --sub: #4c3a8f;
  --soft: #4a4560;
  --accent: #5b44b8;
  --focus: #4c3a8f;
  --line: rgba(76, 58, 143, 0.16);
  --glyph-bg: rgba(76, 58, 143, 0.1);
  --bezel: #0b0914;
  --shadow-device: 0 24px 64px rgba(27, 21, 48, 0.28);
  --shadow-card: 0 1px 2px rgba(27, 21, 48, 0.06), 0 8px 24px rgba(27, 21, 48, 0.06);
  --btn-bg: #1b1530;
  --btn-ink: #ffffff;

  --radius-card: 1.25rem;
  --radius-pill: 999px;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --tilt: 5deg;
  --tilt-rise: 8.75vw; /* tan(5deg) * 100vw */

  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Store artboard defaults: ground #1B1530, band #4C3A8F, sub #D9D2F2 */
    --ground: #1b1530;
    --ground-deep: #130f24;
    --band: #4c3a8f;
    --surface: #241c3e;
    --ink: #ffffff;
    --sub: #d9d2f2;
    --soft: #bdb5d8;
    --accent: #cbbeff;
    --focus: #cbbeff;
    --line: rgba(217, 210, 242, 0.14);
    --glyph-bg: rgba(203, 190, 255, 0.14);
    --shadow-device: 0 40px 120px rgba(0, 0, 0, 0.45);
    --shadow-card: none;
    --btn-bg: #ffffff;
    --btn-ink: #1b1530;
  }
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, li { overflow-wrap: break-word; }

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

a { overflow-wrap: anywhere; color: var(--accent); text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: 48rem; }

/* ------------------------------------------------------------------ header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.22em;
  text-decoration: none;
}
.brand img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 22%; /* 132/600, HeaderLogo artboard */
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.site-nav { min-width: 0; max-width: 100%; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover { background: var(--glyph-bg); }

/* ------------------------------------------------------------- headlines */

.display,
.section-title,
.page-title {
  font-weight: 800;
  color: var(--ink);
  text-wrap: balance;
}

/* Store boards: 108-215px at weight 800, line-height 1.0-1.04,
   tracking about -0.03em to -0.04em. */
.display {
  font-size: clamp(2.375rem, 1.2rem + 5.4vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.section-title {
  font-size: clamp(1.875rem, 1.2rem + 2.6vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.page-title {
  font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

/* Sublines: weight 500, lavender, about a third of the headline size. */
.lead,
.section-sub {
  color: var(--sub);
  font-weight: 500;
  line-height: 1.35;
  text-wrap: pretty;
}
.lead { font-size: clamp(1.1875rem, 1rem + 0.9vw, 1.5rem); }
.section-sub { font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.25rem); max-width: 40rem; }

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

.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.store-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3.5rem;
  min-width: 9.5rem;
  padding: 0.5rem 1.5rem;
  border-radius: 1rem;
  border: 2px solid var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-ink);
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
}
.store-btn small { font-size: 0.75rem; font-weight: 500; opacity: 0.85; }
.store-btn strong { font-size: 1.0625rem; font-weight: 700; }
.store-btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.store-btn:hover { text-decoration: none; transform: translateY(-1px); }

@media (prefers-reduced-motion: no-preference) {
  .store-btn { transition: transform 0.15s ease; }
}

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

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  /* Bottom edge follows the band's tilt, like the store header boards. */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--tilt-rise)), 0 100%);
}

/* The tilted band: Main/Header/Search artboards, rotate(-5deg to -9deg). */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: var(--band-top, 58%);
  height: 200%;
  background: var(--band);
  transform: skewY(calc(var(--tilt) * -1));
  transform-origin: 0 0;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
}
.hero__copy .display { max-width: 15ch; }
.hero__copy .lead { max-width: 34rem; }
.hero__copy .stores { margin-top: 0.75rem; }

/* Device framing: near-black bezel at 2.2% of the width,
   corner radius 15.8% of the width (Main/Search artboards). */
.devices {
  --pw: clamp(15rem, 25vw, 20rem);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1rem, 2.4vw, 2.25rem);
  height: calc(var(--pw) * 1.72);
  padding-inline: var(--gutter);
  list-style: none;
}

.phone {
  flex: none;
  width: var(--pw);
  border: calc(var(--pw) * 0.022) solid var(--bezel);
  border-radius: calc(var(--pw) * 0.158);
  overflow: hidden;
  background: var(--bezel);
  box-shadow: var(--shadow-device);
}
.phone img { width: 100%; height: auto; }
.phone--side { width: calc(var(--pw) * 0.92); margin-top: calc(var(--pw) * 0.16); }

@media (max-width: 47.99em) {
  .phone--side { display: none; }
  .devices { --pw: min(19rem, 76vw); height: calc(var(--pw) * 1.35); }
}

/* -------------------------------------------------------------- features */

.features { padding-block: clamp(3rem, 7vw, 5.5rem); }
.features header { display: grid; gap: 0.75rem; margin-bottom: clamp(2rem, 4vw, 3rem); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
  list-style: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}
.card h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.card p { font-size: 0.9375rem; color: var(--soft); }

.glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  background: var(--glyph-bg);
  color: var(--accent);
}
.glyph svg { width: 1.375rem; height: 1.375rem; }

/* --------------------------------------------------------------- gallery */

.gallery { padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.shots {
  --shot: min(54rem, 84vw);
  display: flex;
  gap: clamp(1rem, 2.4vw, 2rem);
  margin-top: 1.5rem;
  padding: 0.5rem max(var(--gutter), calc((100% - var(--shot)) / 2)) 3rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  list-style: none;
  scrollbar-color: var(--band) transparent;
}
.shot { flex: none; width: var(--shot); scroll-snap-align: center; }
.mac {
  border: calc(var(--shot) * 0.008) solid var(--bezel);
  border-radius: calc(var(--shot) * 0.022);
  overflow: hidden;
  background: var(--bezel);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.mac img { display: block; width: 100%; height: auto; }
.shot figcaption {
  margin-top: 1rem;
  text-align: center;
  font-weight: 600;
  color: var(--sub);
}

/* ----------------------------------------------------------------- about */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}
.about__portrait img {
  width: min(100%, 11rem);
  border-radius: 22%; /* HeaderLogo / FeatureGraphic logo treatment */
  box-shadow: var(--shadow-device);
}
.about .section-title { margin-bottom: 1.25rem; }
.about .cols { display: grid; gap: 0.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.about p { color: var(--soft); margin-bottom: 1rem; }
.about strong { color: var(--ink); }

@media (min-width: 52em) {
  .about__portrait img { width: 15rem; }
  .about { grid-template-columns: 15rem minmax(0, 1fr); gap: 3.5rem; align-items: start; }
}

/* ------------------------------------------------------------- text pages */

.page { padding-block: clamp(1.5rem, 5vw, 3.5rem) clamp(3.5rem, 8vw, 6rem); }
.page .page-title { margin-bottom: 1.5rem; }
.page .meta { color: var(--sub); font-weight: 500; font-size: 1rem; margin-bottom: 2.5rem; }
.page h2 { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; margin: 2.5rem 0 0.75rem; }
.page h2.label {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sub);
  margin: 2.25rem 0 0.75rem;
}
.page p, .page li { color: var(--soft); }
.page p { margin-bottom: 0.875rem; }
.page strong { color: var(--ink); }
.page ul { padding-left: 1.375rem; margin-bottom: 1rem; }
.page li { margin-bottom: 0.625rem; }
.page li::marker { color: var(--accent); }

.page .card p { margin-bottom: 0.25rem; }
.page .card .gap { margin-top: 0.875rem; }
/* Links that stand alone on their line get a full 44px touch target. */
.page .card p > a:only-child { display: inline-flex; align-items: center; min-height: 44px; }
.page .note { font-size: 0.9375rem; margin-top: 2rem; }

.page .de {
  margin-top: 3rem;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 4px solid var(--band);
}

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

.site-footer {
  position: relative;
  background: var(--ground-deep);
  color: var(--soft);
  font-size: 0.9375rem;
  padding-block: 2.5rem 3rem;
}
.site-footer .cols {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem 3rem;
}
.site-footer strong { color: var(--ink); }
.site-footer ul { list-style: none; }
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
}
.site-footer a:hover { text-decoration-color: currentColor; }
.site-footer .inline { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.25rem; }

@media (forced-colors: active) {
  .phone, .mac, .card, .store-btn { border-color: CanvasText; }
  .hero::before { display: none; }
}
