
:root {
  --ink: #172033;
  --muted: #68738a;
  --line: #e7eaf2;
  --primary: #5146e5;
  --teal: #17b89b;
  --bg: #f7f8fc;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, "Segoe UI", sans-serif;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.wrap {
  width: min(1100px, calc(100% - 32px));
  margin: auto;
}

/* Header and navigation */

header {
  position: sticky;
  top: 0;
  background: #ffffffed;
  border-bottom: 1px solid var(--line);
  z-index: 5;
  backdrop-filter: blur(12px);
}

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

.brand {
  font-size: 1.4rem;
  font-weight: 850;
  white-space: nowrap;
}

.brand:hover {
  color: var(--ink);
}

.mark {
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: white;
  border-radius: 11px;
  width: 34px;
  height: 34px;
  margin-right: 8px;
}

.links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  color: #58647a;
}

.links a {
  font-size: .95rem;
  font-weight: 600;
}

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

/* Buttons */

.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 750;
  cursor: pointer;
  text-align: center;
  transition: background .2s, transform .2s, box-shadow .2s;
}

.btn:hover {
  color: white;
  background: #4035cc;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px #5146e526;
}

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.btn.light {
  background: #eeefff;
  color: var(--primary);
}

.btn.light:hover {
  background: #e1e2ff;
  color: #4035cc;
}

/* Hero */

.hero {
  padding: 70px 0;
  background:
    radial-gradient(ellipse at 75% 10%, #e5e4ff, transparent 40%),
    radial-gradient(ellipse at 10% 20%, #dcfaf3, transparent 35%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 35px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.7rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -2px;
  margin: 15px 0;
}

.grad {
  background: linear-gradient(100deg, var(--primary), var(--teal));
  color: transparent;
  background-clip: text;
}

.hero p,
.muted {
  color: var(--muted);
}

.art {
  border-radius: 28px;
  padding: 35px;
  background: linear-gradient(135deg, #262653, #5146e5, #13ad9a);
  color: white;
  font-size: 4rem;
  text-align: center;
  box-shadow: 0 20px 50px #5146e533;
}

.art small {
  font-size: 1rem;
}

/* Sections and cards */

.section {
  padding: 58px 0;
}

.center {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 30px;
}

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

.card,
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}

.card {
  transition: transform .2s, box-shadow .2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px #1720330d;
}

.card h3 {
  margin: 10px 0 4px;
}

.card p {
  color: var(--muted);
  font-size: .94rem;
}

.ico {
  font-size: 1.8rem;
}

/* Page headings */

.pagehead {
  text-align: center;
  padding: 55px 0 25px;
  background: radial-gradient(ellipse at 50% 0, #e6e5ff, transparent 60%);
}

.pagehead h1 {
  font-size: clamp(2.2rem, 5vw, 3.3rem);
  margin: 8px;
}

/* Tool panels */

.panel {
  max-width: 850px;
  margin: 25px auto;
  padding: 28px;
}

.drop {
  border: 2px dashed #c9c9e9;
  background: #fafaff;
  border-radius: 17px;
  text-align: center;
  padding: 30px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.drop:hover,
.drop.drag {
  border-color: var(--primary);
  background: #f1f0ff;
}

.drop input {
  display: none;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 20px 0;
}

.controls label {
  display: block;
  font-weight: 700;
  margin-bottom: 5px;
}

.controls input,
.controls select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
}

.controls input[type="range"] {
  padding: 8px 0;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.preview div {
  min-width: 0;
  background: #f3f4f8;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.preview img {
  display: block;
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 10px auto;
}

.preview p {
  overflow-wrap: anywhere;
}

.status {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status.success {
  color: #087b5d;
}

.status.error {
  color: #c03939;
}

.hidden {
  display: none !important;
}

.notice {
  background: #effbf7;
  border: 1px solid #ccefe6;
  color: #176c5d;
  border-radius: 12px;
  padding: 14px;
}

/* Informational content */

.content-section {
  max-width: 850px;
  margin: 35px auto 0;
  color: #59647a;
}

.content-section h2 {
  color: var(--ink);
  font-size: 1.45rem;
  margin: 28px 0 8px;
}

.content-section h2:first-child {
  margin-top: 0;
}

.content-section a,
.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content-section a:hover,
.prose a:hover {
  color: #3026bd;
}

.prose {
  max-width: 820px;
  margin: auto;
}

.prose p,
.prose li {
  color: #59647a;
}

.prose h2 {
  margin-top: 28px;
}

/* Footer */

footer {
  background: #171c32;
  color: #dce1f1;
  padding: 40px 0;
  margin-top: 50px;
}

footer p {
  color: #aab2c9;
}

footer .brand:hover {
  color: white;
}

.footgrid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 25px;
}

.footlinks {
  display: grid;
  gap: 8px;
  color: #cbd1e1;
}

.footlinks a:hover {
  color: white;
}

.copyright {
  border-top: 1px solid #ffffff25;
  margin-top: 25px;
  padding-top: 15px;
  color: #aab2c9;
  font-size: .9rem;
}

/* Keyboard accessibility */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #8d86ff;
  outline-offset: 3px;
}

/* Tablet */

@media (max-width: 760px) {
  .nav {
    min-height: 72px;
    padding: 12px 0;
    flex-wrap: wrap;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav > .btn {
    display: none;
  }

  .links {
    gap: 14px;
  }
}

/* Mobile */

@media (max-width: 520px) {
  .nav {
    justify-content: center;
    gap: 10px 18px;
  }

  .brand {
    width: 100%;
    text-align: center;
  }

  .links {
    width: 100%;
    justify-content: center;
    gap: 8px 16px;
    font-size: .9rem;
  }

  .links a {
    font-size: .88rem;
  }

  .grid,
  .controls,
  .preview,
  .footgrid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 45px 0;
  }

  .hero h1 {
    letter-spacing: -1px;
  }

  .art {
    padding: 25px;
    font-size: 3rem;
  }

  .panel {
    padding: 16px;
  }

  .drop {
    padding: 22px 12px;
  }

  .actions .btn {
    flex: 1 1 100%;
  }

  .pagehead {
    padding: 40px 0 20px;
  }

  .section {
    padding: 40px 0;
  }
}
