/* =========================================================
   A.P. BARRETT — Author Site
   Base styles, design tokens, layout, components
   ========================================================= */

:root {
  --bg: #FBF6EC;
  --bg-alt: #F0E6D2;
  --bg-dark: #1C1712;
  --text: #201A14;
  --text-muted: #6B6053;
  --text-inverse: #F6EEDF;
  --accent: #B33C1B;
  --accent-dark: #8A2C12;
  --accent-soft: #E9C9A8;
  --line: #E2D5B8;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1180px;
  --pad: clamp(1.25rem, 4vw, 3.5rem);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 500; }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }

p { margin: 0 0 1.1em; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9em;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--accent);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85em 1.6em;
  border-radius: 2px;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}
.btn-outline:hover { background: var(--text); color: var(--bg); }

.btn-light {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--bg);
}
.btn-light:hover { background: var(--bg-alt); }

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 246, 236, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.93rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--text);
  margin: 6px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.open { max-height: 400px; }
  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links a { display: block; padding: 1.1rem var(--pad); border-bottom: none; }
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero h1 { margin-bottom: 0.35em; }

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 1.6em;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.photo-frame {
  aspect-ratio: 4 / 5;
  background: linear-gradient(155deg, var(--accent-soft), var(--bg-alt));
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 3px;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame .placeholder-mark {
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: var(--accent-dark);
  opacity: 0.55;
}

/* ---------- Sections ---------- */

section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--bg-dark); color: var(--text-inverse); }
.section-dark .text-muted { color: #C9BFAE; }

.section-head {
  max-width: 60ch;
  margin-bottom: 2.6rem;
}

.text-muted { color: var(--text-muted); }

hr.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 3rem 0;
}

/* ---------- Book card / featured ---------- */

.book-feature {
  display: grid;
  grid-template-columns: 0.6fr 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
@media (max-width: 780px) {
  .book-feature { grid-template-columns: 1fr; }
}

.cover-frame {
  aspect-ratio: 2 / 3;
  background: linear-gradient(160deg, var(--bg-dark), #33291d);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  box-shadow: 0 18px 40px -18px rgba(28, 23, 18, 0.45);
  overflow: hidden;
}
.cover-frame img { width: 100%; height: 100%; object-fit: cover; }
.cover-frame .cover-placeholder {
  text-align: center;
  padding: 1.5rem;
  font-family: var(--font-display);
}
.cover-frame .cover-placeholder .t { font-size: 1.5rem; display: block; margin-bottom: 0.4rem; }
.cover-frame .cover-placeholder .a { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }

.status-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35em 0.75em;
  border: 1px solid currentColor;
  border-radius: 2px;
  margin-bottom: 0.9em;
}
.status-tag.published { color: #2F6B45; }
.status-tag.wip { color: var(--accent-dark); }
.status-tag.short { color: #4C5A8A; }

/* ---------- Grid of works ---------- */

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.2rem;
}

.work-card {
  border-top: 3px solid var(--accent);
  padding-top: 1.4rem;
}
.work-card h3 { margin-bottom: 0.4em; }

/* ---------- Contact / form ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
@media (max-width: 780px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.field {
  margin-bottom: 1.2rem;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75em 0.9em;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 2px;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.social-row {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.social-row a {
  border: 1px solid var(--line);
  padding: 0.6em 1.1em;
  border-radius: 2px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.social-row a:hover { border-color: var(--accent); color: var(--accent-dark); }

.newsletter-box {
  border: 1px solid var(--line);
  background: var(--bg-alt);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  border-radius: 3px;
}
.newsletter-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}
.newsletter-form input[type="email"] {
  flex: 1 1 240px;
  padding: 0.85em 1em;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 1rem;
}
.form-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
}

/* ---------- News list ---------- */

.news-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}
.news-item:first-of-type { padding-top: 0; }
.news-date {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Press ---------- */

.press-item {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}
.press-source {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.4em;
}
blockquote.press-quote {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  margin: 0;
  line-height: 1.4;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg-dark);
  color: var(--text-inverse);
  padding: 3rem 0 2.2rem;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
}
.footer-nav {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
.footer-nav a { font-size: 0.9rem; opacity: 0.85; }
.footer-nav a:hover { opacity: 1; color: var(--accent-soft); }
.footer-bottom {
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(246, 238, 223, 0.15);
  font-size: 0.8rem;
  opacity: 0.65;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ---------- Utility ---------- */

.center { text-align: center; }
.mt-0 { margin-top: 0; }
.narrow { max-width: 70ch; }
