/* DrawInk website
   Look: the app icon's thick dark outlines + bright paint colours.
   Every key element has an ink outline and a hard offset shadow. */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Brand */
  --purple: #6b3dff;
  --purple-deep: #4a22cc;
  --yellow: #ffd23f;
  --pink: #ff4fa3;
  --cyan: #3cc8ff;

  /* Surfaces and text (light) */
  --bg: #f7f4ff;
  --bg-soft: #ece5ff;
  --surface: #ffffff;
  --ink: #1a1038;
  --ink-soft: #4b4270;
  --line: #1a1038;
  --on-purple: #ffffff;
  --device-body: #0c0a14;

  --font-display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 22px;
  --radius-sm: 14px;
  --stroke: 3px;
  --offset: 6px;
  --measure: 62ch;
  --gutter: clamp(20px, 5vw, 56px);
  --maxw: 1160px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #130b2b;
    --bg-soft: #1b1140;
    --surface: #221752;
    --ink: #f4efff;
    --ink-soft: #c2b8e6;
    --line: #07030f;
    --purple: #8a63ff;
    --purple-deep: #6b3dff;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}

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

.store-button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px 12px 16px;
  background: #0b0b10;
  color: #fff;
  text-decoration: none;
  border: var(--stroke) solid var(--line);
  border-radius: 18px;
  box-shadow: var(--offset) var(--offset) 0 var(--yellow);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.store-button:hover {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--yellow);
}

.store-button:active {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 var(--yellow);
}

.store-button__icon {
  width: 42px;
  height: 42px;
  flex: none;
}

.store-button__text {
  display: grid;
  line-height: 1.1;
  text-align: left;
}

.store-button__small {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.85;
}

.store-button__big {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  background: var(--purple);
  color: var(--on-purple);
  border: var(--stroke) solid var(--line);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.pill-link:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid color-mix(in srgb, var(--ink) 10%, transparent);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2.5px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
}

.nav a:not(.pill-link) {
  text-decoration: none;
  font-weight: 500;
  color: var(--ink-soft);
}

.nav a:not(.pill-link):hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

@media (max-width: 760px) {
  .nav a:not(.pill-link) {
    display: none;
  }
}

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

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 104px);
  background:
    radial-gradient(60% 60% at 88% 8%, color-mix(in srgb, var(--cyan) 22%, transparent), transparent 70%),
    radial-gradient(50% 55% at 6% 92%, color-mix(in srgb, var(--pink) 16%, transparent), transparent 70%),
    var(--bg);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.hero h1 {
  font-size: clamp(2.7rem, 5.4vw, 4.6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
}

.hero__lead {
  margin-top: 24px;
  max-width: 34rem;
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  color: var(--ink-soft);
}

.hero__cta {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px 32px;
}

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

.qr img {
  width: 92px;
  height: 92px;
  border: var(--stroke) solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.qr p {
  max-width: 11rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

@media (hover: none), (max-width: 900px) {
  .qr {
    display: none;
  }
}

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

.stage {
  position: relative;
  padding: clamp(16px, 4vw, 48px);
}

.stage .device {
  transform: rotate(-3deg);
}

.doodles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.doodles .ink {
  fill: none;
  stroke: var(--line);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-color-scheme: dark) {
  .doodles .ink {
    stroke: #f4efff;
  }
}

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }

  .stage {
    padding: 28px 8px 8px;
  }
}

/* The one orchestrated moment: outlines draw, then colour fills in. */
@media (prefers-reduced-motion: no-preference) {
  .doodles .ink {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: draw 0.9s ease-out var(--d, 0s) both;
  }

  .doodles .fill {
    animation: fill-in 0.45s ease-out calc(var(--d, 0s) + 0.75s) both;
  }

  .stage .device {
    animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.05s both;
  }

  @keyframes draw {
    from {
      stroke-dashoffset: 1;
    }
    to {
      stroke-dashoffset: 0;
    }
  }

  @keyframes fill-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(28px) rotate(-3deg);
    }
    to {
      opacity: 1;
      transform: translateY(0) rotate(-3deg);
    }
  }
}

/* ---------- Device frame ---------- */

.device {
  margin: 0;
}

.device__body {
  background: var(--device-body);
  border: var(--stroke) solid var(--line);
  border-radius: clamp(20px, 3.4vw, 40px);
  padding: clamp(5px, 0.9vw, 11px);
  box-shadow: var(--offset) var(--offset) 0 var(--line);
}

.device img {
  width: 100%;
  height: auto;
  border-radius: clamp(14px, 2.4vw, 30px);
  background: #fff;
}

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

.section {
  padding-block: clamp(64px, 9vw, 120px);
}

.section--soft {
  background: var(--bg-soft);
}

.section__head {
  max-width: 40rem;
}

.section h2 {
  font-size: clamp(2rem, 4.2vw, 3.2rem);
}

.section__intro {
  margin-top: 18px;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.1rem;
}

/* How it works: steps are a real sequence, so they are numbered. */

.how {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  margin-top: clamp(32px, 5vw, 56px);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.step {
  width: 100%;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 18px 20px;
  background: transparent;
  border: var(--stroke) solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.step:hover {
  border-color: color-mix(in srgb, var(--ink) 25%, transparent);
}

.step[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 5px 5px 0 var(--line);
  transform: translate(-1px, -1px);
}

.step__num {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: var(--stroke) solid var(--line);
  background: var(--yellow);
  color: #1a1038;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.step__title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.2;
}

.step__text {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}

.screens {
  display: grid;
}

.screens .device {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}

.screens .device.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (max-width: 900px) {
  .how {
    grid-template-columns: 1fr;
  }

  .screens {
    order: -1;
  }
}

/* Play together */

.play {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  margin-top: clamp(32px, 5vw, 56px);
}

.modes {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mode {
  padding-block: 22px;
  border-top: 2px solid color-mix(in srgb, var(--ink) 16%, transparent);
}

.mode:first-child {
  border-top: 0;
  padding-top: 0;
}

.mode h3 {
  font-size: 1.5rem;
}

.mode p {
  margin-top: 8px;
  max-width: 34rem;
  color: var(--ink-soft);
}

.mode__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 3px 10px;
  vertical-align: middle;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  color: #fff;
  background: var(--purple);
  border: 2px solid var(--line);
  border-radius: 999px;
}

.duo {
  position: relative;
  padding-bottom: 12%;
}

.duo .device:nth-child(2) {
  position: absolute;
  right: -3%;
  bottom: 0;
  width: 76%;
  transform: rotate(3deg);
}

.duo .device:nth-child(1) {
  width: 86%;
  transform: rotate(-2deg);
}

@media (max-width: 900px) {
  .play {
    grid-template-columns: 1fr;
  }
}

/* More: streaks, coins, gallery */

.more {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  margin-top: clamp(32px, 5vw, 56px);
}

.perks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.perk__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: var(--stroke) solid var(--line);
  border-radius: 16px;
  box-shadow: 3px 3px 0 var(--line);
  margin-bottom: 14px;
  color: #1a1038;
}

.perk__icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.perk:nth-child(1) .perk__icon {
  background: var(--yellow);
}
.perk:nth-child(2) .perk__icon {
  background: var(--cyan);
}
.perk:nth-child(3) .perk__icon {
  background: var(--pink);
}
.perk:nth-child(4) .perk__icon {
  background: #b9a2ff;
}

.perk h3 {
  font-size: 1.3rem;
}

.perk p {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .more {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .perks {
    grid-template-columns: 1fr;
  }
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.faq__side {
  position: sticky;
  top: 112px;
}

.faq__contact {
  margin-top: 28px;
  padding: 20px 22px;
  background: var(--surface);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--line);
}

.faq__contact p {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}

.faq__contact a {
  font-weight: 700;
  color: var(--purple);
  text-underline-offset: 4px;
}

.faq__list {
  display: grid;
  gap: 14px;
}

.qa {
  background: var(--surface);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 4px 4px 0 var(--line);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.qa[open] {
  box-shadow: 6px 6px 0 var(--purple);
}

.qa summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
}

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

.qa summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.25s ease;
}

.qa[open] summary::after {
  transform: translateY(3px) rotate(-135deg);
}

.qa__answer {
  padding: 0 22px 20px;
  max-width: 60ch;
  color: var(--ink-soft);
}

.qa__answer a {
  color: var(--purple);
  font-weight: 600;
  text-underline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .qa::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 0.28s ease, content-visibility 0.28s allow-discrete;
  }

  .qa[open]::details-content {
    block-size: auto;
  }

  :root {
    interpolate-size: allow-keywords;
  }
}

@media (max-width: 900px) {
  .faq {
    grid-template-columns: 1fr;
  }

  .faq__side {
    position: static;
  }
}

/* ---------- Final call to action ---------- */

.cta {
  background: var(--purple);
  color: var(--on-purple);
  padding-block: clamp(56px, 8vw, 104px);
  border-top: var(--stroke) solid var(--line);
  position: relative;
  overflow: hidden;
}

.cta__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px;
}

.cta h2 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
}

.cta p {
  margin-top: 16px;
  max-width: 32rem;
  font-size: 1.15rem;
  opacity: 0.92;
}

.cta__actions {
  margin-top: 32px;
}

.cta .qr img {
  width: 132px;
  height: 132px;
  box-shadow: var(--offset) var(--offset) 0 var(--yellow);
}

.cta .qr {
  flex-direction: column;
  align-items: flex-start;
}

.cta .qr p {
  margin: 0;
  color: #fff;
  opacity: 0.92;
}

.cta__icon {
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 280px;
  height: 280px;
  border-radius: 64px;
  border: var(--stroke) solid var(--line);
  transform: rotate(10deg);
  opacity: 0.18;
  pointer-events: none;
}

@media (max-width: 760px) {
  .cta__grid {
    grid-template-columns: 1fr;
  }
}

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

.site-footer {
  background: var(--bg);
  padding-block: 48px 56px;
  border-top: var(--stroke) solid var(--line);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: start;
}

.site-footer .brand {
  font-size: 1.35rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  font-weight: 600;
  text-underline-offset: 4px;
}

.site-footer__legal {
  grid-column: 1 / -1;
  max-width: 60rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

@media (max-width: 700px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

/* 404 */

.notfound {
  min-height: 70vh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 20px;
  padding-block: 80px;
}

.notfound h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
}

.notfound p {
  color: var(--ink-soft);
  max-width: 32rem;
}

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

  * {
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Hero doodle placement ---------- */

.stage .device {
  position: relative;
  z-index: 1;
}

.doodles {
  z-index: 2;
}

.doodles .d {
  position: absolute;
  display: block;
  overflow: visible;
}

.d-star {
  width: clamp(54px, 8vw, 92px);
  top: -2%;
  right: 1%;
  transform: rotate(12deg);
}

.d-spark {
  width: clamp(40px, 6vw, 64px);
  top: -3%;
  left: 4%;
}

.d-drop {
  width: clamp(34px, 4.6vw, 54px);
}

.d-drop-pink {
  left: -1%;
  bottom: 22%;
  transform: rotate(-14deg);
}

.d-drop-cyan {
  left: 7%;
  bottom: -2%;
  transform: rotate(8deg);
}

.d-drop-yellow {
  right: 3%;
  bottom: -3%;
  transform: rotate(-6deg);
}

.site-header.is-scrolled {
  box-shadow: 0 6px 0 -3px color-mix(in srgb, var(--ink) 8%, transparent);
}
