@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500&display=swap');

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

:root {
  --text: #1a1a1a;
  --text-light: #555;
  --text-lighter: #888;
  --bg: #fafaf8;
  --bg-card: #ffffff;
  --accent: #2d5016;
  --accent-light: #e8f0e2;
  --border: #e8e6e1;
  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, system-ui, sans-serif;
}

html { scroll-behavior: smooth; font-size: 18px; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250,250,248,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
nav.scrolled { box-shadow: 0 1px 8px rgba(0,0,0,0.06); }
nav .inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 2rem;
}
nav .logo {
  font-family: var(--serif); font-size: 1.2rem; font-weight: 500;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em;
}
nav ul { list-style: none; display: flex; gap: 2rem; }
nav a {
  text-decoration: none; color: var(--text-light);
  font-size: 0.78rem; font-weight: 400; letter-spacing: 0.06em;
  text-transform: uppercase; transition: color 0.2s;
}
nav a:hover { color: var(--accent); }

.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.menu-toggle span { display: block; width: 20px; height: 1.5px; background: var(--text); margin: 5px 0; transition: 0.3s; }

@media (max-width: 700px) {
  .menu-toggle { display: block; }
  nav ul {
    display: none; flex-direction: column; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(250,250,248,0.98); border-bottom: 1px solid var(--border);
  }
  nav ul.open { display: flex; }
  nav ul li a { display: block; padding: 1rem 2rem; }
}

/* ── HERO ── */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 8rem 2rem 4rem; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url('../images/ClayoquotSound.jpg') center/cover no-repeat;
  opacity: 0.08; z-index: 0;
}
.hero-inner { max-width: 720px; text-align: center; position: relative; z-index: 1; }
.hero h1 {
  font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 400; line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.hero .subtitle {
  font-size: 1rem; color: var(--text-light); font-weight: 300;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 2rem;
}
.hero p {
  font-size: 1.1rem; color: var(--text-light); line-height: 1.8;
  max-width: 560px; margin: 0 auto 2.5rem;
}
.hero .scroll-hint {
  display: inline-block; color: var(--text-lighter); font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  transition: color 0.2s;
}
.hero .scroll-hint:hover { color: var(--accent); }
.hero .scroll-hint .arrow {
  display: block; margin-top: 0.5rem; font-size: 1.2rem;
  animation: drift 2s ease-in-out infinite;
}
@keyframes drift { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ── SECTIONS ── */
section { padding: 6rem 2rem; }
.container { max-width: 1100px; margin: 0 auto; }
.section-label {
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1.5rem;
}
.section-heading {
  font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400; line-height: 1.25; margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}
.section-text {
  font-size: 1rem; color: var(--text-light); max-width: 620px; line-height: 1.8;
}

/* ── ABOUT ── */
#about { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.about-grid .section-text { max-width: none; }
.about-grid .section-text p + p { margin-top: 1rem; }
.about-image { border-radius: 6px; overflow: hidden; }
.about-image img { width: 100%; height: auto; display: block; border-radius: 6px; }
.topics { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.topics span {
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.4rem 0.9rem; border: 1px solid var(--border); border-radius: 100px;
  color: var(--text-light); transition: 0.2s; cursor: pointer;
}
.topics span:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* ── BOOK ── */
#book .book-card {
  display: grid; grid-template-columns: 280px 1fr; gap: 3.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 3rem; margin-top: 2rem; align-items: center;
}
.book-cover {
  width: 100%; border-radius: 4px;
  box-shadow: 4px 6px 20px rgba(0,0,0,0.15);
  position: relative; overflow: hidden;
}
.book-cover img { width: 100%; height: auto; display: block; border-radius: 4px; }
.book-cover::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 12px;
  background: linear-gradient(90deg, rgba(0,0,0,0.25), transparent); z-index: 1;
}
.book-info h3 { font-family: var(--serif); font-size: 1.6rem; font-weight: 400; margin-bottom: 1rem; }
.book-info .quote {
  font-family: var(--serif); font-style: italic; font-size: 1.1rem;
  color: var(--text-light); line-height: 1.7; margin-bottom: 0.6rem;
  border-left: 2px solid var(--accent); padding-left: 1.2rem;
}
.book-info .attribution { font-size: 0.82rem; color: var(--text-lighter); margin-bottom: 1.5rem; }
.book-info p { color: var(--text-light); line-height: 1.8; }

@media (max-width: 800px) {
  #book .book-card { grid-template-columns: 1fr; gap: 2rem; padding: 2rem; }
  .book-cover { max-width: 220px; }
}

/* ── WRITING / ARTICLES ── */
#writing { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; margin-top: 2rem; }
.article-card {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); transition: 0.3s; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
}
.article-card .thumb { width: 100%; height: 160px; object-fit: cover; display: block; }
.article-card .card-body { padding: 1.5rem 2rem 2rem; display: flex; flex-direction: column; flex: 1; }
.article-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.article-card .tag {
  font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin-bottom: 0.8rem;
}
.article-card h3 {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 500;
  line-height: 1.35; margin-bottom: 0.8rem;
}
.article-card p { font-size: 0.88rem; color: var(--text-light); line-height: 1.7; flex: 1; }
.article-card .meta { font-size: 0.75rem; color: var(--text-lighter); margin-top: 1.2rem; }

/* Category filter */
.category-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.category-filter button {
  font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.4rem 0.9rem; border: 1px solid var(--border); border-radius: 100px;
  color: var(--text-light); background: transparent; cursor: pointer; transition: 0.2s;
}
.category-filter button:hover,
.category-filter button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ── PHOTOGRAPHY ── */
.photo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 2rem;
}
.photo-cell {
  aspect-ratio: 4/3; border-radius: 4px; overflow: hidden; position: relative; cursor: pointer;
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.photo-cell:hover img { transform: scale(1.05); }
.photo-cell .label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 2rem 1rem 0.8rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.9); font-weight: 400;
}
@media (max-width: 600px) { .photo-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── CONTACT ── */
#contact { text-align: center; }
#contact .section-text { margin: 0 auto 2.5rem; }
.contact-links { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; }
.contact-links a {
  text-decoration: none; color: var(--text); font-size: 0.78rem;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 400;
  padding: 0.7rem 1.6rem; border: 1px solid var(--border); border-radius: 100px;
  transition: 0.2s;
}
.contact-links a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ── FOOTER ── */
footer {
  padding: 3rem 2rem; text-align: center;
  border-top: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text-lighter); letter-spacing: 0.05em;
}

/* ── FADE-IN ANIMATIONS ── */
.fade-in {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── ARTICLE VIEW ── */
.article-view { display: none; padding: 8rem 2rem 4rem; }
.article-view.active { display: block; }
.article-view .container { max-width: 740px; }
.article-view .back-link {
  display: inline-block; font-size: 0.78rem; color: var(--text-lighter);
  text-decoration: none; letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 2rem; transition: color 0.2s;
}
.article-view .back-link:hover { color: var(--accent); }
.article-view .article-meta {
  margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border);
}
.article-view .article-meta h1 {
  font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400; line-height: 1.2; margin-bottom: 0.8rem;
}
.article-view .article-meta .meta-info {
  font-size: 0.82rem; color: var(--text-lighter); display: flex; gap: 1.5rem; flex-wrap: wrap;
}
.article-view .article-meta .meta-info span { display: flex; align-items: center; gap: 0.3rem; }
.article-view .article-content { font-size: 1.05rem; line-height: 1.85; color: var(--text); }
.article-view .article-content h2 {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 500;
  margin: 2.5rem 0 1rem; color: var(--text);
}
.article-view .article-content h3 {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 500;
  margin: 2rem 0 0.8rem; color: var(--text);
}
.article-view .article-content p { margin-bottom: 1.3rem; color: var(--text-light); }
.article-view .article-content blockquote {
  border-left: 2px solid var(--accent); padding-left: 1.2rem;
  font-family: var(--serif); font-style: italic; font-size: 1.1rem;
  color: var(--text-light); margin: 1.5rem 0;
}
.article-view .article-content img {
  max-width: 100%; height: auto; border-radius: 4px; margin: 1.5rem 0;
}
.article-view .article-content ul, .article-view .article-content ol {
  padding-left: 1.5rem; margin-bottom: 1.3rem; color: var(--text-light);
}

/* Hide main content when viewing article */
body.viewing-article .hero,
body.viewing-article #about,
body.viewing-article #book,
body.viewing-article #writing,
body.viewing-article #photography,
body.viewing-article #contact { display: none; }

/* ── LIGHTBOX ── */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.9); align-items: center; justify-content: center;
  cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 4px; }
.lightbox .caption {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.8); font-size: 0.82rem; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lightbox .close-btn {
  position: absolute; top: 1.5rem; right: 2rem;
  color: rgba(255,255,255,0.7); font-size: 2rem; cursor: pointer;
  background: none; border: none; transition: color 0.2s;
}
.lightbox .close-btn:hover { color: white; }
.lightbox .lb-prev, .lightbox .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 3rem; cursor: pointer; padding: 1rem; transition: color 0.2s;
  user-select: none; z-index: 1;
}
.lightbox .lb-prev { left: 1rem; }
.lightbox .lb-next { right: 1rem; }
.lightbox .lb-prev:hover, .lightbox .lb-next:hover { color: white; }
.lightbox .lb-counter {
  position: absolute; top: 1.8rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.5); font-size: 0.75rem; letter-spacing: 0.1em;
}
