/* ============================================================
   Tobi Lawson — Personal Website & Design System
   Minimal Editorial Design System (Playfair Display + Inter)
   ============================================================ */

:root {
  --bg: #f4f4f2;
  --text: #111111;
  --accent: #ff3d00;
  --line: #d0d0ce;
  --text-muted: #555555;
  
  --font-display: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
  
  --grid-gap: 2rem;
  --container-padding: 4rem;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  padding: 2rem var(--container-padding);
  overflow-x: hidden;
}

/* Typography */
h1 {
  font-size: clamp(3.5rem, 8vw, 8.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 15ch;
  position: relative;
  z-index: 2;
}

h2 {
  font-size: clamp(2.25rem, 4vw, 3.75rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.meta {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text);
}

/* Header & Navigation */
.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6rem;
}

.header-nav .meta-brand {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text);
  text-decoration: none;
}

.header-nav .meta-links {
  display: flex;
  gap: 2rem;
}

.header-nav a {
  color: inherit;
  text-decoration: none;
  position: relative;
}

.header-nav a[aria-current="page"]::after,
.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.header-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.header-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Hero Section */
.hero {
  position: relative;
  margin-bottom: 8rem;
  min-height: 45vh;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  font-family: var(--font-display);
  max-width: 48ch;
  margin-top: 2rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Scribble SVG Highlight */
.highlight-wrapper {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.scribble {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 130%;
  height: 150%;
  pointer-events: none;
  z-index: -1;
}

.scribble path {
  fill: none;
  stroke: var(--text);
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawScribble 1.5s cubic-bezier(0.7, 0, 0.3, 1) forwards;
  animation-delay: 0.5s;
}

@keyframes drawScribble {
  to {
    stroke-dashoffset: 0;
  }
}

/* Circular Call To Action */
.circle-cta {
  position: absolute;
  top: 20%;
  right: 5%;
  width: clamp(150px, 20vw, 260px);
  aspect-ratio: 1;
  background-color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  text-align: center;
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.circle-cta:hover {
  transform: scale(1.05);
}

.circle-cta .meta {
  color: #fff;
  width: 65%;
  line-height: 1.4;
}

/* Section Header */
.section-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-header h2 {
  margin-bottom: 0;
}

/* Grid Layouts */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  margin-bottom: 8rem;
}

.grid-item {
  display: flex;
  flex-direction: column;
}

.grid-item-header {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.grid-item-desc {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.75rem;
}

.grid-item-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.grid-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/5;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.15) brightness(0.9);
  transition: filter 0.5s ease;
}

.grid-item a {
  text-decoration: none;
  color: inherit;
}

.grid-item:hover img {
  filter: grayscale(0%) contrast(1) brightness(1);
}

/* Card Placeholders & Covers */
.grid-item-cover {
  width: 100%;
  aspect-ratio: 4/5;
  background-color: #e5e5e2;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  transition: background-color 0.3s ease;
}

.grid-item:hover .grid-item-cover {
  background-color: #dadad6;
}

/* Long-Form Essay & Article Layout */
.prose-container {
  max-width: 760px;
  margin: 0 auto 8rem auto;
}

.article-header {
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  max-width: 100%;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.article-dek {
  font-size: 1.35rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 2rem;
  font-style: italic;
}

.article-meta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.article-body {
  font-size: 1.2rem;
  line-height: 1.7;
}

.article-body p {
  margin-bottom: 1.8rem;
}

.article-body blockquote {
  border-left: 2px solid var(--text);
  padding-left: 1.5rem;
  margin: 2.5rem 0;
  font-style: italic;
  font-size: 1.3rem;
}

.article-body h2 {
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  font-size: 2rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer .footer-links {
  display: flex;
  gap: 2rem;
}

/* Entrance Animations */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUpAnim 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

@keyframes fadeUpAnim {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .circle-cta {
    position: relative;
    top: auto;
    right: auto;
    margin-top: 4rem;
    width: 200px;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 1.5rem;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .header-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .header-nav .meta-links {
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
  }
  .circle-cta {
    width: 150px;
  }
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
}

/* ============================================================
   Books Showcase & Ordinary Abundance Reader System
   ============================================================ */

/* Book Hero Showcase */
.book-hero-showcase {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 4rem;
  align-items: start;
  margin-bottom: 8rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6rem;
}

.book-cover-container {
  perspective: 1200px;
}

.book-cover-frame {
  width: 100%;
  border-radius: 4px;
  box-shadow: -16px 24px 48px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
}

.book-cover-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.book-cover-container:hover .book-cover-frame {
  transform: rotateY(-6deg) rotateX(3deg) translateY(-6px);
  box-shadow: -22px 32px 56px rgba(0, 0, 0, 0.2), 0 8px 18px rgba(0, 0, 0, 0.1);
}

.book-info {
  display: flex;
  flex-direction: column;
}

.book-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.book-title {
  font-size: clamp(3rem, 5.5vw, 5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.book-subtitle {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.book-synopsis {
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 2.5rem;
  max-width: 62ch;
}

.book-details-list {
  display: flex;
  gap: 3rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 0;
  margin-bottom: 2.5rem;
}

.book-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.book-detail-item .detail-val {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
}

.book-cta-group {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--text);
  color: var(--bg);
  padding: 0.9rem 1.8rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  border-radius: 2px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--accent);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: transparent;
  color: var(--text);
  padding: 0.9rem 1.5rem;
  border: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  border-radius: 2px;
  transition: border-color 0.3s ease, color 0.3s ease;
}

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

/* Chapter Subnav Bar (Reader Header) */
.reader-header {
  position: sticky;
  top: 0;
  background-color: rgba(244, 244, 242, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
  margin-bottom: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reader-crumbs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reader-crumbs a {
  text-decoration: none;
  color: var(--text);
}

.chapter-pills {
  display: flex;
  gap: 0.75rem;
}

.chapter-pill {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  border-radius: 2px;
  transition: all 0.2s ease;
}

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

/* Ordinary Abundance Chapter Reader Layout */
.ordinary-reader-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 5rem;
  max-width: 1100px;
  margin: 0 auto 8rem auto;
}

.reader-main-prose {
  font-size: 1.25rem;
  line-height: 1.8;
}

.reader-main-prose p {
  margin-bottom: 2rem;
}

.reader-main-prose p:first-of-type::first-letter {
  font-size: 4.2rem;
  float: left;
  line-height: 0.8;
  margin-right: 0.8rem;
  margin-top: 0.2rem;
  font-family: var(--font-display);
  color: var(--text);
}

/* Side Marginalia & Citations (Inspired by Ordinary Abundance) */
.reader-sidebar {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.marginalia-card {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
}

.marginalia-card .meta {
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}

.marginalia-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.marginalia-source {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.marginalia-source a {
  color: inherit;
}

/* Object Spotlight Card */
.object-spotlight {
  background-color: #eaeae7;
  border: 1px solid var(--line);
  padding: 1.5rem;
  border-radius: 2px;
}

.object-spotlight .meta {
  margin-bottom: 0.75rem;
  display: block;
}

.object-spotlight h4 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.object-spotlight p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.object-specs {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.object-spec-item {
  display: flex;
  flex-direction: column;
}

.object-spec-item .spec-val {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

/* Timeline & Section Divider */
.chapter-section-divider {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 4rem 0 3rem 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background-color: var(--line);
}

.divider-year {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
}

/* Media Queries for Reader & Showcase */
@media (max-width: 1024px) {
  .book-hero-showcase {
    grid-template-columns: 300px 1fr;
    gap: 3rem;
  }
  .ordinary-reader-grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
}

@media (max-width: 768px) {
  .book-hero-showcase {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .book-details-list {
    flex-wrap: wrap;
    gap: 1.5rem;
  }
  .reader-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .chapter-pills {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-cover-frame {
    transition: none !important;
  }
  .book-cover-container:hover .book-cover-frame {
    transform: none !important;
  }
}

/* About Page Portrait Showcase */
.about-portrait-wrapper {
  margin-bottom: 4rem;
  max-width: 760px;
}

.about-portrait-frame {
  position: relative;
  border: 1px solid var(--line);
  background-color: var(--bg);
  overflow: hidden;
  max-height: 540px;
}

.about-portrait-frame img {
  width: 100%;
  height: auto;
  max-height: 540px;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  filter: grayscale(15%);
  transition: filter 0.5s ease;
}

.about-portrait-frame:hover img {
  filter: grayscale(0%);
}


