:root {
  --ink: #172018;
  --muted: #5f6b5c;
  --paper: #f5eddc;
  --paper-strong: #fff8e8;
  --accent: #ff6b35;
  --accent-deep: #9e2f16;
  --moss: #17483f;
  --lime: #d7ff69;
  --line: rgba(23, 32, 24, 0.16);
  --shadow: 0 24px 80px rgba(23, 32, 24, 0.18);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 107, 53, 0.28), transparent 26rem),
    radial-gradient(circle at 86% 18%, rgba(215, 255, 105, 0.36), transparent 24rem),
    linear-gradient(135deg, #f7ecd4 0%, #f8f2e8 42%, #dfead2 100%);
  font-family: "Space Grotesk", "Noto Serif SC", sans-serif;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero { padding: 24px clamp(18px, 4vw, 64px) 56px; }
.nav, .shell, .footer { max-width: 1180px; margin: 0 auto; }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0 42px;
}
.brand, .nav-links { display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 800; letter-spacing: -0.02em; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--lime);
  box-shadow: 4px 4px 0 var(--ink);
}
.nav-links a {
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
}
.nav-links a:hover { border-color: var(--line); color: var(--ink); background: rgba(255,255,255,.35); }

.hero-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: 28px;
  align-items: stretch;
}
.hero-copy, .panel, .hero-card, .preset-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero-copy { padding: clamp(28px, 6vw, 72px); min-height: 520px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
h1, h2 { margin: 0; letter-spacing: -0.06em; line-height: 0.95; }
h1 { font-family: "Archivo Black", "Noto Serif SC", sans-serif; font-size: clamp(3.2rem, 9vw, 7.7rem); max-width: 940px; }
h2 { font-size: clamp(2.1rem, 4vw, 4rem); font-weight: 800; }
.lede { max-width: 720px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.8; }
.hero-actions, .footer-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.button {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 13px 20px;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--accent); color: #fffdf7; box-shadow: 5px 5px 0 var(--ink); }
.button.ghost { background: rgba(255,255,255,.42); color: var(--ink); }

.hero-card { padding: 26px; display: flex; flex-direction: column; justify-content: space-between; min-height: 520px; background: var(--moss); color: #fff8e8; overflow: hidden; position: relative; }
.hero-card::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -70px;
  bottom: -50px;
  background: conic-gradient(from 80deg, var(--lime), var(--accent), #ffffff, var(--lime));
  border-radius: 44% 56% 64% 36%;
  filter: blur(.2px);
  animation: blob 10s ease-in-out infinite alternate;
}
.card-topline, .output-head, .form-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.status-dot { color: var(--lime); }
.endpoint { position: relative; z-index: 1; font-size: clamp(2rem, 4vw, 4.8rem); line-height: .92; letter-spacing: -.06em; font-weight: 900; overflow-wrap: anywhere; }
.spec-grid { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; color: rgba(255,248,232,.68); }
.spec-grid strong { color: #fff8e8; text-align: right; }

.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr); gap: 24px; padding: 28px 18px 34px; }
.section-heading { grid-column: 1 / -1; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-heading p:not(.eyebrow) { margin: 0; max-width: 520px; color: var(--muted); line-height: 1.7; }
.panel { padding: clamp(20px, 3vw, 32px); }
.generator { display: flex; flex-direction: column; gap: 18px; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 6px; border-radius: 20px; background: rgba(23, 72, 63, .08); }
.mode-tabs input { position: absolute; opacity: 0; }
.mode-tabs span { display: block; text-align: center; padding: 12px; border-radius: 16px; color: var(--muted); font-weight: 800; }
.mode-tabs input:checked + span { background: var(--moss); color: #fff8e8; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.field { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-weight: 800; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.55);
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}
.field textarea { resize: vertical; min-height: 132px; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,107,53,.16); }
.secret-field { position: relative; }
.secret-field input { padding-right: 68px; }
.secret-field button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border: 0;
  border-radius: 12px;
  padding: 7px 10px;
  color: #fff8e8;
  background: var(--moss);
}
.remember { display: flex; gap: 8px; color: var(--muted); align-items: center; }
.output { align-self: start; position: sticky; top: 18px; }
.badge { border-radius: 999px; background: var(--lime); padding: 8px 12px; font-weight: 900; }
.result-grid { display: grid; gap: 14px; margin-top: 22px; }
.empty-state { min-height: 320px; display: grid; place-items: center; text-align: center; border: 1px dashed var(--line); border-radius: 24px; padding: 24px; color: var(--muted); }
.empty-state span { display: block; font-size: 1.6rem; color: var(--ink); font-weight: 900; }
.result-card { border: 1px solid var(--line); background: rgba(255,255,255,.5); border-radius: 24px; overflow: hidden; }
.result-card img { width: 100%; display: block; background: #ddd; }
.result-card .result-actions { display: flex; justify-content: space-between; gap: 10px; padding: 12px; align-items: center; }
.result-card a { font-weight: 900; color: var(--accent-deep); }
.debug-box { margin-top: 18px; color: var(--muted); }
.debug-box pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow: auto; background: rgba(23,32,24,.06); border-radius: 16px; padding: 14px; }

.presets, .security { padding: 46px 18px; }
.compact { margin-bottom: 20px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.preset-card { text-align: left; padding: 22px; color: var(--ink); transition: transform .2s ease, box-shadow .2s ease; }
.preset-card:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: 8px 8px 0 var(--ink), var(--shadow); }
.preset-card span { color: var(--accent-deep); font-weight: 900; }
.preset-card strong { display: block; margin: 24px 0 8px; font-size: 1.5rem; }
.preset-card p { color: var(--muted); line-height: 1.7; margin: 0; }
.security-panel { display: grid; grid-template-columns: .42fr 1fr; gap: 28px; align-items: start; background: var(--ink); color: var(--paper-strong); }
.security-panel ul { margin: 0; padding-left: 20px; line-height: 2; color: rgba(255,248,232,.76); }
.footer { display: flex; justify-content: space-between; gap: 16px; padding: 24px 18px 48px; color: var(--muted); }
.footer a { font-weight: 900; color: var(--accent-deep); }

.reveal { animation: rise .72s ease both; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blob { to { transform: rotate(18deg) scale(1.08); border-radius: 62% 38% 34% 66%; } }

@media (max-width: 920px) {
  .hero-grid, .studio, .security-panel { grid-template-columns: 1fr; }
  .hero-copy, .hero-card { min-height: auto; }
  .section-heading { display: block; }
  .output { position: static; }
  .form-grid.four, .preset-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav { align-items: flex-start; }
  .nav-links { display: none; }
  .form-grid.two, .form-grid.four, .preset-grid, .mode-tabs { grid-template-columns: 1fr; }
  .card-topline, .output-head, .form-footer, .footer { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 3.05rem; }
}
