@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@500;700;900&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --ink: #11100c;
  --paper: #f4ead7;
  --paper-2: #fff8ea;
  --ember: #f05a28;
  --gold: #d7a84b;
  --mint: #69d6b5;
  --line: rgba(17, 16, 12, 0.16);
  --shadow: 0 24px 70px rgba(34, 22, 8, 0.18);
  --radius-lg: 34px;
  --radius-md: 22px;
  --font-display: 'Noto Serif SC', 'Songti SC', serif;
  --font-ui: 'Space Grotesk', 'Noto Serif SC', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(240, 90, 40, 0.24), transparent 26rem),
    radial-gradient(circle at 82% 14%, rgba(105, 214, 181, 0.18), transparent 22rem),
    linear-gradient(135deg, #fbf0dc 0%, #ead8b6 52%, #f8efe1 100%);
  font-family: var(--font-ui);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(17,16,12,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,16,12,.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

a { color: inherit; }
button, input, select, textarea, input[type="url"], input[type="text"], input[type="password"] { font: inherit; }

.site-header {
  position: sticky;
  top: 16px;
  z-index: 10;
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 248, 234, 0.76);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 34px rgba(33, 22, 8, 0.08);
}

.brand, .nav { display: flex; align-items: center; gap: 10px; }
.brand {
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--paper-2);
  background: var(--ink);
  font-family: var(--font-display);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.12);
}
.nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: rgba(17,16,12,.72);
}
.nav a:hover { background: rgba(17,16,12,.08); color: var(--ink); }

main { position: relative; z-index: 1; }
.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 58px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 34px;
  align-items: center;
}
.hero-copy, .hero-card, .control-panel, .preview-panel,
.risk-card, .story-card, .risk-copy, .section-heading {
  border: 1px solid var(--line);
  background: rgba(255, 248, 234, 0.72);
  box-shadow: var(--shadow);
}
.hero-copy {
  padding: clamp(30px, 5vw, 62px);
  border-radius: var(--radius-lg);
}
.eyebrow {
  margin: 0 0 16px;
  color: var(--ember);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.08;
}
h1 {
  max-width: 780px;
  font-size: clamp(48px, 8vw, 104px);
  letter-spacing: -.07em;
}
h2 { font-size: clamp(34px, 5vw, 66px); letter-spacing: -.05em; }
h3 { font-size: 24px; letter-spacing: -.03em; }
p { line-height: 1.75; }
.hero-text {
  max-width: 680px;
  margin: 24px 0 0;
  font-size: clamp(17px, 2vw, 21px);
  color: rgba(17,16,12,.74);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.button, .copy-button {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 13px 18px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.button.primary, .copy-button {
  color: var(--paper-2);
  background: var(--ink);
}
.button.ghost { background: rgba(255,255,255,.3); }
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}
.trust-strip span {
  padding: 9px 12px;
  border: 1px dashed rgba(17,16,12,.22);
  border-radius: 999px;
  color: rgba(17,16,12,.7);
  background: rgba(255,255,255,.26);
}

.hero-card {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  border-radius: 44px;
  background:
    linear-gradient(180deg, rgba(255,248,234,.95), rgba(238,222,190,.85)),
    radial-gradient(circle at 50% 18%, rgba(215,168,75,.24), transparent 18rem);
}
.scan-label {
  position: absolute;
  top: 28px;
  left: 28px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgba(17,16,12,.58);
  font-size: 12px;
  letter-spacing: .18em;
}
.palm-art {
  width: 100%;
  height: 100%;
  padding: 64px 20px 26px;
  filter: drop-shadow(0 24px 38px rgba(32,22,8,.12));
}
.hand, .line {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hand { stroke-width: 3.6; }
.line {
  stroke-width: 2.2;
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: drawLine 1.8s ease forwards;
}
.line.heart { animation-delay: .25s; }
.line.head { animation-delay: .42s; }
.line.fate { animation-delay: .6s; }
.node { fill: var(--ember); transform-origin: center; animation: pulse 2.3s ease-in-out infinite; }
.n2 { fill: var(--gold); animation-delay: .4s; }
.n3 { fill: var(--mint); animation-delay: .8s; }
.insight-card {
  position: absolute;
  width: 178px;
  padding: 16px;
  border: 1px solid rgba(17,16,12,.18);
  border-radius: 22px;
  background: rgba(255, 252, 242, 0.76);
  backdrop-filter: blur(12px);
}
.insight-card b { display: block; margin-bottom: 6px; font-family: var(--font-display); }
.insight-card span { color: rgba(17,16,12,.66); font-size: 13px; line-height: 1.55; }
.card-one { top: 108px; right: 28px; }
.card-two { left: 26px; bottom: 42px; }

.generator-section, .risk-section, .about-section {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 0;
}
.section-heading {
  padding: 34px;
  border-radius: var(--radius-lg);
}
.section-heading p { max-width: 760px; color: rgba(17,16,12,.7); }
.generator-grid {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}
.control-panel, .preview-panel {
  border-radius: var(--radius-lg);
  padding: 22px;
}
.upload-box {
  display: grid;
  place-items: center;
  min-height: 180px;
  gap: 8px;
  text-align: center;
  border: 1.5px dashed rgba(17,16,12,.32);
  border-radius: 28px;
  background: rgba(255,255,255,.28);
  cursor: pointer;
}
.upload-box input { position: absolute; opacity: 0; pointer-events: none; }
.upload-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--paper-2);
  background: var(--ember);
  font-size: 26px;
}
.upload-box small, .microcopy { color: rgba(17,16,12,.58); }
.field-group { margin-top: 22px; }
.field-group label, .field-group legend {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}
select, textarea, input[type="url"], input[type="text"], input[type="password"] {
  width: 100%;
  border: 1px solid rgba(17,16,12,.2);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255,255,255,.42);
}
select, input[type="url"], input[type="text"], input[type="password"] { padding: 13px 14px; }
.chip-field {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  border: 0;
}
.chip-field legend { width: 100%; }
.chip-field label {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(17,16,12,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.28);
  font-size: 14px;
}
.preview-frame {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid rgba(17,16,12,.16);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(17,16,12,.05), transparent),
    rgba(255, 255, 255, .28);
}
.preview-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: rgba(17,16,12,.52);
  letter-spacing: .12em;
}
.preview-placeholder span { font-size: clamp(28px, 6vw, 74px); font-weight: 700; }
#preview-image {
  width: 100%;
  height: 390px;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
}
.prompt-output, .api-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 26px;
  background: rgba(17,16,12,.06);
}
.api-panel {
  border: 1px solid rgba(17,16,12,.12);
  background: rgba(255, 252, 242, .48);
}
.output-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.api-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.button.compact { padding: 10px 14px; }
textarea {
  min-height: 190px;
  margin-top: 14px;
  padding: 16px;
  resize: vertical;
  line-height: 1.65;
}
.copy-button { padding: 10px 14px; }
.copy-button:disabled { cursor: wait; opacity: .68; }
.eyebrow.mini { margin: 0 0 6px; font-size: 11px; }
.api-grid {
  display: grid;
  grid-template-columns: 1fr 150px 210px;
  gap: 12px;
  margin-top: 16px;
}
.api-grid label { display: grid; gap: 7px; }
.api-grid span { color: rgba(17,16,12,.66); font-size: 13px; font-weight: 700; }
.api-key-field { grid-column: 1 / -1; }
#api-result { min-height: 150px; }
.compact-textarea { min-height: 86px; margin-top: 0; }
.image-result {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(17,16,12,.14);
  border-radius: 24px;
  background: rgba(255,255,255,.36);
}
.image-result img {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  border-radius: 18px;
}
.image-result a {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
}



.risk-section {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: stretch;
}
.risk-copy {
  padding: 34px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: var(--paper-2);
}
.risk-copy p:not(.eyebrow) { color: rgba(255,248,234,.76); }
.risk-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.risk-card, .story-card {
  padding: 24px;
  border-radius: var(--radius-md);
}
.risk-card span {
  color: var(--ember);
  font-weight: 700;
  letter-spacing: .16em;
}
.risk-card p, .story-card p { color: rgba(17,16,12,.66); }
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.site-footer {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,248,234,.74);
  color: rgba(17,16,12,.68);
}
.site-footer p { margin: 0; }
.site-footer a { font-weight: 700; }

.reveal {
  opacity: 0;
  transform: translateY(18px) scale(.985);
  animation: reveal .75s cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes reveal { to { opacity: 1; transform: none; } }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes pulse { 50% { transform: scale(1.45); opacity: .56; } }

@media (max-width: 920px) {
  .api-grid { grid-template-columns: 1fr; }

  .site-header { align-items: flex-start; border-radius: 28px; }
  .nav { display: none; }
  .hero, .generator-grid, .risk-section { grid-template-columns: 1fr; }
  .hero-card { min-height: 540px; }
  .risk-cards, .story-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header, .hero, .generator-section, .risk-section, .about-section, .site-footer {
    width: min(100% - 20px, 1180px);
  }
  .hero { margin-top: 28px; }
  .hero-copy, .section-heading, .risk-copy { padding: 24px; }
  .hero-card { min-height: 500px; border-radius: 30px; }
  .insight-card { width: 154px; padding: 13px; }
  .card-one { right: 14px; }
  .card-two { left: 14px; }
  .site-footer { display: block; }
}
