/*
 * Tutorials and guides (pages generated by seo/build.mjs). A clean reading layout like a drawing-tutorial
 * site: white pages, Poppins headings, a comfortable column of body text and the app's line-art
 * illustrations. The brand shows in the violet accents and the yellow download button, without the
 * landing page's gradients and animations.
 */

@font-face { font-family: "Poppins"; src: url("../fonts/poppins-semibold.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-extrabold.woff") format("woff"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-black.woff") format("woff"); font-weight: 900; font-display: swap; }

:root {
  --violet: #5c34ec;
  --violet-deep: #4421c2;
  --night: #220c4a;
  --yellow: #ffe05c;
  --yellow-top: #ffe97a;
  --yellow-bottom: #ffc93c;
  --ink: #2b1d52;
  --text: #3d3557;
  --muted: #6b6485;
  --line: #ebe7f5;
  --soft: #f4f1fe;
  --paper: #faf9fe;

  --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); text-wrap: balance; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 1em; height: 1em; flex: none; }

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 12px; background: var(--yellow); color: var(--night);
  font: 800 15px var(--font-display); text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { height: var(--header-h); display: flex; align-items: center; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand span { font: 900 19px var(--font-display); letter-spacing: -0.01em; }

.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  padding: 7px 13px;
  border-radius: 999px;
  font: 700 15px var(--font-display);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover,
.nav a[aria-current="page"] { background: var(--soft); color: var(--violet); }

.get-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--yellow-top), var(--yellow-bottom));
  color: var(--night);
  font: 800 14.5px var(--font-display);
  text-decoration: none;
  white-space: nowrap;
  flex: none;
  box-shadow: 0 8px 18px -12px rgba(34, 12, 74, 0.6);
  transition: transform 0.2s ease;
}
.get-app:hover { transform: translateY(-1px); }
.get-app .icon { width: 17px; height: 17px; }

@media (max-width: 560px) {
  .header-row { gap: 10px; }
  .brand span, .nav-app { display: none; }
  .nav { margin-left: 4px; }
  .nav a { padding: 6px 9px; font-size: 14px; }
  .get-app { margin-left: auto; padding: 0 12px; font-size: 14px; }
}
@media (max-width: 359px) {
  .nav { display: none; }
}

/* ---------- Article ---------- */

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 720px) 270px;
  justify-content: space-between;
  gap: 56px;
  padding-block: 32px 72px;
}

.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; font: 600 14px var(--font-display); color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: #b5aecb; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--violet); }

.kicker { margin: 0 0 12px; font: 800 13px/1.3 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet); }

.article-head h1,
.hub-head h1 { margin: 0; font-size: clamp(31px, 4.4vw, 46px); font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; }

.lead { margin: 18px 0 0; font-size: clamp(18px, 1.6vw, 20px); line-height: 1.6; color: var(--text); }

.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 22px 0 0; padding: 0; list-style: none; font: 600 14.5px var(--font-display); color: var(--muted); }
.facts li { display: inline-flex; align-items: center; gap: 7px; }
.facts .icon { width: 17px; height: 17px; color: var(--violet); }

.figure { margin: 30px 0; }
.figure img { width: 100%; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.figure.narrow img { margin-inline: auto; }
.figure figcaption { margin-top: 10px; font-size: 15px; line-height: 1.55; color: var(--muted); text-align: center; }

.needs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 28px;
  padding: 14px 18px;
  border: 1.5px dashed #d9d2ee;
  border-radius: 14px;
}
.needs p { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 800 14.5px var(--font-display); color: var(--ink); }
.needs p .icon { width: 18px; height: 18px; color: var(--violet); }
.needs ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.needs li { padding: 3px 12px; border-radius: 999px; background: var(--soft); font: 600 14px/1.6 var(--font-display); color: var(--text); }

.takeaways { margin: 0 0 36px; padding: 22px 24px; border-radius: 16px; background: var(--soft); border-left: 4px solid var(--violet); }
.takeaways h2 { margin: 0 0 12px; font-size: 14px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet); }
.takeaways ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.takeaways li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; line-height: 1.6; }
.takeaways .icon { width: 18px; height: 18px; margin-top: 4px; color: var(--violet); }

.lead a,
.takeaways a,
.prose :is(p, li, figcaption) a {
  color: var(--violet);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(92, 52, 236, 0.35);
}
.lead a:hover,
.takeaways a:hover,
.prose :is(p, li, figcaption) a:hover { text-decoration-color: currentColor; }
.article strong { color: var(--ink); }

.prose > section { margin-top: 52px; }
.prose > section:first-child { margin-top: 36px; }
.prose h2 { margin: 0 0 16px; font-size: clamp(25px, 2.6vw, 31px); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; text-wrap: pretty; }
.prose p { margin: 0 0 18px; }

.dot-list { display: grid; gap: 10px; margin: 6px 0 22px; padding: 0; list-style: none; }
.dot-list li { position: relative; padding-left: 24px; }
.dot-list li::before { content: ""; position: absolute; left: 5px; top: 0.72em; width: 7px; height: 7px; border-radius: 50%; background: var(--violet); }

.avoid-list { display: grid; gap: 12px; margin: 6px 0 22px; padding: 0; list-style: none; }
.avoid-list li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; }
.avoid-list .icon { width: 22px; height: 22px; margin-top: 4px; padding: 5px; border-radius: 50%; background: #fde4ea; color: #c2255a; }

.num-list { display: grid; gap: 12px; margin: 6px 0 22px; padding: 0; list-style: none; counter-reset: n; }
.num-list li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; counter-increment: n; }
.num-list li::before {
  content: counter(n);
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--violet);
  font: 800 14px/30px var(--font-display);
  text-align: center;
}

/* The steps of a tutorial: "STEP 1" + title, the instruction, then the drawing. */
.steps { display: grid; gap: 36px; margin: 30px 0 8px; padding: 0; list-style: none; }
.step + .step { padding-top: 36px; border-top: 1px solid var(--line); }
.step h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; font-size: 21px; font-weight: 800; line-height: 1.3; }
.step-num {
  display: inline-flex;
  align-items: center;
  height: 27px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.step p { margin: 0; }
.step .figure { margin: 18px 0 0; }

.callout { display: grid; grid-template-columns: 22px 1fr; gap: 12px; margin: 26px 0; padding: 16px 20px; border-radius: 14px; }
.callout .icon { width: 22px; height: 22px; margin-top: 2px; }
.callout strong { display: block; margin-bottom: 3px; font: 800 13px/1.4 var(--font-display); letter-spacing: 0.07em; text-transform: uppercase; }
.callout p { margin: 0; font-size: 17px; line-height: 1.65; }
.callout-tip { background: #f3f0ff; }
.callout-tip .icon, .callout-tip strong { color: var(--violet); }
.callout-mistake { background: #fff1f4; }
.callout-mistake .icon, .callout-mistake strong { color: #c2255a; }
.callout-exercise { background: #fff8d9; }
.callout-exercise .icon, .callout-exercise strong { color: #8a5b00; }

.faq { margin-top: 56px; }
.faq h2 { margin-bottom: 18px; }
.faq details { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.faq details[open] { border-color: #d6ccf7; }
.faq summary {
  position: relative;
  padding: 16px 54px 16px 20px;
  font: 700 17px/1.45 var(--font-display);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  border-radius: 50%;
  background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c34ec' stroke-width='2.8' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 14px no-repeat;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 20px 18px; }

/* ---------- The app, once in the article ---------- */

.app-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 28px;
  align-items: center;
  margin: 52px 0 8px;
  padding: 28px 30px;
  border-radius: 22px;
  border: 1px solid #e6defb;
  background: linear-gradient(135deg, #f5f1ff 0%, #fbf3fb 100%);
}
.app-card::before {
  /* the app's screentone, in one corner */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle, rgba(92, 52, 236, 0.13) 1.7px, transparent 2.2px) 0 0 / 16px 16px,
    radial-gradient(circle, rgba(92, 52, 236, 0.13) 1.7px, transparent 2.2px) 8px 8px / 16px 16px;
  -webkit-mask-image: radial-gradient(circle at 100% 0, #000 0, transparent 300px);
  mask-image: radial-gradient(circle at 100% 0, #000 0, transparent 300px);
}
.app-card p { margin: 0 0 14px; font-size: 17px; line-height: 1.65; }
.app-card .app-card-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font: 800 13px/1.3 var(--font-display); letter-spacing: 0.07em; text-transform: uppercase; color: var(--violet); }
.app-card-kicker img { border-radius: 8px; }
.app-card .app-card-title { margin: 0 0 8px; font: 800 23px/1.25 var(--font-display); color: var(--ink); text-wrap: balance; }
.app-card .app-card-week { padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.75); font-size: 15.5px; line-height: 1.5; }
.app-card-week span { display: block; margin-bottom: 2px; font: 800 12px/1.4 var(--font-display); letter-spacing: 0.07em; text-transform: uppercase; color: var(--violet); }
.app-card .fine { margin: 10px 0 0; font: 600 13px/1.4 var(--font-display); color: var(--muted); }
.app-card-visual img { border-radius: 18px; box-shadow: 0 18px 40px -22px rgba(34, 12, 74, 0.6); transform: rotate(2deg); }

.badge-play {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 18px 0 14px;
  border-radius: 12px;
  background: #0b0616;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.badge-play:hover { transform: translateY(-2px); }
.badge-play .badge-icon { width: 24px; height: 26px; }
.badge-play span { display: grid; line-height: 1.1; }
.badge-play small { font: 600 10px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; }
.badge-play strong { font: 700 18px var(--font-display); color: #fff; }

@media (max-width: 640px) {
  .app-card { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
  .app-card-visual { width: 170px; margin: 0 auto; grid-row: 1; }
}

/* ---------- Sidebar ---------- */

.article-side {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  display: grid;
  gap: 24px;
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.toc p { margin: 0 0 12px; font: 800 12.5px var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.toc ol { display: grid; gap: 9px; margin: 0; padding: 0 0 0 14px; list-style: none; border-left: 2px solid var(--line); }
.toc a { display: block; font: 600 14.5px/1.4 var(--font-display); color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--violet); }

.side-app { padding: 20px; border-radius: 18px; background: var(--soft); }
.side-app img { border-radius: 12px; }
.side-app .side-app-title { margin: 12px 0 6px; font: 800 17px/1.3 var(--font-display); color: var(--ink); }
.side-app p { margin: 0 0 14px; font-size: 15px; line-height: 1.55; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font: 800 14.5px var(--font-display);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.btn:hover { background: var(--violet-deep); }
.btn .icon { width: 17px; height: 17px; }

.toc-mobile { display: none; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 14px; }
.toc-mobile summary { display: flex; align-items: center; gap: 10px; padding: 13px 18px; font: 800 15px var(--font-display); color: var(--ink); cursor: pointer; list-style: none; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary .icon { width: 20px; height: 20px; color: var(--violet); }
.toc-mobile ol { display: grid; gap: 8px; margin: 0; padding: 0 18px 16px 48px; }
.toc-mobile a { font: 600 15px/1.4 var(--font-display); color: var(--text); text-decoration: none; }

@media (max-width: 1000px) {
  .article-grid { grid-template-columns: minmax(0, 1fr); max-width: 768px; margin-inline: auto; }
  .article-side { display: none; }
  .toc-mobile { display: block; }
}

/* ---------- Cards (related pages and hubs) ---------- */

.related { padding: 56px 0 72px; background: var(--paper); border-top: 1px solid var(--line); }
.related h2 { margin: 0 0 24px; font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 22px; }
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-3px); border-color: #d6ccf7; box-shadow: 0 18px 36px -24px rgba(34, 12, 74, 0.45); }
.card-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: #fff; border-bottom: 1px solid var(--line); }
.card-level {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  font: 700 12px/1.6 var(--font-display);
  color: var(--text);
}
.card-thumb img { width: 100%; height: 100%; object-fit: contain; }
.card-mark { width: 40px; height: 40px; color: var(--violet); opacity: 0.4; }
.card-body { padding: 16px 18px 20px; }
.card-meta { margin: 0 0 6px; font: 800 12px/1.4 var(--font-display); letter-spacing: 0.07em; text-transform: uppercase; color: var(--violet); }
.card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; line-height: 1.3; }
.card-body p:last-child { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }

/* ---------- Hubs ---------- */

.hub-head { padding: 36px 0 40px; background: var(--paper); border-bottom: 1px solid var(--line); }
.hub-head .lead { max-width: 720px; }
.topic-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.topic-nav a {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font: 700 14px/1.6 var(--font-display);
  color: var(--text);
  text-decoration: none;
}
.topic-nav a:hover { border-color: var(--violet); color: var(--violet); }
.hub-body { padding-block: 12px 72px; }
.hub-group { margin-top: 44px; }
.hub-group h2 { margin: 0 0 18px; font-size: clamp(22px, 2.4vw, 27px); font-weight: 800; }
.hub-empty { margin: 44px 0 0; color: var(--muted); }
.hub-note { margin: -8px 0 22px; color: var(--muted); }
.hub-empty a { color: var(--violet); font-weight: 600; }
.hub-body .app-card { margin-top: 64px; }

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

.site-footer { padding: 56px 0 32px; background: var(--night); color: rgba(255, 255, 255, 0.75); font-size: 15px; line-height: 1.6; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand img { border: 1.5px solid rgba(255, 255, 255, 0.7); }
.footer-brand p { max-width: 30ch; margin: 12px 0 18px; }
.footer-col h2 { margin: 0 0 14px; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }
.footer-col h2 a { color: inherit; text-decoration: none; }
.footer-col ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.footer-col a { color: rgba(255, 255, 255, 0.75); text-decoration: none; }
.footer-col a:hover { color: var(--yellow); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .article-grid { padding-top: 22px; }
  .step h3 { font-size: 19px; }
  .figure img { border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
