:root {
  --black: #06070a;
  --ink: #101827;
  --blue: #00d4ff;
  --orange: #f59b00;
  --white: #ffffff;
  --soft: #f5f7fb;
  --muted: #6b7280;
  font-family: Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 82% 6%, rgba(0, 212, 255, 0.18), transparent 30rem),
    linear-gradient(180deg, #050608, #111827 42rem, var(--soft) 42rem);
  color: var(--ink);
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  background: rgba(6, 7, 10, 0.78);
  color: var(--white);
  backdrop-filter: blur(18px);
}

.brand,
nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand {
  font-weight: 900;
}

.brand span {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #001014;
}

nav {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.hero {
  display: grid;
  min-height: calc(100vh - 72px);
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.62fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(3rem, 7vw, 7rem) clamp(1rem, 4vw, 4rem);
  color: var(--white);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Montserrat, Inter, sans-serif;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 8ch;
  font-size: clamp(4rem, 9vw, 9rem);
  line-height: 0.82;
}

.hero p {
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.65;
}

.hero-actions,
.actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 1.15rem;
  font-weight: 900;
  cursor: pointer;
}

.primary {
  background: var(--blue);
  color: #001014;
}

.ghost {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.hero-card,
.preview-wrap {
  display: grid;
  gap: 0.65rem;
  place-items: center;
}

.preview-wrap {
  position: sticky;
  top: 5.2rem;
  align-self: start;
}

canvas {
  width: min(100%, 27rem);
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  background: #101827;
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.28);
  touch-action: none;
  user-select: none;
}

.steps,
.studio,
.gallery,
footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 4rem 0;
}

.steps article,
.studio-panel,
.gallery-card {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 1rem 2rem rgba(17, 24, 39, 0.05);
}

.steps article {
  padding: 1.3rem;
}

.steps strong {
  color: var(--orange);
}

.steps p,
.studio p,
.gallery p,
footer span {
  color: var(--muted);
  line-height: 1.6;
}

.studio {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(20rem, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 2rem 0 4rem;
}

.studio-panel {
  display: grid;
  gap: 1rem;
  padding: 1.3rem;
}

.studio h2,
.gallery h2 {
  max-width: 12ch;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.96;
}

form {
  display: grid;
  gap: 0.8rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  padding: 0.85rem;
  background: #fff;
}

.fit-tools {
  display: grid;
  gap: 0.45rem;
  width: min(100%, 27rem);
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 12px;
  padding: 0.7rem;
  background: #f8fafc;
  justify-items: center;
}

.fit-tools strong,
.fit-tools span {
  display: block;
}

.fit-tools strong {
  color: var(--ink);
}

.fit-tools span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.fit-tools input[type="range"] {
  padding: 0;
  accent-color: var(--orange);
}

.nudge-grid {
  display: grid;
  width: min(100%, 17rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    ". up ."
    "left center right"
    ". down .";
  gap: 0.4rem;
}

.nudge-grid button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}

.nudge-grid button[data-nudge="up"] {
  grid-area: up;
}

.nudge-grid button[data-nudge="left"] {
  grid-area: left;
}

.nudge-grid button[data-nudge="center"] {
  grid-area: center;
}

.nudge-grid button[data-nudge="right"] {
  grid-area: right;
}

.nudge-grid button[data-nudge="down"] {
  grid-area: down;
}

.nudge-grid button[data-nudge="center"] {
  background: var(--orange);
  color: #1c1200;
  font-size: 0.75rem;
}

.zoom-control {
  width: 100%;
  gap: 0.2rem;
}

.zoom-control input {
  min-height: 2.6rem;
}

.studio-panel .ghost {
  border-color: rgba(17, 24, 39, 0.14);
  color: var(--ink);
}

.firebase-box {
  display: grid;
  gap: 0.7rem;
  border: 1px solid rgba(0, 212, 255, 0.22);
  border-radius: 12px;
  padding: 1rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(0, 212, 255, 0.12), transparent 12rem),
    #f8fafc;
}

.firebase-box strong,
.firebase-box span {
  display: block;
}

.firebase-box span {
  color: var(--muted);
  line-height: 1.45;
}

.firebase-login {
  display: grid;
  gap: 0.55rem;
}

.firebase-login.is-hidden {
  display: none;
}

.gallery {
  display: grid;
  gap: 1rem;
  padding: 3rem 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.gallery-card {
  overflow: hidden;
}

.gallery-empty {
  grid-column: 1 / -1;
  padding: 1rem;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.72);
}

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

.gallery-card div {
  padding: 0.9rem;
}

.gallery-card strong,
.gallery-card span {
  display: block;
}

.gallery-card span {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 4rem 0 2rem;
}

@media print {
  body > *:not(.print-area) {
    display: none !important;
  }
}

@media (max-width: 860px) {
  .hero,
  .steps,
  .studio,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  nav {
    overflow-x: auto;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-wrap {
    position: static;
    order: -1;
  }

}
