:root {
  --purple: #6a2c9e;
  --purple-soft: #efe8f7;
  --blue: #1d4fc4;
  --navy: #141a4a;
  --ink: #1c1d33;
  --muted: #5b5e78;
  --ground: #f6f4fb;
  --surface: #ffffff;
  --line: #e2dcee;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

::selection { background: var(--purple); color: #fff; }

a { color: inherit; text-decoration: none; }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---------- Home ---------- */

.brand {
  padding: calc(2.5rem + env(safe-area-inset-top)) 0 1.75rem;
  text-align: center;
}

.wordmark {
  margin: 0;
  font-size: clamp(1.75rem, 9.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
  /* letter-spacing adds trailing space; pull it back so the word centres */
  margin-right: -0.06em;
  color: var(--purple);
}

.brand p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.guides {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.guide {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 5.25rem;
  padding: 1rem 1rem 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 26, 74, 0.05), 0 6px 16px rgba(20, 26, 74, 0.05);
  transition: transform 160ms var(--ease), border-color 160ms var(--ease);
}

.guide:active { transform: scale(0.985); }

@media (hover: hover) {
  .guide:hover { border-color: var(--purple); }
}

.num {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.guides li:nth-child(2) .num { background: var(--blue); }

.guide .txt {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.guide strong {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
}

.guide small {
  font-size: 0.875rem;
  color: var(--muted);
}

.guide svg {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--purple);
}

/* ---------- Guide page ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(246, 244, 251, 0.96);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.5rem;
  max-width: 48rem;
}

.back,
.save {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.back { color: var(--purple); margin-left: -0.25rem; padding-right: 0.5rem; }

.save {
  padding: 0 1rem;
  background: var(--purple);
  color: #fff;
  border-radius: 999px;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}

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

@media (hover: hover) {
  .save:hover { background: var(--navy); }
}

.back svg, .save svg { width: 1.25rem; height: 1.25rem; flex: none; }

.viewer {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
  max-width: 48rem;
}

.viewer img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 26, 74, 0.08), 0 8px 24px rgba(20, 26, 74, 0.08);
}

.hint {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

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

.foot {
  margin-top: auto;
  padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (min-width: 40rem) {
  .brand { padding-top: 4.5rem; padding-bottom: 2.5rem; }
  .guide { padding: 1.25rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .guide, .save { transition: none; }
  .guide:active, .save:active { transform: none; }
}
