:root {
  --bg: #fbf6ec;
  --paper: #ffffff;
  --ink: #2e2a3b;
  --muted: #6f6883;
  --line: #e9e1d3;
  --brand: #7a4fd6;
  --brand-ink: #ffffff;
  --brand-soft: #efe7ff;
  --accent: #f2a541;
  --ok: #2f9e6e;
  --err: #c8434b;
  --radius: 18px;
  --shadow: 0 8px 30px rgba(46, 42, 59, .08);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 var(--sans);
}
img { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

header.top { padding: 18px 0; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.logo span { color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); font: 700 1rem var(--sans);
  text-decoration: none; transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(122, 79, 214, .3); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.small { padding: 7px 14px; font-size: .9rem; }
.btn.danger { background: transparent; color: var(--err); border: 2px solid var(--err); }

.hero { padding: 40px 0 70px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 34em; }
.hero-art {
  aspect-ratio: 1; border-radius: 32px; background:
    radial-gradient(circle at 30% 30%, #ffd59a 0 18%, transparent 19%),
    radial-gradient(circle at 70% 65%, #c9b4ff 0 26%, transparent 27%),
    linear-gradient(160deg, #fff1d6, #efe7ff);
  box-shadow: var(--shadow); display: grid; place-items: center; font-size: 6rem;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.grid { display: grid; gap: 20px; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .85rem; font-weight: 700; }
.pill.ok { background: #def4ea; color: var(--ok); }
.pill.warn { background: #fff0d8; color: #9a5b00; }
section { padding: 40px 0; }

.audience-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.audience-grid a {
  text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; text-align: center; transition: border-color .15s;
}
.audience-grid a:hover { border-color: var(--brand); }
.audience-grid .emoji { font-size: 2rem; display: block; }

/* Formlar */
label { display: block; font-weight: 700; margin: 14px 0 6px; font-size: .95rem; }
input[type=text], input[type=email], input[type=number], input[type=tel], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fffdf9; font: inherit; color: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
textarea { min-height: 90px; resize: vertical; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; }
.hint { font-size: .88rem; color: var(--muted); font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 0; }

.style-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.style-picker label {
  margin: 0; border: 2px solid var(--line); border-radius: 14px; padding: 12px; text-align: center;
  cursor: pointer; font-weight: 600; background: #fffdf9;
}
.style-picker input { display: none; }
.style-picker input:checked + span { color: var(--brand); }
.style-picker label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

.char-form { position: relative; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; background: #fffdf9; }
.char-form .remove { position: absolute; top: 12px; right: 12px; }

/* Proje paneli */
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 30px; }
.steps a { text-decoration: none; padding: 8px 16px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: .9rem; }
.steps a.done { color: var(--ok); border-color: #bfe6d3; }
.steps a.now { color: var(--brand); border-color: var(--brand); }

.status-bar {
  position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff;
  padding: 12px 0; display: none;
}
.status-bar.show { display: block; }
.status-bar .wrap { display: flex; gap: 12px; align-items: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { padding: 14px 18px; border-radius: 14px; margin: 16px 0; }
.alert.err { background: #fde8e9; color: var(--err); }
.alert.info { background: var(--brand-soft); color: #4a2f8f; }

.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.char-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.char-card .pics { display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 2/1; background: #f3ede2; }
.char-card .pics img, .char-card .pics .ph { width: 100%; height: 100%; object-fit: cover; }
.char-card .pics .ph { display: grid; place-items: center; color: var(--muted); font-size: .85rem; text-align: center; padding: 8px; }
.char-card .body { padding: 16px; }
.char-card details { margin-top: 10px; }
summary { cursor: pointer; color: var(--brand); font-weight: 700; }

.traits { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.traits span { background: #fff0d8; color: #8a5200; padding: 2px 10px; border-radius: 999px; font-size: .82rem; }

.pages { display: grid; gap: 22px; }
.page {
  display: grid; grid-template-columns: 320px 1fr; gap: 22px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.page .img { aspect-ratio: 1; border-radius: 12px; background: #f3ede2; overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.page .img img { width: 100%; height: 100%; object-fit: cover; }
.page textarea { min-height: 150px; font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; }
.page .no { font-family: var(--serif); color: var(--accent); font-weight: 700; }
.page .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.cover { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
.cover .img { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #f3ede2; }
.cover .img img { width: 100%; height: 100%; object-fit: cover; }

.price { font-family: var(--serif); font-size: 2rem; font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* Ödeme öncesi masal tanıtımı */
.teaser {
  position: relative; overflow: hidden; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px clamp(20px, 5vw, 56px) 26px;
  font-family: var(--serif); font-size: 1.15rem; line-height: 1.75;
}
.teaser h2 { margin: 14px 0 18px; }
.teaser p { margin: 0 0 .7em; }
.teaser-fade { height: 36px; margin-top: -36px; position: relative; background: linear-gradient(transparent, var(--paper)); }
.teaser-lock { font-family: var(--sans); font-size: .95rem; color: var(--brand); font-weight: 700; margin-top: 12px !important; }

/* Üst menü */
.top-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.top-nav > a:not(.btn):not(.pill) { color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem; }
.top-nav > a.muted { color: var(--muted); font-weight: 600; }

/* Giriş */
.auth-card { max-width: 480px; margin: 40px auto; text-align: center; }
.auth-buttons { display: grid; gap: 12px; margin: 20px 0 6px; }
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  padding: 13px 20px; border-radius: 999px; font: 700 1rem var(--sans); cursor: pointer;
  text-decoration: none; border: 1.5px solid var(--line); transition: transform .15s, box-shadow .15s;
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(46, 42, 59, .12); }
.auth-btn:disabled { opacity: .6; cursor: progress; transform: none; }
.auth-btn svg { width: 20px; height: 20px; flex: none; }
.auth-btn.google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.auth-btn.apple { background: #000; color: #fff; border-color: #000; }
.auth-btn.dev { background: var(--brand-soft); color: var(--brand); border-style: dashed; }

.modal {
  border: 0; border-radius: 24px; padding: 32px 28px 24px; max-width: 440px; width: calc(100% - 32px);
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(20, 16, 40, .35); text-align: center;
}
.modal::backdrop { background: rgba(30, 24, 50, .55); backdrop-filter: blur(3px); }
.modal h2 { font-size: 1.5rem; }
.modal-close { position: absolute; top: 12px; right: 16px; border: 0; background: none; font-size: 1.6rem; color: var(--muted); cursor: pointer; }

/* Kitaplarım */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-top: 28px; }
.book-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.book-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.book-card .thumb { aspect-ratio: 1; background: #f3ede2; display: grid; place-items: center; font-size: 3rem; }
.book-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.book-card .body { padding: 14px 16px 16px; }
.book-card h3 { margin: 0 0 2px; font-size: 1.05rem; }

footer { padding: 40px 0; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); margin-top: 40px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 10px; }
  .hero-art { max-width: 360px; }
  .grid.c3, .grid.c2 { grid-template-columns: 1fr; }
  .audience-grid { grid-template-columns: repeat(2, 1fr); }
  .page, .cover { grid-template-columns: 1fr; }
}
