/* ==========================================================================
   Avatar Story Reach - book marketing and author growth
   Bespoke design system. Built for authors, not merchants.
   Tokens first so the palette is a one-place swap.
   ========================================================================== */

:root {
  /* paper and ink */
  --paper:        #FAF8F3;
  --surface:      #FFFFFF;
  --surface-2:    #F4F1E9;
  --ink:          #1B2420;
  --ink-soft:     #3A463F;
  --muted:        #5C6760;
  --line:         #E7E2D6;
  --line-strong:  #D8D1C1;

  /* brand: emerald primary, warm clay accent */
  --primary:      #1F6D54;
  --primary-deep: #134535;
  --primary-soft: #E7F1EC;
  --primary-tint: rgba(31, 109, 84, .08);
  --accent:       #D07B3C;
  --accent-deep:  #B4652C;
  --accent-soft:  #FBECDC;

  --ok:           #1F6D54;
  --shadow-sm:    0 2px 10px rgba(27, 36, 32, .05);
  --shadow:       0 18px 44px rgba(27, 36, 32, .09);
  --shadow-lg:    0 34px 80px rgba(19, 69, 53, .16);

  --display: "Inter", ui-sans-serif, system-ui, sans-serif;
  --body:    "Inter", ui-sans-serif, system-ui, sans-serif;

  --wrap: 1180px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--primary); color: #fff; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; letter-spacing: -0.022em; margin: 0; color: var(--ink); }
h1 { font-size: clamp(2.5rem, 1.6rem + 3.9vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); }
h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0 0 1rem; }
.lead { font-size: clamp(1.08rem, 1rem + .5vw, 1.3rem); color: var(--ink-soft); line-height: 1.55; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(68px, 6vw, 120px) 0; position: relative; }
.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.maxw-640 { max-width: 640px; }
.maxw-720 { max-width: 720px; }

/* ---- eyebrow / labels ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); border-radius: 2px; }
.eyebrow.is-centered { justify-content: center; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--body); font-weight: 600; font-size: .98rem;
  padding: 15px 26px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .18s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 12px 26px rgba(19, 69, 53, .22); }
.btn--primary:hover { background: var(--primary-deep); transform: translateY(-2px); box-shadow: 0 18px 34px rgba(19, 69, 53, .28); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn--light { background: #fff; color: var(--primary-deep); }
.btn--light:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--accent { background: var(--accent); color: #fff; box-shadow: 0 12px 26px rgba(180, 101, 44, .26); }
.btn--accent:hover { background: var(--accent-deep); transform: translateY(-2px); }
.btn--block { width: 100%; justify-content: center; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 248, 243, .82);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.site-header.is-stuck { border-color: var(--line); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__name { font-family: var(--display); font-weight: 600; font-size: 1.24rem; letter-spacing: -0.015em; color: var(--ink); line-height: 1; }
.brand__name b { color: var(--primary); font-weight: 600; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { font-size: .95rem; font-weight: 500; color: var(--ink-soft); transition: color .18s ease; }
.nav a:hover { color: var(--primary); }
.header-cta { display: flex; align-items: center; gap: 14px; }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }
.menu-toggle svg { width: 26px; height: 26px; }

/* ---- hero ---- */
.hero { padding-top: clamp(40px, 4vw, 72px); padding-bottom: clamp(56px, 5vw, 96px); position: relative; }
.hero__grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(36px, 4vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2rem, 1.3rem + 2.7vw, 3.05rem); line-height: 1.13; letter-spacing: -0.025em; margin-bottom: 20px; }
.hero h1 .accent { color: var(--primary); }
.hero .lead { max-width: 530px; margin-bottom: 30px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.hero__trust { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: .9rem; font-weight: 500; }
.hero__trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero__trust svg { width: 16px; height: 16px; color: var(--primary); }

/* hero visual */
.hero__art { position: relative; }
.art-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 28px; position: relative; overflow: hidden;
}
.art-card::before {
  content: ""; position: absolute; inset: 0; background:
    radial-gradient(120% 90% at 85% -10%, var(--primary-soft), transparent 60%);
  pointer-events: none;
}
.art-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; margin-bottom: 20px; }
.art-top .book-mini { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; }
.art-top .book-mini i { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.art-top .book-mini i svg { width: 18px; height: 18px; }
.pill { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 6px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); }
.art-metric { position: relative; z-index: 1; }
.art-metric__label { font-size: .82rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; margin-bottom: 6px; }
.art-chart { position: relative; z-index: 1; height: 110px; margin: 10px 0 18px; }
.art-chart svg { width: 100%; height: 100%; overflow: visible; }
.art-rows { position: relative; z-index: 1; display: grid; gap: 10px; }
.art-row { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.art-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.art-row .bar { flex: 1; height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.art-row .bar i { display: block; height: 100%; border-radius: 6px; }
.art-row .val { font-weight: 600; color: var(--ink-soft); font-size: .84rem; min-width: 38px; text-align: right; }
.art-badge {
  position: absolute; z-index: 2; right: -14px; bottom: 26px;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 13px 16px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 11px; max-width: 220px;
}
.art-badge svg { width: 22px; height: 22px; color: #fff; flex: none; }
.art-badge b { display: block; font-size: .92rem; }
.art-badge small { color: rgba(255,255,255,.72); font-size: .76rem; }

/* hero founder photo */
.hero-photo { position: relative; max-width: 440px; margin-left: auto; }
.hero-photo__frame { position: absolute; inset: 20px -18px -18px 20px; border-radius: var(--radius-lg); background: var(--primary-soft); z-index: 0; }
.hero-photo__frame::after { content: ""; position: absolute; right: 22px; top: 22px; width: 64px; height: 64px; border-radius: 16px; background: var(--accent-soft); }
.hero-photo__img { position: relative; z-index: 1; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: var(--surface-2); }
.hero-photo__img img { width: 100%; aspect-ratio: 733 / 1100; object-fit: cover; object-position: center top; display: block; }
.hero-photo__tag {
  position: absolute; z-index: 2; left: -14px; bottom: 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 14px 18px; display: flex; align-items: center; gap: 13px; max-width: 280px;
}
.hero-photo__tag .ring { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.hero-photo__tag .ring svg { width: 22px; height: 22px; }
.hero-photo__tag b { display: block; font-family: var(--display); font-size: 1.05rem; line-height: 1.1; color: var(--ink); }
.hero-photo__tag small { color: var(--muted); font-size: .82rem; font-weight: 500; }
.hero-photo__chip {
  position: absolute; z-index: 2; right: -12px; top: 30px;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 9px 14px;
  font-size: .82rem; font-weight: 600; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px;
}
.hero-photo__chip svg { width: 16px; height: 16px; color: var(--accent); }

/* hero founder quote */
.hero-quote { margin: 30px 6px 0; padding-left: 20px; border-left: 3px solid var(--accent); position: relative; }
.hero-quote blockquote { margin: 0; font-size: 1.02rem; line-height: 1.5; font-style: italic; color: var(--ink-soft); }
.hero-quote figcaption { margin-top: 10px; font-size: .82rem; font-weight: 600; color: var(--muted); font-style: normal; letter-spacing: .01em; }

/* ---- audience strip ---- */
.audience { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.audience .wrap { padding-top: 34px; padding-bottom: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; justify-content: center; }
.audience__label { font-weight: 600; color: var(--muted); font-size: .92rem; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--ink-soft);
}
.chip svg { width: 16px; height: 16px; color: var(--primary); }

/* ---- section head ---- */
.sec-head { max-width: 680px; margin-bottom: 48px; }
.sec-head.is-centered { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head p { color: var(--muted); margin-top: 14px; margin-bottom: 0; }

/* ---- services grid ---- */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 20px; transition: background .2s ease, color .2s ease; }
.card__icon svg { width: 26px; height: 26px; }
.card:hover .card__icon { background: var(--primary); color: #fff; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); margin-bottom: 0; font-size: .97rem; }
.card__tag { position: absolute; top: 22px; right: 22px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-deep); }

/* ---- process ---- */
.process { background: var(--surface); border-top: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.step { position: relative; padding-top: 18px; }
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--accent);
  display: inline-block; margin-bottom: 14px;
}
.step h3 { font-size: 1.18rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .95rem; margin: 0; }
.step__line { position: absolute; top: 26px; left: 46px; right: -11px; height: 2px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px); }
.step:last-child .step__line { display: none; }

/* ---- values / why ---- */
.value { display: flex; gap: 16px; align-items: flex-start; }
.value__icon { width: 46px; height: 46px; flex: none; border-radius: 12px; background: var(--accent-soft); color: var(--accent-deep); display: grid; place-items: center; }
.value__icon svg { width: 22px; height: 22px; }
.value h3 { font-size: 1.12rem; margin-bottom: 6px; }
.value p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---- portfolio empty ---- */
.portfolio-empty {
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  padding: clamp(40px, 5vw, 64px); text-align: center; max-width: 820px; margin: 0 auto; position: relative;
}
.portfolio-empty__icon { width: 64px; height: 64px; border-radius: 18px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 22px; }
.portfolio-empty__icon svg { width: 32px; height: 32px; }
.portfolio-empty h2 { margin-bottom: 14px; }
.portfolio-empty p { color: var(--muted); max-width: 540px; margin: 0 auto 10px; }
.portfolio-empty .note { font-size: .88rem; color: var(--muted); margin-top: 22px; }
.portfolio-empty .btn { margin-top: 26px; }

/* ---- about / founder ---- */
.about { background: var(--primary-deep); color: #fff; position: relative; overflow: hidden; }
.about::before { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 120% at 100% 0%, rgba(208,123,60,.22), transparent 55%); pointer-events: none; }
.about .eyebrow { color: #fff; }
.about .eyebrow::before { background: var(--accent); }
.about__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 4vw, 64px); align-items: center; position: relative; z-index: 1; }
.about h2 { color: #fff; }
.about p { color: rgba(255,255,255,.82); }
.founder-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-lg); padding: 30px; }
.founder-card .avatar { width: 74px; height: 74px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 1.8rem; margin-bottom: 18px; }
.founder-card h3 { color: #fff; font-size: 1.3rem; margin-bottom: 4px; }
.founder-card .role { color: var(--accent); font-weight: 600; font-size: .9rem; letter-spacing: .02em; margin-bottom: 16px; }
.founder-card p { color: rgba(255,255,255,.8); font-size: .96rem; }
.founder-card p:last-child { margin-bottom: 0; }

/* ---- contact ---- */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 4vw, 60px); align-items: start; }
.contact__aside h2 { margin-bottom: 16px; }
.contact__aside > p { color: var(--muted); margin-bottom: 28px; }
.contact-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.contact-list li { display: flex; align-items: center; gap: 14px; }
.contact-list .ci { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.contact-list .ci svg { width: 20px; height: 20px; }
.contact-list small { display: block; color: var(--muted); font-size: .8rem; }
.contact-list b { font-weight: 600; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(26px, 3vw, 38px); box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 7px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--body); font-size: 1rem; color: var(--ink);
  padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--paper); transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); background: #fff; }
.field textarea { resize: vertical; min-height: 120px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__note { font-size: .82rem; color: var(--muted); margin: 14px 0 0; text-align: center; }
.form-success { display: none; text-align: center; padding: 20px 0; }
.form-success.show { display: block; }
.form-success .fs-icon { width: 58px; height: 58px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 16px; }
.form-success .fs-icon svg { width: 30px; height: 30px; }

/* ---- footer ---- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.72); padding: clamp(56px, 5vw, 80px) 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
.footer-brand .brand__name { color: #fff; }
.footer-brand .brand__name b { color: var(--accent); }
.footer-brand p { color: rgba(255,255,255,.6); font-size: .94rem; margin-top: 16px; max-width: 320px; }
.footer-col h4 { font-family: var(--body); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.5); margin: 0 0 16px; font-weight: 600; }
.footer-col a, .footer-col span { display: block; color: rgba(255,255,255,.72); font-size: .94rem; margin-bottom: 11px; transition: color .18s ease; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; font-size: .86rem; color: rgba(255,255,255,.5); }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; color: #fff; }
.footer-social a:hover { background: var(--primary); }
.footer-social svg { width: 18px; height: 18px; }

/* ---- AOS fallback (reveal) ---- */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---- mobile nav ---- */
.mobile-nav { position: fixed; inset: 0; z-index: 90; background: var(--paper); transform: translateX(100%); transition: transform .3s ease; display: flex; flex-direction: column; padding: 24px; }
.mobile-nav.open { transform: none; }
.mobile-nav__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.mobile-nav a { font-family: var(--display); font-size: 1.6rem; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.mobile-nav .btn { margin-top: 24px; }

/* ---- responsive ---- */
@media (max-width: 960px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step__line { display: none; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 460px; margin: 0 auto; width: 100%; }
  .about__grid, .contact__grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav, .header-cta .btn { display: none; }
  .menu-toggle { display: inline-flex; }
  .grid--3, .grid--4, .grid--2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .art-badge { position: static; margin-top: 16px; max-width: none; }
}
