/* ───────────────────────────────────────────────────────────────
   DramaMate — refined dark editorial
   Display: Bricolage Grotesque · Body: Instrument Sans · Mono: JetBrains Mono
   ─────────────────────────────────────────────────────────────── */

:root {
  --ink: #0c0a09;
  --ink-2: #15110f;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-line: rgba(255, 255, 255, 0.09);
  --paper: #f4ede4;
  --muted: #a99e92;
  --muted-2: #6f655c;

  --amber: #ffae5c;
  --coral: #ff5d73;
  --gold: #ffd28a;

  --radius: 18px;
  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

/* The [hidden] attribute must win over component display rules
   (otherwise .result { display:grid } would override it). */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--coral); color: #fff; }

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

/* ─── Atmosphere: gradient mesh + film grain ─────────────────── */
.mesh {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 90vh;
  z-index: -2;
  background:
    radial-gradient(40% 50% at 18% 12%, rgba(255, 93, 115, 0.30), transparent 70%),
    radial-gradient(45% 55% at 82% 8%, rgba(255, 174, 92, 0.30), transparent 72%),
    radial-gradient(50% 60% at 50% 0%, rgba(255, 210, 138, 0.16), transparent 70%);
  filter: blur(20px) saturate(120%);
  pointer-events: none;
  animation: drift 18s var(--ease) infinite alternate;
}
@keyframes drift {
  to { transform: translate3d(0, 24px, 0) scale(1.05); }
}

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

/* ─── Header ───────────────────────────────────────────────── */
.site-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: conic-gradient(from 210deg, var(--coral), var(--amber), var(--gold), var(--coral));
  box-shadow: 0 6px 22px rgba(255, 93, 115, 0.4);
}
.brand-name {
  font-family: "Bricolage Grotesque", serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.brand-name em { font-style: normal; color: var(--amber); }

.site-nav { display: flex; align-items: center; gap: 30px; font-size: 0.95rem; color: var(--muted); }
.site-nav a { transition: color 0.2s; }
.site-nav a:hover { color: var(--paper); }
.lang-switch {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  border: 1px solid var(--panel-line);
  border-radius: 9px;
  padding: 6px 12px;
  transition: border-color 0.2s, color 0.2s;
}
.lang-switch:hover { border-color: var(--amber); color: var(--amber); }

/* ─── Hero ─────────────────────────────────────────────────── */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.hero {
  text-align: center;
  padding: clamp(40px, 9vh, 96px) 0 64px;
}
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 22px;
  opacity: 0;
  animation: rise 0.7s var(--ease) 0.05s forwards;
}
h1#hero-title {
  font-family: "Bricolage Grotesque", serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 7.5vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 auto 24px;
  max-width: 14ch;
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.12s forwards;
}
.accent {
  background: linear-gradient(105deg, var(--gold), var(--amber) 40%, var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  max-width: 56ch;
  margin: 0 auto 40px;
  color: var(--muted);
  font-size: 1.12rem;
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.2s forwards;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ─── The tool ─────────────────────────────────────────────── */
.tool {
  display: flex;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.28s forwards;
}
.field {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 0 8px 0 16px;
  backdrop-filter: blur(12px);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field:focus-within {
  border-color: rgba(255, 174, 92, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 174, 92, 0.12);
}
.field-icon { width: 20px; height: 20px; color: var(--muted); flex: none; }
#url {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--paper);
  font: inherit;
  padding: 18px 12px;
  min-width: 0;
}
#url::placeholder { color: var(--muted-2); }

.ghost-btn {
  flex: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-line);
  color: var(--muted);
  font: 500 0.85rem "JetBrains Mono", monospace;
  padding: 8px 14px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.ghost-btn:hover { color: var(--paper); border-color: var(--amber); }

.cta {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: none;
  cursor: pointer;
  padding: 0 30px;
  height: 60px;
  border-radius: var(--radius);
  font-family: "Bricolage Grotesque", serif;
  font-weight: 600;
  font-size: 1.08rem;
  color: #2a1206;
  background: linear-gradient(105deg, var(--gold), var(--amber) 55%, var(--coral));
  box-shadow: 0 10px 30px rgba(255, 93, 115, 0.32);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, filter 0.2s;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(255, 93, 115, 0.42); }
.cta:active { transform: translateY(0); }
.cta:disabled { cursor: not-allowed; filter: grayscale(0.4) brightness(0.85); }

.cta-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(42, 18, 6, 0.3);
  border-top-color: #2a1206;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.cta.loading .cta-spinner { display: inline-block; }
.cta.loading .cta-label { opacity: 0.6; }
@keyframes spin { to { transform: rotate(360deg); } }

.rate-note {
  margin: 20px auto 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--muted-2);
  letter-spacing: 0.02em;
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.36s forwards;
  min-height: 1.4em;
}
.rate-note.is-error { color: var(--coral); }
.rate-note.is-ok { color: var(--amber); }

/* ─── Result card ──────────────────────────────────────────── */
.result {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 22px;
  max-width: 560px;
  margin: 40px auto 0;
  padding: 18px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  animation: pop 0.5s var(--ease);
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: none; }
}
.result-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ink-2);
}
.result-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-badge {
  position: absolute;
  left: 8px; bottom: 8px;
  font: 500 0.66rem "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(12, 10, 9, 0.78);
  color: var(--gold);
  backdrop-filter: blur(4px);
}
.result-body { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.result-title {
  font-family: "Bricolage Grotesque", serif;
  font-size: 1.3rem;
  line-height: 1.2;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-author { margin: 0 0 12px; color: var(--muted); font-size: 0.92rem; }

/* Download options */
.opts { display: flex; flex-wrap: wrap; gap: 9px; }
.opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 11px;
  font-family: "Instrument Sans", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-line);
  transition: transform 0.18s var(--ease), border-color 0.18s, background 0.18s;
}
.opt:hover { transform: translateY(-2px); border-color: var(--amber); color: var(--amber); }
.opt svg { flex: none; }
.opt-primary {
  color: #2a1206;
  background: linear-gradient(105deg, var(--gold), var(--amber) 55%, var(--coral));
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(255, 93, 115, 0.3);
}
.opt-primary:hover { color: #2a1206; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 93, 115, 0.4); }

/* ─── Trust strip ──────────────────────────────────────────── */
.strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 34px;
  padding: 26px 0 12px;
  border-top: 1px solid var(--panel-line);
  border-bottom: 1px solid var(--panel-line);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}

/* ─── Section scaffolding ──────────────────────────────────── */
section[id] { scroll-margin-top: 80px; }
.section-title {
  font-family: "Bricolage Grotesque", serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 40px;
}

.how { padding: 92px 0 24px; }
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.steps li {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.steps li:hover { transform: translateY(-4px); border-color: rgba(255, 174, 92, 0.4); }
.step-no {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: var(--amber);
}
.steps h3 {
  font-family: "Bricolage Grotesque", serif;
  font-size: 1.35rem;
  margin: 14px 0 8px;
}
.steps p { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* ─── Features ─────────────────────────────────────────────── */
.features { padding: 92px 0 24px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.feature {
  padding: 28px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-line);
  background: linear-gradient(180deg, rgba(255, 174, 92, 0.06), transparent);
}
.feature h3 {
  font-family: "Bricolage Grotesque", serif;
  font-size: 1.18rem;
  margin: 0 0 8px;
}
.feature p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* ─── FAQ ──────────────────────────────────────────────────── */
.faq { padding: 92px 0 40px; }
.faq-list { display: flex; flex-direction: column; gap: 12px; }
details {
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.25s;
}
details[open] { border-color: rgba(255, 174, 92, 0.4); }
summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 24px;
  font-family: "Bricolage Grotesque", serif;
  font-size: 1.12rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-family: "JetBrains Mono", monospace;
  color: var(--amber);
  font-size: 1.4rem;
  transition: transform 0.25s var(--ease);
}
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0; padding: 0 24px 22px; color: var(--muted); }

/* ─── Platform guide (landing-page how-to prose) ─────────────── */
.guide { padding: 88px 0 8px; }
.guide .section-title { margin-bottom: 24px; }
.guide p {
  max-width: 64ch;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1.04rem;
}
.guide p:last-child { margin-bottom: 0; }

/* ─── More downloaders (internal links across platform pages) ── */
.more { padding: 92px 0 24px; }
.more-lede { margin: -24px 0 28px; color: var(--muted); max-width: 56ch; }
.more-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.more-links a {
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--panel);
  font-size: 0.95rem;
  transition: border-color 0.25s, transform 0.25s var(--ease), color 0.25s;
}
.more-links a:hover {
  border-color: rgba(255, 174, 92, 0.5);
  transform: translateY(-2px);
  color: var(--gold);
}

/* ─── Footer ───────────────────────────────────────────────── */
.site-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 60px;
  border-top: 1px solid var(--panel-line);
  color: var(--muted-2);
  font-size: 0.86rem;
  text-align: center;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 820px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .site-nav a:not(.lang-switch) { display: none; }
}
@media (max-width: 620px) {
  .tool { flex-direction: column; }
  .cta { width: 100%; height: 56px; }
  .result { grid-template-columns: 1fr; max-width: 340px; }
  .result-cover { aspect-ratio: 16 / 10; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
