:root {
  color-scheme: dark;
  --black: #050505;
  --black-soft: #0d0b09;
  --panel: rgba(12, 11, 9, 0.96);
  --cream: #ffe9b9;
  --cream-soft: #f6dfb3;
  --orange: #d65100;
  --orange-bright: #f06a00;
  --red: #8d1f03;
  --white: #f4f4f4;
  --muted: #bcae96;
  --line: rgba(214, 81, 0, 0.5);
  --radius: 5px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--white);
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 81, 0, 0.12), transparent 29rem),
    linear-gradient(180deg, #090806 0%, #050505 42%, #000 100%);
}

button,
input,
label {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

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

.shell {
  width: min(100% - 28px, 780px);
  margin-inline: auto;
}

/* HERO */
.hero {
  position: relative;
  isolation: isolate;
  min-height: min(820px, 94vh);
  overflow: hidden;
  display: grid;
  align-items: end;
  border-bottom: 3px solid var(--orange);
  background:
    url("assets/hero-guidance.jpg") center top / cover no-repeat;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.04) 0%,
      rgba(0, 0, 0, 0.10) 46%,
      rgba(0, 0, 0, 0.86) 78%,
      rgba(0, 0, 0, 0.98) 100%
    );
}

.hero__content {
  padding: max(54px, env(safe-area-inset-top)) 0 38px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--orange-bright);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
.frame-card__text strong,
.upload-button strong,
.button,
.howto strong,
footer strong {
  font-family: "Anton", Impact, sans-serif;
  font-weight: 400;
  letter-spacing: 0.025em;
}

h1 {
  display: grid;
  gap: 0;
  margin: 15px 0 0;
  line-height: 0.88;
  text-transform: uppercase;
  filter: drop-shadow(0 7px 6px rgba(0, 0, 0, 0.75));
}

.hero__title-main {
  color: var(--cream);
  font-size: clamp(3rem, 15vw, 6.4rem);
}

.hero__title-accent {
  color: #c52c0b;
  font-size: clamp(2.85rem, 14vw, 6rem);
  text-shadow:
    0 2px 0 #5b1005,
    0 5px 0 rgba(0, 0, 0, 0.6);
}

.hero__tagline {
  margin: 17px 0 0;
  color: var(--cream);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.hero__tagline span {
  color: var(--orange-bright);
}

.hero__copy {
  max-width: 560px;
  margin: 15px auto 0;
  color: #f3e7d2;
  font-size: 0.94rem;
  line-height: 1.5;
}

.privacy-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 17px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 233, 185, 0.27);
  color: #f1dfc2;
  background: rgba(0, 0, 0, 0.64);
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.hero__cta {
  display: flex;
  width: min(100%, 330px);
  min-height: 50px;
  align-items: center;
  justify-content: center;
  margin: 20px auto 0;
  color: var(--cream);
  text-decoration: none;
  font-family: "Anton", Impact, sans-serif;
  letter-spacing: 0.05em;
  background: linear-gradient(180deg, #e55b00 0%, #8d1f03 100%);
  border: 1px solid #ff7b13;
  box-shadow: 0 13px 28px rgba(0, 0, 0, 0.38);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

/* CONTENT */
.main {
  display: grid;
  gap: 16px;
  padding-block: 18px 48px;
}

.panel {
  position: relative;
  padding: 17px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(214, 81, 0, 0.08), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow);
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 11px;
  width: 84px;
  height: 3px;
  background: linear-gradient(90deg, var(--orange-bright), var(--red));
}

.section-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 15px;
}

.section-heading--compact {
  margin-bottom: 13px;
}

.section-heading h2,
.howto h2 {
  margin: 2px 0 0;
  color: var(--cream);
  font-size: 1.55rem;
  line-height: 1;
}

.section-heading p:not(.section-kicker) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.step {
  display: grid;
  flex: 0 0 auto;
  width: 41px;
  height: 41px;
  place-items: center;
  border: 1px solid #f06a00;
  color: var(--cream);
  background: linear-gradient(180deg, #d65100, #7d1b03);
  font-family: "Anton", Impact, sans-serif;
  font-size: 0.96rem;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

/* FRAME CARDS */
.frame-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.frame-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 7px;
  overflow: hidden;
  border: 1px solid rgba(214, 81, 0, 0.43);
  color: var(--white);
  text-align: left;
  background: #070707;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.frame-card:active {
  transform: scale(0.985);
}

.frame-card.is-active {
  border-color: #ff7110;
  box-shadow:
    0 0 0 2px rgba(240, 106, 0, 0.18),
    0 12px 28px rgba(0, 0, 0, 0.32);
}

.thumb {
  position: relative;
  display: grid;
  width: 100%;
  overflow: hidden;
  place-items: center;
  background:
    linear-gradient(45deg, #231b14 25%, transparent 25%),
    linear-gradient(-45deg, #231b14 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #231b14 75%),
    linear-gradient(-45deg, transparent 75%, #231b14 75%),
    #111;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.thumb--square {
  aspect-ratio: 1;
}

.thumb--story {
  aspect-ratio: 9 / 12;
}

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

.frame-card__text {
  min-width: 0;
  padding: 0 2px 3px;
}

.frame-card__text strong {
  display: block;
  overflow: hidden;
  color: var(--cream);
  font-size: 0.77rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-card__text small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
}

.check {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--cream);
  color: var(--cream);
  background: linear-gradient(180deg, var(--orange-bright), var(--red));
  font-size: 0.74rem;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 150ms ease, transform 150ms ease;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.frame-card.is-active .check {
  opacity: 1;
  transform: scale(1);
}

/* UPLOAD */
.upload-button {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid #d65100;
  color: var(--cream);
  background:
    linear-gradient(100deg, rgba(214, 81, 0, 0.18), rgba(141, 31, 3, 0.08)),
    #070707;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.upload-button:active {
  transform: scale(0.99);
}

.upload-button__icon {
  display: grid;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  place-items: center;
  color: var(--cream);
  background: linear-gradient(180deg, var(--orange-bright), var(--red));
  font-size: 1.42rem;
  font-weight: 700;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.upload-button strong,
.upload-button small {
  display: block;
}

.upload-button strong {
  font-size: 0.96rem;
}

.upload-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.71rem;
}

.error-box {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 108, 83, 0.48);
  color: #ffd9d0;
  background: rgba(103, 24, 11, 0.38);
  font-size: 0.76rem;
  line-height: 1.45;
}

/* CANVAS */
.editor-panel {
  scroll-margin-top: 12px;
}

.canvas-wrap {
  position: relative;
  display: grid;
  max-width: 560px;
  margin-inline: auto;
  overflow: hidden;
  place-items: center;
  border: 1px solid #b34200;
  background:
    linear-gradient(45deg, #251b13 25%, transparent 25%),
    linear-gradient(-45deg, #251b13 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #251b13 75%),
    linear-gradient(-45deg, transparent 75%, #251b13 75%),
    #0a0908;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
  touch-action: none;
  user-select: none;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
}

.canvas-wrap canvas:active {
  cursor: grabbing;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--cream);
  text-align: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(2px);
}

.empty-state__icon {
  margin-bottom: 8px;
  font-size: 2rem;
}

.empty-state strong {
  font-family: "Anton", Impact, sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
}

.empty-state small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.canvas-wrap:not(.is-empty) .empty-state {
  display: none;
}

.gesture-hint {
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: flex;
  gap: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.canvas-wrap:not(.is-empty) .gesture-hint {
  opacity: 1;
}

.gesture-hint span {
  padding: 5px 7px;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.76);
  font-size: 0.58rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

/* CONTROLS */
.controls {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.control {
  display: grid;
  gap: 7px;
}

.control > span {
  display: flex;
  justify-content: space-between;
  color: var(--cream);
  font-size: 0.75rem;
}

.control output {
  color: var(--orange-bright);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 30px;
  margin: 0;
  accent-color: var(--orange-bright);
}

input[type="range"]:disabled {
  opacity: 0.38;
}

.mini-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid transparent;
  color: var(--cream);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.button--secondary {
  border-color: rgba(214, 81, 0, 0.6);
  background: #0b0a08;
  font-size: 0.76rem;
}

.button--primary {
  width: 100%;
  margin-top: 13px;
  border-color: #ff7c16;
  background: linear-gradient(180deg, #e65d00 0%, #8f2104 100%);
  box-shadow: 0 13px 30px rgba(0, 0, 0, 0.38);
  font-size: 0.98rem;
}

.button--share {
  width: 100%;
  margin-top: 8px;
  border-color: rgba(255, 233, 185, 0.32);
  background: #111;
  font-size: 0.87rem;
}

.button--primary:not(:disabled):active,
.button--secondary:active,
.button--share:active {
  transform: translateY(1px) scale(0.995);
}

.download-note {
  margin: 9px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.66rem;
  line-height: 1.4;
}

/* HOW TO */
.howto {
  padding: 15px 2px 0;
}

.howto__grid {
  display: grid;
  gap: 8px;
}

.howto article {
  position: relative;
  min-height: 90px;
  padding: 14px 14px 14px 55px;
  border: 1px solid rgba(214, 81, 0, 0.35);
  background: rgba(255, 255, 255, 0.018);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.howto article > span {
  position: absolute;
  top: 15px;
  left: 14px;
  color: var(--orange-bright);
  font-family: "Anton", Impact, sans-serif;
  font-size: 0.85rem;
}

.howto strong {
  display: block;
  color: var(--cream);
  font-size: 0.85rem;
}

.howto p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.4;
}

/* FOOTER */
footer {
  border-top: 2px solid var(--orange);
  color: var(--muted);
  background: #000;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 25px 0 max(28px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.7rem;
}

footer strong {
  color: var(--cream);
  font-size: 0.84rem;
}

.copyright {
  display: block;
  margin-top: 9px;
  color: #817464;
  font-size: 0.64rem;
  text-align: center;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (min-width: 620px) {
  .hero {
    min-height: min(860px, 94vh);
  }

  .hero__content {
    padding-bottom: 54px;
  }

  .main {
    gap: 20px;
    padding-top: 24px;
  }

  .panel {
    padding: 22px;
  }

  .frame-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .frame-card__text strong {
    font-size: 0.82rem;
  }

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

  .howto article {
    min-height: 126px;
    padding: 42px 14px 14px;
  }

  .howto article > span {
    top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* =========================================================
   HERO REVISION — title only from background image
   Background is anchored at the TOP, so cropping happens below.
   ========================================================= */
.hero__content--background-title {
  display: flex;
  min-height: min(820px, 94vh);
  align-items: flex-end;
  justify-content: center;
  padding-top: 0;
}

.hero__action-panel {
  width: min(100%, 520px);
  padding: 16px 14px 0;
  text-align: center;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.26) 20%,
    rgba(0, 0, 0, 0.72) 100%
  );
}

.hero__action-panel .hero__copy {
  margin-top: 0;
}

@media (max-width: 619px) {
  .hero {
    min-height: 620px;
    background-position: center top;
  }

  .hero__content--background-title {
    min-height: 620px;
    padding-bottom: 28px;
  }

  .hero__action-panel {
    width: 100%;
    padding-inline: 6px;
  }

  .hero__copy {
    font-size: 0.84rem;
  }

  .privacy-pill {
    max-width: 100%;
    font-size: 0.64rem;
  }
}

@media (min-width: 620px) {
  .hero__content--background-title {
    min-height: min(860px, 94vh);
    padding-bottom: 48px;
  }
}
