/* CreatePad website. Colours follow the app's design tokens (src/constants/theme.ts). */

:root {
  --bg: #111111;
  --bg-deep: #000000;
  --surface: #1b1b1b;
  --surface-raised: #222222;
  --surface-strong: #262626;
  --border: #2c2c2c;
  --border-strong: #444444;
  --text: #ffffff;
  --text-2: #b3b3b3;
  --text-3: #888888;
  --accent: #8a50ff;
  --accent-text: #a57bff;
  --accent-soft: rgba(138, 80, 255, 0.16);
  --accent-border: rgba(138, 80, 255, 0.6);
  --accent-surface: #1a1030;
  --blue: #075bff;
  --fill-bg: rgba(255, 196, 0, 0.14);
  --fill-text: #ffd166;

  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1120px;
  --header-h: 64px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: rgba(165, 123, 255, 0.4);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17, 17, 17, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav a[aria-current="page"] {
  color: var(--text);
}

@media (max-width: 560px) {
  .nav .nav-optional {
    display: none;
  }
  .site-header .wrap {
    gap: 12px;
  }
  .nav a {
    padding: 8px 10px;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #9761ff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--text-3);
  background: var(--surface);
}

.btn-sm {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 14px;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.play-btn {
  min-height: 56px;
  padding: 10px 24px 10px 20px;
  background: #fff;
  color: #000;
  text-align: left;
}

.play-btn:hover {
  background: #e9e9e9;
}

.play-btn svg {
  width: 26px;
  height: 26px;
}

.play-btn span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.play-btn small {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Landing: hero */

.hero {
  position: relative;
  padding: 72px 0 88px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 720px;
  background:
    radial-gradient(42% 50% at 72% 40%, rgba(138, 80, 255, 0.28), rgba(138, 80, 255, 0)),
    radial-gradient(30% 40% at 90% 10%, rgba(7, 91, 255, 0.22), rgba(7, 91, 255, 0));
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin-top: 20px;
  font-size: clamp(40px, 6vw, 68px);
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #a57bff, #6f8cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede {
  margin-top: 20px;
  max-width: 520px;
  font-size: 18px;
  color: var(--text-2);
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-3);
}

.stack {
  position: relative;
  height: 520px;
}

.stack figure {
  position: absolute;
  margin: 0;
  width: 58%;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  background: var(--surface);
}

.stack figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stack figure:nth-child(1) {
  left: 0;
  top: 40px;
  transform: rotate(-7deg);
}

.stack figure:nth-child(2) {
  right: 0;
  top: 0;
  transform: rotate(6deg);
}

.stack figure:nth-child(3) {
  left: 21%;
  top: 90px;
  z-index: 2;
}

@media (max-width: 880px) {
  .hero {
    padding: 48px 0 64px;
  }
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .stack {
    height: auto;
    aspect-ratio: 1 / 1;
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
  }
  .stack figure {
    width: 56%;
  }
  .stack figure:nth-child(1) {
    top: 8%;
  }
  .stack figure:nth-child(3) {
    top: 14%;
  }
}

/* Landing: sections */

.section {
  padding: 88px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin-bottom: 40px;
}

.section-head h2 {
  font-size: clamp(30px, 4vw, 42px);
}

.section-head p {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 17px;
}

.kicker {
  display: block;
  margin-bottom: 12px;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.templates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.template {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.template img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.template figcaption {
  padding: 16px 18px 20px;
}

.template h3 {
  font-size: 18px;
  font-weight: 700;
}

.template p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 15px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
  padding: 0;
  margin: 0;
  list-style: none;
}

.steps li,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 800;
}

.steps h3,
.card h3 {
  font-size: 18px;
  font-weight: 700;
}

.steps p,
.card p {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 15px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card .icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.card .icon svg {
  width: 22px;
  height: 22px;
}

.section-foot {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta {
  text-align: center;
  padding: 72px 24px;
  border-radius: 24px;
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(138, 80, 255, 0.35), rgba(138, 80, 255, 0)),
    var(--accent-surface);
  border: 1px solid rgba(138, 80, 255, 0.3);
}

.cta h2 {
  font-size: clamp(28px, 4vw, 40px);
}

.cta p {
  margin: 12px auto 28px;
  max-width: 480px;
  color: var(--text-2);
}

@media (max-width: 880px) {
  .section {
    padding: 64px 0;
  }
  .templates,
  .steps {
    grid-template-columns: 1fr;
  }
  .templates {
    max-width: 420px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}

/* Footer */

.site-footer {
  margin-top: 88px;
  padding: 40px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--text-2);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

/* Legal pages */

.doc-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(50% 120% at 85% 0%, rgba(138, 80, 255, 0.18), rgba(138, 80, 255, 0));
}

.doc-hero h1 {
  font-size: clamp(34px, 5vw, 52px);
}

.doc-hero .lede {
  margin-top: 14px;
  max-width: 640px;
  color: var(--text-2);
  font-size: 17px;
}

.meta {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.chip strong {
  color: var(--text);
  font-weight: 700;
}

.doc-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  padding-top: 48px;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
}

.toc-title {
  margin-bottom: 10px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--border);
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.toc a:hover {
  color: var(--text);
}

.toc a.active {
  color: var(--text);
  border-left-color: var(--accent);
}

.prose {
  max-width: 760px;
  color: var(--text-2);
}

.prose section + section {
  margin-top: 56px;
}

.prose h2 {
  margin-bottom: 18px;
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
}

.prose h2 .num {
  color: var(--accent-text);
  margin-right: 6px;
}

.prose h3 {
  margin: 28px 0 10px;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
}

.prose p,
.prose ul,
.prose ol,
.prose .table-wrap,
.prose .callout,
.prose .card {
  margin-top: 0;
  margin-bottom: 16px;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li + li {
  margin-top: 6px;
}

.prose li::marker {
  color: var(--accent-text);
}

.prose strong {
  color: var(--text);
  font-weight: 700;
}

.prose code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--text);
}

.callout {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent-surface);
  border: 1px solid rgba(138, 80, 255, 0.35);
  color: var(--text);
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose th {
  background: var(--surface-raised);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.prose td {
  background: var(--surface);
}

.prose td:first-child {
  color: var(--text);
  font-weight: 700;
}

.contact-list {
  list-style: none;
  padding: 0 !important;
  display: grid;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--border);
}

.contact-list li {
  margin: 0 !important;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
}

.contact-list span:first-child {
  color: var(--text-3);
  font-weight: 600;
}

.contact-list span:last-child {
  color: var(--text);
}

/* Placeholder text that still needs a real value before launch. */
.fill {
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px dashed rgba(255, 209, 102, 0.6);
  background: var(--fill-bg);
  color: var(--fill-text);
  font-weight: 600;
  white-space: nowrap;
}

.steps-list {
  counter-reset: item;
  list-style: none;
  padding-left: 0 !important;
}

.steps-list > li {
  position: relative;
  padding-left: 44px;
  min-height: 30px;
}

.steps-list > li + li {
  margin-top: 14px;
}

.steps-list > li::before {
  counter-increment: item;
  content: counter(item);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 800;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.option-grid .card h3 {
  margin: 0;
}

.option-grid .card p {
  margin-bottom: 0;
}

.badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 960px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .toc {
    position: static;
    max-height: none;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }
  .toc ol {
    border-left: 0;
    columns: 2;
    column-gap: 24px;
  }
  .toc a {
    margin-left: 0;
    padding: 5px 0;
    border-left: 0;
  }
  .toc a.active {
    color: var(--text-3);
  }
}

@media (max-width: 640px) {
  .toc ol {
    columns: 1;
  }
  .option-grid {
    grid-template-columns: 1fr;
  }
  .contact-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  /* Tables become one card per row on phones. */
  .table-wrap {
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
  .prose table,
  .prose tbody,
  .prose tr,
  .prose td {
    display: block;
  }
  .prose thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .prose tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
  }
  .prose tr + tr {
    margin-top: 12px;
  }
  .prose td {
    padding: 4px 16px 12px;
    border: 0;
  }
  .prose td:first-child {
    padding-top: 14px;
    padding-bottom: 8px;
    font-size: 16px;
  }
  .prose td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .fill {
    white-space: normal;
  }
}

/* 404 */

.center-page {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 64px 0;
}

.center-page h1 {
  font-size: clamp(36px, 6vw, 56px);
}

.center-page p {
  margin: 12px 0 28px;
  color: var(--text-2);
}

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

.doc-single {
  padding-top: 48px;
}

.card .steps-list {
  margin: 16px 0 0;
}
