/* ============================================
   CHRISTOPHER H. CONN — Author Platform
   Design System & Global Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f8f7f4;
  --color-text: #1a1a1a;
  --color-text-secondary: #5a5a5a;
  --color-text-muted: #8a8a8a;
  --color-border: #e2e0dc;
  --color-accent: #1a1a1a;
  --color-accent-hover: #333333;
  --color-link: #1a1a1a;
  --max-width-reading: 680px;
  --max-width-content: 1080px;
  --max-width-wide: 1200px;
  --font-heading: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-weight: 400;
}

a {
  color: var(--color-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

a:hover {
  border-bottom-color: var(--color-text);
}

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


/* --- Typography Scale --- */

h1 {
  font-family: var(--font-heading);
  font-size: 3.6rem;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.3;
}

h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

p {
  margin-bottom: 1.4rem;
}

blockquote {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.5;
  border-left: 2px solid var(--color-text);
  padding-left: 1.5rem;
  margin: 2.5rem 0;
  color: var(--color-text-secondary);
}


/* --- Layout --- */

.container {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 2rem;
}

.container--reading {
  max-width: var(--max-width-reading);
  margin: 0 auto;
  padding: 0 2rem;
}

.container--wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.section--dark {
  background: var(--color-text);
  color: var(--color-bg);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-bg);
}

.section--dark p {
  color: #c8c8c8;
}

.section--dark a {
  color: var(--color-bg);
}


/* --- Navigation --- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.nav__inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__brand {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text);
  border-bottom: none;
}

.nav__brand:hover {
  border-bottom: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav__links a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  border-bottom: none;
  transition: color var(--transition);
}

.nav__links a:hover {
  color: var(--color-text);
  border-bottom: none;
}

.nav__links a.active {
  color: var(--color-text);
}

.nav__cta {
  background: var(--color-accent) !important;
  color: var(--color-bg) !important;
  padding: 0.4rem 1rem;
  border-radius: 3px;
  font-size: 0.78rem !important;
  letter-spacing: 0.06em !important;
  transition: background var(--transition) !important;
}

.nav__cta:hover {
  background: var(--color-accent-hover) !important;
}

/* Mobile nav */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: var(--transition);
}


/* --- Buttons --- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: none;
}

.btn:hover {
  border-bottom: none;
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-bg);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-bg);
}

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

.btn--outline:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn--white {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn--white:hover {
  background: #f0f0f0;
  color: var(--color-text);
}

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}


/* --- Hero --- */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
}

.hero__content {
  max-width: 720px;
}

.hero__name {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.hero__thesis {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  font-weight: 300;
  line-height: 1.25;
  margin-bottom: 2.5rem;
  color: var(--color-text);
}

.hero__thesis em {
  font-style: italic;
}

.hero__subtitle {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 540px;
  margin-bottom: 3rem;
}


/* --- Cards --- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.card-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.essay-card {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  transition: all var(--transition);
}

.essay-card:hover {
  padding-left: 0.5rem;
}

.essay-card__meta {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.essay-card__title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.essay-card__title a {
  color: var(--color-text);
  border-bottom: none;
}

.essay-card__title a:hover {
  border-bottom: 1px solid var(--color-text);
}

.essay-card__excerpt {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}


/* --- Idea Cards --- */

.idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.idea-card {
  padding: 2rem 1.5rem;
  border: 1px solid var(--color-border);
  text-align: center;
  transition: all var(--transition);
}

.idea-card:hover {
  border-color: var(--color-text);
  transform: translateY(-2px);
}

.idea-card a {
  border-bottom: none;
}

.idea-card__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.idea-card__count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}


/* --- Section Headers --- */

.section-header {
  margin-bottom: 3.5rem;
}

.section-header h4 {
  margin-bottom: 1rem;
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  max-width: 560px;
}

.section-header--center {
  text-align: center;
}

.section-header--center p {
  margin-left: auto;
  margin-right: auto;
}


/* --- Book Section --- */

.book-feature {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  align-items: start;
}

.book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.book-cover__inner {
  text-align: center;
  color: var(--color-bg);
}

.book-cover__title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.book-cover__author {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #999;
}

.book-info h2 {
  margin-bottom: 1.5rem;
}

.book-info p {
  color: var(--color-text-secondary);
}

.book-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0 2rem;
}

.book-theme {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}


/* --- Newsletter --- */

.newsletter-box {
  max-width: 480px;
}

.newsletter-box--center {
  margin: 0 auto;
  text-align: center;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.newsletter-form input[type="email"] {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.85rem 1.2rem;
  border: 1.5px solid var(--color-border);
  border-radius: 3px;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition);
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--color-text);
}

.newsletter-form button {
  white-space: nowrap;
}

.newsletter-note {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
}

/* Dark variant */
.section--dark .newsletter-form input[type="email"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--color-bg);
}

.section--dark .newsletter-form input[type="email"]::placeholder {
  color: #888;
}

.section--dark .newsletter-form input[type="email"]:focus {
  border-color: rgba(255, 255, 255, 0.5);
}

.section--dark .newsletter-note {
  color: #777;
}


/* --- Author Bio / About --- */

.author-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  align-items: start;
}

.author-photo {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* --- Essay Body --- */

.essay-header {
  padding-top: calc(64px + 5rem);
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 3rem;
}

.essay-header h4 {
  margin-bottom: 1.5rem;
}

.essay-header h1 {
  margin-bottom: 1rem;
}

.essay-header__subtitle {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.essay-body {
  font-size: 1.05rem;
  line-height: 1.85;
}

.essay-body p {
  margin-bottom: 1.6rem;
}

.essay-body h2 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}


/* --- Page Header (for inner pages) --- */

.page-header {
  padding-top: calc(64px + 5rem);
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.page-header h1 {
  margin-bottom: 1rem;
}

.page-header p {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 560px;
  line-height: 1.7;
}


/* --- Footer --- */

.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--color-border);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__copy {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer__links a {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  border-bottom: none;
}

.footer__links a:hover {
  color: var(--color-text);
}


/* --- Utility --- */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-secondary); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Divider */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: 2rem 0;
}

/* Tag list for filtering */
.tag-filter {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.tag-filter__btn {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 2px;
}

.tag-filter__btn:hover,
.tag-filter__btn.active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}


/* --- Reading Path --- */

.reading-path {
  counter-reset: step;
}

.reading-path__item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.reading-path__item::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 300;
  color: var(--color-text-muted);
  min-width: 2rem;
  text-align: center;
  line-height: 1;
  padding-top: 0.2rem;
}

.reading-path__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.reading-path__desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}


/* --- Sticky Newsletter Bar --- */

.sticky-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--color-text);
  color: var(--color-bg);
  transform: translateY(-100%);
  transition: transform 0.35s ease;
  padding: 0.6rem 0;
}

.sticky-bar.visible {
  transform: translateY(0);
}

.sticky-bar__inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.sticky-bar__text {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #c8c8c8;
}

.sticky-bar__text strong {
  color: var(--color-bg);
}

.sticky-bar form {
  display: flex;
  gap: 0.5rem;
}

.sticky-bar input[type="email"] {
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  color: var(--color-bg);
  outline: none;
  width: 200px;
  transition: border-color var(--transition);
}

.sticky-bar input[type="email"]::placeholder {
  color: #777;
}

.sticky-bar input[type="email"]:focus {
  border-color: rgba(255,255,255,0.5);
}

.sticky-bar button {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  background: var(--color-bg);
  color: var(--color-text);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background var(--transition);
}

.sticky-bar button:hover {
  background: #e8e8e8;
}

.sticky-bar__close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #777;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
  line-height: 1;
}

.sticky-bar__close:hover {
  color: var(--color-bg);
}

/* Push nav down when sticky bar is visible */
.sticky-bar.visible ~ .nav {
  top: 38px;
}

@media (max-width: 640px) {
  .sticky-bar__text { display: none; }
  .sticky-bar input[type="email"] { width: 160px; }
}


/* --- Responsive --- */

@media (max-width: 900px) {
  html { font-size: 17px; }

  .hero__thesis { font-size: 2.4rem; }
  h1 { font-size: 2.6rem; }
  h2 { font-size: 1.8rem; }

  .book-feature,
  .author-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .book-cover {
    max-width: 220px;
  }

  .card-grid--3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  html { font-size: 16px; }

  .section { padding: 4rem 0; }
  .container, .container--reading, .container--wide { padding: 0 1.25rem; }

  .hero__thesis { font-size: 2rem; }
  h1 { font-size: 2.2rem; }

  .nav__links { display: none; }
  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1.5rem 2rem;
    gap: 1.2rem;
  }
  .nav__toggle { display: block; }

  .card-grid, .card-grid--3, .card-grid--2 {
    grid-template-columns: 1fr;
  }

  .idea-grid {
    grid-template-columns: 1fr 1fr;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .footer__inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .btn-group {
    flex-direction: column;
    align-items: flex-start;
  }
}
