/*
 * ManeDraft site stylesheet. Plain CSS, no build step.
 *
 * 1. Tokens          5. Buttons and store status   9. FAQ
 * 2. Base            6. Hero                       10. Long-form pages (.page, .prose)
 * 3. Layout          7. Schematic UI (.phone, .mock-*)  11. Footer
 * 4. Header          8. Home sections
 */

/* 1. Tokens ------------------------------------------------------------- */

:root {
  --ink: #202124;
  --paper: #f8f7f4;
  /* Brand sage is for shapes only: 3.7:1 on paper is too low for small text. */
  --sage: #718576;
  /* Sage for text and links on light backgrounds: 6.1:1 on paper, 6.5:1 on white. */
  --sage-ink: #4e6354;
  /* Sage for text on --ink: 7.8:1. */
  --sage-on-ink: #a8b8ac;
  --sage-soft: #e8ede8;
  /* Secondary text: 6.7:1 on paper. */
  --muted: #55585d;
  --muted-on-ink: #b9bbbf;
  --card: #fff;
  --tile: #efede8;
  --line: #e4e1da;
  --line-on-ink: #3a3b40;

  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section-gap: clamp(4rem, 9vw, 7rem);
  --font:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
}

/* 2. Base --------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.5rem);
}

h3 {
  font-size: 1.1875rem;
  font-weight: 600;
}

a {
  color: var(--sage-ink);
  text-underline-offset: 0.18em;
}

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

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

:focus-visible {
  outline: 2px solid var(--sage-ink);
  outline-offset: 3px;
}

/* 3. Layout ------------------------------------------------------------- */

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

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

/* Two neighbouring sections add up to one full --section-gap. */
.section {
  padding-block: calc(var(--section-gap) / 2);
}

.section__head {
  max-width: 40rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* Inside .split the grid gap already separates the head from what follows. */
.split > .section__head {
  margin-bottom: 0;
}

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--sage-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
}

.fine-print {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Rounded full-width block inside .wrap. */
.panel {
  padding: clamp(1.5rem, 5vw, 4rem);
  border-radius: var(--radius-lg);
}

.panel--dark {
  background: var(--ink);
  color: var(--paper);
}

.panel--dark .eyebrow {
  color: var(--sage-on-ink);
}

.panel--dark .lead,
.panel--dark .fine-print,
.panel--dark li {
  color: var(--muted-on-ink);
}

.panel--sage {
  background: var(--sage-soft);
}

/* Copy next to artwork. Copy comes first in the HTML; --flip moves the art to the left on wide screens. */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.split__art {
  display: grid;
  place-items: center;
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }

  .split--flip {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }

  .split--flip .split__art {
    order: -1;
  }

  .split--top {
    align-items: start;
  }
}

/* 4. Header ------------------------------------------------------------- */

.site-header {
  padding-block: 1.125rem;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand__mark {
  width: 2rem;
  height: 2rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-size: 0.9375rem;
  font-weight: 500;
}

.site-nav a {
  padding-block: 0.5rem;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--sage-ink);
  text-decoration: underline;
}

/* Links to home page sections are dropped on small screens; the rest stay. */
@media (max-width: 47.99rem) {
  .site-nav__section {
    display: none;
  }
}

/* 5. Buttons and store status ------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.5rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 0.15s,
    transform 0.1s;
}

.button:active {
  transform: scale(0.97);
}

.button--primary {
  background: var(--ink);
  color: var(--paper);
}

.button--primary:hover {
  background: #36383d;
  border-color: #36383d;
  color: var(--paper);
}

.button--ghost {
  color: var(--ink);
}

.button--ghost:hover {
  background: var(--tile);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 2rem;
}

/* Text-only availability note. Not the Google Play badge and must not be styled to look like it. */
.store-status {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
}

.store-status::before {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px var(--sage-soft);
}

/* 6. Hero --------------------------------------------------------------- */

.hero {
  padding-block: clamp(2rem, 6vw, 4.5rem) calc(var(--section-gap) / 2);
}

.hero .fine-print {
  max-width: 32rem;
  margin-top: 1.5rem;
}

.hero__art {
  position: relative;
}

/* Tinted block behind the phone; the phone overlaps it top and bottom. */
.hero__art::before {
  content: "";
  position: absolute;
  inset: 3.5rem 0;
  border-radius: var(--radius-lg);
  background: var(--sage-soft);
}

/* 7. Schematic UI -------------------------------------------------------- */
/* Drawn in HTML and CSS as illustration; always inside aria-hidden="true". Sizes are in em so
   a block scales with its own font-size. */

.phone {
  position: relative;
  width: 25em;
  max-width: 100%;
  padding: 0.75em;
  border-radius: 3.25em;
  background: var(--ink);
  box-shadow: 0 2.5em 4em -2em rgb(32 33 36 / 0.45);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
}

.phone__screen {
  display: flex;
  flex-direction: column;
  gap: 1.1em;
  aspect-ratio: 9 / 17;
  padding: 2em 1.25em 1.25em;
  border-radius: 2.5em;
  background: var(--paper);
  overflow: hidden;
}

/* Full-screen presentation: dark screen, light frame edge so it reads on --ink. */
.phone--present {
  background: #34363b;
  box-shadow: none;
}

.phone--present .phone__screen {
  aspect-ratio: 9 / 16;
  padding: 1.25em;
  background: #121315;
  color: var(--paper);
}

.mock-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
}

.mock-row--between {
  justify-content: space-between;
}

.mock-row--center {
  justify-content: center;
}

.mock-title {
  font-size: 1.6em;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mock-label {
  font-weight: 600;
}

.mock-chip {
  padding: 0.45em 0.95em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-weight: 600;
  white-space: nowrap;
}

.mock-chip.is-on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.mock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75em;
}

.mock-tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 1.25em;
  background: var(--tile);
}

.mock-tile.is-on {
  background: var(--card);
  box-shadow: 0 0 0 2px var(--sage);
}

.mock-tile svg {
  width: 58%;
}

/* Abstract hair strands: stroked curves, never faces or photos. */
.mock-strands {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-width: 4.5;
}

.mock-bar {
  display: block;
  width: 6em;
  height: 0.65em;
  border-radius: 999px;
  background: var(--line);
}

.mock-bar--short {
  width: 3em;
}

.mock-sheet {
  display: grid;
  gap: 0.9em;
  margin-top: auto;
  padding: 1.1em;
  border: 1px solid var(--line);
  border-radius: 1.4em;
  background: var(--card);
}

.mock-button {
  display: block;
  padding: 0.85em 1em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-align: center;
}

.mock-field {
  padding: 0.75em 0.95em;
  border: 1px solid var(--line);
  border-radius: 1em;
  background: var(--card);
  color: var(--muted);
}

/* Stand-in for a generated look: strands on a dark card. */
.mock-look {
  position: relative;
  flex: 1;
  min-height: 9em;
  border-radius: 1.5em;
  background: #2a2b2f;
  overflow: hidden;
}

.mock-look svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The strands themselves live once in the page's <svg class="sprite"> as <symbol class="look-art">. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.look-art path {
  fill: none;
  stroke: var(--paper);
  stroke-linecap: round;
  stroke-width: 8;
}

.look-art path:nth-child(3n + 2) {
  stroke: var(--sage);
}

.look-art path:nth-child(3n) {
  stroke-opacity: 0.45;
}

.mock-tag {
  position: absolute;
  bottom: 0.9em;
  left: 0.9em;
  padding: 0.4em 0.8em;
  border-radius: 999px;
  background: rgb(18 19 21 / 0.78);
  color: var(--paper);
  font-size: 0.9em;
  font-weight: 600;
}

.mock-dots {
  display: inline-flex;
  gap: 0.45em;
}

.mock-dots i {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
}

.mock-dots .is-on {
  opacity: 1;
}

/* 8. Home sections ------------------------------------------------------ */

/* How it works: numbered cards. The number comes from the <ol> order. */
.steps {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 40rem) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.step {
  padding: 0.75rem 0.75rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  counter-increment: step;
}

.step__art {
  display: grid;
  align-content: center;
  gap: 0.75em;
  height: 12.5rem;
  padding: 1.25em;
  border-radius: var(--radius-sm);
  background: var(--tile);
  font-size: 14px;
  line-height: 1.3;
}

@media (min-width: 40rem) {
  .step__art {
    font-size: 12px;
  }
}

.step__art--dark {
  grid-template-rows: 1fr auto;
  align-content: stretch;
  background: #121315;
  color: var(--paper);
}

.step__title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 1.25rem 0.5rem 0;
}

.step__title::before {
  content: counter(step);
  display: grid;
  flex: none;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--sage-ink);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0;
}

.step p {
  margin: 0.5rem 0.5rem 0;
  color: var(--muted);
  font-size: 0.9688rem;
}

/* Check list. */
.ticks {
  display: grid;
  gap: 0.875rem;
  margin: 1.75rem 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: 2.125rem;
}

.ticks li::before {
  content: "";
  position: absolute;
  top: 0.2em;
  left: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--sage);
}

.ticks li::after {
  content: "";
  position: absolute;
  top: 0.44em;
  left: 0.44rem;
  width: 0.375rem;
  height: 0.625rem;
  border: solid var(--paper);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Three-up blocks. .card adds the white surface; without it the item sits on the section background. */
.cards {
  display: grid;
  gap: 1.25rem;
}

.cards--loose {
  gap: 2rem;
}

@media (min-width: 48rem) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.item__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--sage-soft);
  color: var(--sage-ink);
}

.panel--sage .item__icon {
  background: var(--card);
}

.item__icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.item p {
  margin-top: 0.5rem;
  color: var(--muted);
}

.section__note {
  margin-top: 1.5rem;
}

/* 9. FAQ ---------------------------------------------------------------- */

.faq {
  display: grid;
  gap: 0.75rem;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  border-radius: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  margin: -0.25rem 0.25rem 0;
  border: solid var(--sage-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.faq details[open] summary::after {
  margin-top: 0.25rem;
  transform: rotate(-135deg);
}

.faq__answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--muted);
}

.faq__answer > * + * {
  margin-top: 0.75rem;
}

/* 10. Long-form pages --------------------------------------------------- */
/* <main class="page wrap wrap--narrow"> holds a .page__head and a .prose. */

.page {
  padding-block: clamp(2rem, 6vw, 4rem) calc(var(--section-gap) / 2);
}

.page__head {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.page__head h1 {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
}

.page__meta {
  margin-top: 1rem;
  color: var(--muted);
}

.prose > * + * {
  margin-top: 1rem;
}

.prose h2 {
  margin-top: 2.75rem;
  font-size: 1.5rem;
}

.prose h3 {
  margin-top: 2rem;
}

.prose ul,
.prose ol {
  margin-bottom: 0;
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 0.5rem;
}

.prose a {
  overflow-wrap: anywhere;
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--tile);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* A wide table scrolls inside itself, so the page never scrolls sideways. */
.prose table {
  display: block;
  border-collapse: collapse;
  font-size: 0.9375rem;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--tile);
  font-weight: 600;
}

.callout {
  padding: 1.125rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--sage-soft);
}

/* Short centred page such as 404. */
.page--center {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 60vh;
  text-align: center;
}

.page--center .actions {
  justify-content: center;
}

/* 11. Footer ------------------------------------------------------------ */

.site-footer {
  margin-top: calc(var(--section-gap) / 2);
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: grid;
  gap: 1.5rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}

.site-footer__links a {
  padding-block: 0.375rem;
  color: var(--ink);
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--sage-ink);
  text-decoration: underline;
}

.site-footer__legal {
  color: var(--muted);
  font-size: 0.8125rem;
}

@media (min-width: 48rem) {
  .site-footer__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .site-footer__legal {
    grid-column: 1 / -1;
  }
}
