:root {
  --color-bg: #fdfcfa;
  --color-text: #2b2b2b;
  --color-muted: #6b6b6b;
  --color-accent: #7a5c3e;
  --color-border: #e4dfd8;
  --max-width: 900px;
  --font-body: Georgia, 'Times New Roman', serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

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

/* Ribbon nav */
.ribbon {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-ui);
}

.ribbon a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.ribbon a:hover,
.ribbon a.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* Page container */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  margin-top: 0;
  margin-bottom: 2rem;
}

/* Home page: bio left, photos right */
.bio-layout {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.bio-text {
  flex: 1 1 340px;
  text-align: left;
}

.bio-photos {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bio-photos img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

/* Writing directory */
.writing-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.writing-entry {
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.writing-entry:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.writing-entry img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}

.writing-entry-text h2 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

.writing-entry-text p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* Writing detail page (PDF viewer) */
.pdf-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--color-accent);
  text-decoration: none;
}

.pdf-embed {
  width: 100%;
  height: 85vh;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

/* Generic text + photo pages (Gauge, Other Projects) */
.content-block {
  margin-bottom: 2rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.photo-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

/* Mailing list placeholder */
.mailing-list-box {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px dashed var(--color-border);
  border-radius: 6px;
  background: #f8f6f2;
  font-family: var(--font-ui);
}

.mailing-list-box h2 {
  font-family: var(--font-body);
  margin-top: 0;
}

.btn-placeholder {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.6rem 1.4rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  cursor: not-allowed;
  opacity: 0.85;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .ribbon {
    gap: 1.25rem;
    flex-wrap: wrap;
  }
  .writing-entry {
    flex-direction: column;
  }
  .writing-entry img {
    width: 100%;
    height: 180px;
  }
}
