/* Personal website — Adam-inspired, clean, responsive */

:root {
  --font-display: "DM Serif Display", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --color-bg: #fafafa;
  --color-text: #1a1a1a;
  --color-text-muted: #555;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-border: #e5e7eb;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --max-width: 720px;
  --header-height: 4rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

.main {
  padding-top: var(--header-height);
}

/* ----- Header & Nav ----- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.95);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-xl);
  height: var(--header-height);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-text);
  text-decoration: none;
}

.nav-brand:hover {
  color: var(--color-accent);
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-lg);
}

.nav-menu a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.nav-menu a:hover {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle-bar {
  width: 22px;
  height: 2px;
  background: var(--color-text);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    display: none;
    gap: var(--space-md);
  }

  .nav-menu.is-open {
    display: flex;
  }
}

/* ----- Hero ----- */
.hero {
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  margin: 0 0 var(--space-md);
  line-height: 1.2;
}

.hero-tagline {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xl);
  min-height: 1.5em;
}

.typed-tagline .typed-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--color-accent);
  margin-left: 2px;
  animation: blink 0.8s step-end infinite;
  vertical-align: -0.1em;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border: none;
}

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

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

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  color: var(--color-accent);
}

/* ----- Marquee (scrolling text) ----- */
.marquee-wrap {
  overflow: hidden;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: #fff;
}

.marquee {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee span {
  white-space: nowrap;
  padding: 0 var(--space-lg);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.marquee span:nth-child(odd) {
  color: var(--color-text);
}


/* ----- Scroll reveal (initial state) ----- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero title reveals immediately */
.hero .hero-title.reveal {
  opacity: 1;
  transform: none;
}

/* ----- About photo + text row ----- */
.about-row {
  display: flex;
  gap: var(--space-2xl);
  align-items: flex-start;
  margin-top: var(--space-lg);
}

.about-photo {
  flex-shrink: 0;
}

.about-photo img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.about-text {
  flex: 1;
  min-width: 0;
}

@media (max-width: 640px) {
  .about-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-photo img {
    width: 180px;
    height: 180px;
  }
}

/* ----- Stats strip ----- */
.stats-strip {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: #fff;
}

.stats-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
  gap: var(--space-xl);
  max-width: 900px;
  margin: 0 auto;
  font-size: 0.9375rem;
}

.stats-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.stat-value {
  font-weight: 600;
  color: var(--color-text);
}

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

@media (max-width: 600px) {
  .stats-list {
    gap: var(--space-lg);
  }
}

/* ----- Sections ----- */
.section {
  padding: var(--space-3xl) var(--space-xl);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 var(--space-lg);
}

.bitbros-title-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.bitbros-title-row .section-title {
  margin-bottom: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

.bitbros-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.section-intro,
.section-cta {
  margin: 0 0 var(--space-lg);
  color: var(--color-text-muted);
}

.subsection-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: var(--space-xl) 0 var(--space-md);
}

/* ----- Prose ----- */
.prose {
  font-size: 1rem;
}

.prose p {
  margin: 0 0 var(--space-md);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--color-accent);
  text-decoration: none;
}

.prose a:hover {
  text-decoration: underline;
}

.link-cta {
  font-weight: 500;
}

/* ----- What I'm Up To ----- */
.up-to-layout {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2xl);
  align-items: flex-start;
}

.up-to-content {
  flex: 1;
  min-width: 0;
}

.up-to-photo {
  flex-shrink: 0;
  width: 280px;
}

.up-to-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.up-to-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.up-to-item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.up-to-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.up-to-lead {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.up-to-lead em {
  font-style: italic;
  font-weight: 600;
}

.up-to-detail {
  display: block;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

@media (max-width: 640px) {
  .up-to-layout {
    flex-direction: column;
  }

  .up-to-photo {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }
}

/* ----- What People Say (testimonials carousel) ----- */
.testimonials-carousel {
  position: relative;
  min-height: 280px;
}

.testimonials-track {
  display: flex;
  overflow: hidden;
  min-height: 260px;
}

.testimonial {
  margin: 0;
  flex: 0 0 100%;
  width: 100%;
  padding: var(--space-xl);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  border-left: 4px solid var(--color-accent);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
}

.testimonial.is-active {
  opacity: 1;
  visibility: visible;
  position: relative;
}

.testimonial-inner {
  display: flex;
  gap: var(--space-xl);
  align-items: flex-start;
}

.testimonial-photo {
  flex-shrink: 0;
}

.testimonial-photo img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  object-position: center center;
  border-radius: 50%;
  border: 3px solid var(--color-border);
}

.testimonial-content {
  flex: 1;
  min-width: 0;
}

.testimonial-quote {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  margin: 0 0 var(--space-md);
}

.testimonial-attribution {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  font-style: normal;
}

.testimonials-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.testimonial-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.testimonial-dot:hover {
  background: rgba(37, 99, 235, 0.3);
}

.testimonial-dot.is-active {
  background: var(--color-accent);
}

/* ----- Pull quote ----- */
.pullquote {
  margin: var(--space-2xl) var(--space-xl);
  padding: var(--space-xl);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-text-muted);
  border-left: 4px solid var(--color-accent);
  background: #fff;
}

.pullquote strong {
  color: var(--color-text);
}

/* ----- Books grid ----- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-xl);
  margin: var(--space-lg) 0;
}

.book-card {
  margin: 0;
}

.book-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.book-card-link:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.book-card-cover {
  aspect-ratio: 2/3;
  background: var(--color-border);
  overflow: hidden;
}

.book-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--color-text-muted);
  background: #e5e7eb;
}

.book-card-body {
  padding: var(--space-md);
}

.book-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: nowrap;
  margin-bottom: var(--space-xs);
}

.book-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 2px;
  line-height: 1.2;
}

.book-badge--bestseller {
  background: #c45500;
  color: #fff;
}

.book-card-year {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.books-intro {
  margin-bottom: var(--space-2xl);
}

.book-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  margin: var(--space-xs) 0 var(--space-sm);
  line-height: 1.3;
}

.book-card-one-liner {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-sm);
  line-height: 1.4;
}

.book-card-cta {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-accent);
}

/* ----- Post list ----- */
.post-list,
.external-links-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list-item,
.external-link-item {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.post-list-item:last-child,
.external-link-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.post-list-item a,
.external-link-item a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
}

.post-list-item a:hover,
.external-link-item a:hover {
  color: var(--color-accent);
}

.post-list-item time,
.external-link-meta {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.post-excerpt {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: var(--space-sm) 0 0;
}

.post-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  background: #e0e7ff;
  color: var(--color-accent);
  border-radius: 4px;
  margin-left: var(--space-sm);
}

/* ----- Contact ----- */
.section-contact {
  max-width: 900px;
}

.contact-layout {
  display: flex;
  gap: var(--space-2xl);
  align-items: flex-start;
  margin-top: var(--space-lg);
}

.contact-main {
  flex: 1;
  min-width: 0;
}

.contact-map {
  flex-shrink: 0;
  width: 280px;
}

.map-usa-wrap {
  overflow: hidden;
}

.map-usa-svg,
.map-usa-img {
  display: block;
  width: 100%;
  height: auto;
}

.map-label {
  display: block;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
  font-weight: 500;
}

.contact-map .map-label:empty {
  display: none;
}

@media (max-width: 768px) {
  .contact-layout {
    flex-direction: column;
  }

  .contact-map {
    width: 100%;
    max-width: 320px;
  }
}

.contact-form {
  max-width: 28rem;
  margin: var(--space-lg) 0;
}

.contact-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.contact-form label:first-of-type {
  margin-top: 0;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.contact-form textarea {
  resize: vertical;
  min-height: 6rem;
}

.contact-form button {
  margin-top: var(--space-lg);
  cursor: pointer;
}

.contact-form-placeholder {
  padding: var(--space-md);
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 0.9375rem;
}

.contact-form-placeholder code {
  font-size: 0.875em;
  background: #e5e7eb;
  padding: 2px 6px;
  border-radius: 4px;
}

.contact-socials {
  margin-top: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.contact-socials .social-icon {
  display: inline-flex;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}

.contact-socials .social-icon:hover {
  color: var(--color-accent);
}

.contact-socials .social-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.contact-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.contact-links a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.contact-links a:hover {
  text-decoration: underline;
}

/* ----- Page (philosophy, books, blog) ----- */
.page {
  padding: var(--space-3xl) var(--space-xl);
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-header {
  margin-bottom: var(--space-2xl);
}

.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  margin: 0 0 var(--space-md);
}

.page-lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin: 0;
}

.post-list-full .post-list-item {
  margin-bottom: var(--space-xl);
}

/* ----- Post layout ----- */
.post {
  padding: var(--space-3xl) var(--space-xl);
  max-width: var(--max-width);
  margin: 0 auto;
}

.post-header {
  margin-bottom: var(--space-xl);
}

.post-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 var(--space-sm);
}

.post-date {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.post-content {
  margin-top: var(--space-xl);
}

.post-content h2 {
  font-size: 1.25rem;
  margin: var(--space-xl) 0 var(--space-md);
}

.post-content ul,
.post-content ol {
  margin: 0 0 var(--space-md);
  padding-left: 1.5rem;
}

.post-content code {
  font-size: 0.9em;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}

.post-content pre {
  overflow-x: auto;
  padding: var(--space-md);
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 0.875rem;
}

.post-content pre code {
  background: none;
  padding: 0;
}

/* ----- Footer ----- */
.site-footer {
  padding: var(--space-xl);
  text-align: center;
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-3xl);
}

.footer-copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
