/* ─── RESET & VARIABLES ─── */
:root {
  --bg:       #0D0C0A;
  --surface:  #141210;
  --card:     #1B1915;
  --border:   #282420;
  --border-l: #363028;
  --gold:     #B8913A;
  --gold-l:   #CFA24A;
  --cream:    #EDE3CC;
  --cream-d:  #9A8E78;
  --muted:    #605850;
  --text:     #D8CEBC;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ─── NAVIGATION ─── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 60px;
  background: rgba(13, 12, 10, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--cream);
  text-decoration: none;
}
.nav-brand span { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-d);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 22px;
  cursor: pointer;
}

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 40px 80px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 35%, rgba(184,145,58,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 40% 40% at 15% 85%, rgba(184,145,58,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 820px; }

.hero-eyebrow {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.eyebrow-line {
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--gold);
  opacity: 0.45;
}

.hero-h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(52px, 9vw, 100px);
  font-weight: 300;
  line-height: 1.0;
  color: var(--cream);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.hero-h1 em { font-style: italic; color: var(--gold-l); }

.hero-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 300;
  font-style: italic;
  color: var(--cream-d);
  margin-bottom: 44px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.hero-rule {
  width: 1px;
  height: 52px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  margin: 0 auto 40px;
  opacity: 0.45;
}

.hero-btns { display: flex; gap: 14px; align-items: center; justify-content: center; }

.btn-primary {
  background: var(--gold);
  color: var(--bg);
  padding: 13px 32px;
  font-family: 'Crimson Pro', serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--gold-l); transform: translateY(-1px); }

.btn-ghost {
  background: none;
  color: var(--cream-d);
  padding: 13px 32px;
  font-family: 'Crimson Pro', serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--border-l);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ─── SECTIONS ─── */
.sec { padding: 88px 40px; }
.sec-alt { background: var(--surface); }
.container { max-width: 1140px; margin: 0 auto; }

.sec-hd { text-align: center; margin-bottom: 56px; }
.sec-eye {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  display: block;
}
.sec-ttl {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 300;
  color: var(--cream);
  line-height: 1.1;
}
.sec-ttl em { font-style: italic; color: var(--gold-l); }
.sec-desc {
  font-size: 15px;
  color: var(--cream-d);
  max-width: 500px;
  margin: 14px auto 0;
  font-style: italic;
}

/* ─── BOOKS GRID ─── */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.book-card {
  background: var(--card);
  padding: 32px 28px;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
  transition: background 0.25s;
}
.book-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--gold);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s;
}
.book-card:hover { background: #201E18; }
.book-card:hover::before { transform: scaleY(1); }

.bk-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold);
  opacity: 0.55;
  margin-bottom: 18px;
  display: block;
}
.bk-ttl {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--cream);
  line-height: 1.2;
  margin-bottom: 4px;
}
.bk-sub { font-size: 13px; color: var(--muted); font-style: italic; margin-bottom: 12px; }
.bk-genre {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(184,145,58,0.28);
  padding: 3px 8px;
  margin-bottom: 16px;
}
.bk-desc { font-size: 13px; color: var(--muted); line-height: 1.65; margin-bottom: 22px; }
.bk-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  transition: gap 0.2s;
}
.book-card:hover .bk-cta { gap: 10px; }

/* ─── API KEY NOTICE ─── */
.api-notice {
  background: rgba(184,145,58,0.06);
  border: 1px solid rgba(184,145,58,0.25);
  padding: 18px 22px;
  margin-bottom: 0;
  display: none;
}
.api-notice.visible { display: block; }
.api-notice-inner {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--cream-d);
}
.api-notice-icon { font-size: 18px; margin-top: 1px; }
.api-notice-inner > div:nth-child(2) { flex: 1; min-width: 200px; }
.api-key-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.api-key-row input {
  flex: 1;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border-l);
  color: var(--cream);
  padding: 8px 12px;
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  outline: none;
}
.api-key-row input:focus { border-color: var(--gold); }
.api-key-row button {
  background: var(--gold);
  color: var(--bg);
  border: none;
  padding: 8px 18px;
  font-family: 'Crimson Pro', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.api-key-row button:hover { background: var(--gold-l); }

/* ─── TOOLS ─── */
.tools-wrap { max-width: 1080px; margin: 0 auto; }

.tabs {
  display: flex;
  border: 1px solid var(--border);
  border-bottom: none;
  flex-wrap: wrap;
}
.tab {
  flex: 1;
  min-width: 140px;
  padding: 15px 12px;
  background: var(--card);
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: 'Crimson Pro', serif;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.tab:last-child { border-right: none; }
.tab:hover { color: var(--cream); background: var(--surface); }
.tab.active { background: var(--bg); color: var(--gold); border-bottom: 2px solid var(--gold); }

.tool-body { border: 1px solid var(--border); background: var(--card); }

.panel { display: none; padding: 36px; }
.panel.active { display: block; }

.panel-desc {
  font-size: 15px;
  color: var(--cream-d);
  font-style: italic;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  line-height: 1.75;
}

.tool-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}

.form-row { margin-bottom: 18px; }

label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--cream);
  padding: 10px 13px;
  font-family: 'Crimson Pro', serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  border-radius: 0;
  -webkit-appearance: none;
}
input:focus, textarea:focus { border-color: var(--gold); }
textarea { min-height: 88px; resize: vertical; }

/* Upload box */
.upload-box {
  border: 1px dashed var(--border-l);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  background: var(--surface);
  position: relative;
}
.upload-box:hover { border-color: var(--gold); }
.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  padding: 0;
}
.up-icon { font-size: 26px; opacity: 0.3; margin-bottom: 6px; }
.up-lbl { font-size: 13px; color: var(--cream-d); }
.up-hint { font-size: 11px; color: var(--muted); margin-top: 3px; }
.up-name { font-size: 12px; color: var(--gold); margin-top: 6px; font-style: italic; min-height: 18px; }

/* Generate button */
.gen-btn {
  width: 100%;
  background: var(--gold);
  color: var(--bg);
  border: none;
  padding: 14px;
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.gen-btn:hover:not(:disabled) { background: var(--gold-l); transform: translateY(-1px); }
.gen-btn:active { transform: translateY(0); }
.gen-btn:disabled { background: #4A3C18; color: rgba(13,12,10,0.4); cursor: not-allowed; transform: none; }

/* Error box */
.err {
  background: rgba(140,50,40,0.15);
  border: 1px solid rgba(140,50,40,0.4);
  padding: 12px 16px;
  color: #D06858;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
  line-height: 1.5;
}

/* Results */
.res-wrap { min-height: 280px; }
.res-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  gap: 10px;
  border: 1px dashed var(--border);
  padding: 36px;
}
.res-ph-icon { font-size: 32px; opacity: 0.12; }
.res-ph-txt { font-size: 13px; color: var(--muted); font-style: italic; text-align: center; }

.res-blocks { display: none; }
.res-blocks.on { display: block; }

.res-blk {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px;
  margin-bottom: 14px;
  position: relative;
  animation: fadeUp 0.35s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

.res-lbl {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  display: block;
}
.res-txt {
  font-size: 14px;
  line-height: 1.85;
  color: var(--cream);
  white-space: pre-wrap;
}

.cp-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 10px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Crimson Pro', serif;
}
.cp-btn:hover { border-color: var(--gold); color: var(--gold); }
.cp-btn.ok { border-color: #4A8041; color: #4A8041; }

/* Skeleton loading */
.skel {
  height: 13px;
  border-radius: 1px;
  margin-bottom: 9px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── ABOUT ─── */
.about-inner {
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 72px;
  align-items: start;
}
.about-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 40px;
  font-weight: 300;
  color: var(--cream);
  line-height: 1.1;
  margin-bottom: 7px;
}
.about-name em { font-style: italic; color: var(--gold); }
.about-role {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.about-div {
  width: 36px;
  height: 1px;
  background: var(--gold);
  opacity: 0.55;
  margin-bottom: 22px;
}
.award {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 9px;
  letter-spacing: 0.02em;
}

.bio { font-size: 17px; line-height: 1.9; color: var(--text); }
.bio p { margin-bottom: 20px; }
.bio p:last-child { margin-bottom: 0; }

/* ─── FOOTER ─── */
footer {
  background: #080806;
  border-top: 1px solid var(--border);
  padding: 36px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.ft-brand { font-family: 'Cormorant Garamond', serif; font-size: 15px; color: var(--cream-d); }
.ft-brand span { color: var(--gold); }
.ft-copy { font-size: 11px; color: var(--muted); }
.ft-links { display: flex; gap: 22px; }
.ft-links a {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.ft-links a:hover { color: var(--gold); }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-l); border-radius: 2px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
  nav { padding: 0 20px; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: rgba(13,12,10,0.98); border-bottom: 1px solid var(--border); padding: 20px; gap: 18px; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .hero { padding: 80px 20px 60px; }
  .sec { padding: 60px 20px; }
  .tool-cols { grid-template-columns: 1fr; }
  .about-inner { grid-template-columns: 1fr; gap: 36px; }
  .tabs { flex-direction: column; }
  .tab { border-right: none; border-bottom: 1px solid var(--border); }
  .panel { padding: 22px 18px; }
  footer { padding: 28px 20px; flex-direction: column; align-items: flex-start; }
}

@media (max-width: 500px) {
  .books-grid { grid-template-columns: 1fr; }
  .hero-btns { flex-direction: column; }
  .btn-primary, .btn-ghost { width: 100%; text-align: center; }
}

/* ─── GUIDE SECTION ─── */
.guide-wrap {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 72px;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.guide-cover {
  position: relative;
}

.guide-cover-inner {
  background: var(--ink);
  border: 1px solid var(--gold);
  padding: 44px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.guide-cover-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gold);
}

.guide-cover-inner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gold);
}

.guide-cover-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 86px;
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0;
}

.guide-cover-label {
  font-family: 'Crimson Pro', serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-d);
  margin-bottom: 20px;
}

.guide-cover-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 300;
  color: var(--cream);
  line-height: 1.2;
  margin-bottom: 10px;
}

.guide-cover-title em {
  font-style: italic;
  color: var(--gold-l);
}

.guide-cover-sub {
  font-family: 'Crimson Pro', serif;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.guide-info { }

.guide-desc {
  font-family: 'Crimson Pro', serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 28px;
  margin-top: 14px;
}

.guide-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.guide-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-family: 'Crimson Pro', serif;
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}

.guide-feature-icon {
  color: var(--gold);
  font-size: 8px;
  margin-top: 5px;
  flex-shrink: 0;
}

.guide-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.guide-badge {
  font-family: 'Crimson Pro', serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(184,145,58,0.35);
  padding: 4px 12px;
}

.guide-buy-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.guide-buy-btn {
  display: inline-block;
  background: var(--gold);
  color: var(--bg);
  padding: 16px 36px;
  font-family: 'Crimson Pro', serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.guide-buy-btn:hover {
  background: var(--gold-l);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(184,145,58,0.35);
}

.guide-buy-note {
  font-family: 'Crimson Pro', serif;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
}

@media (max-width: 860px) {
  .guide-wrap {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .guide-cover-inner {
    max-width: 280px;
    margin: 0 auto;
  }
}
