/* ============================================================
   Alex Castro — Portfolio theme
   Palette + type inspired by anthropic.com (approximate, using
   free Google Fonts since Anthropic's own fonts are proprietary).
   ============================================================ */

:root {
  --bg: #F5F2EA;
  --bg-alt: #EFEBE1;
  --card-bg: #EAE5D8;
  --card-bg-hover: #E3DDCC;
  --line: #D9D2C0;
  --text: #1E1C17;
  --text-muted: #6B665A;
  --text-faint: #918C7C;
  --black: #17160F;
  --white: #FDFCF8;
  --max-width: 1200px;
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em 0;
  color: var(--text);
}

p {
  margin: 0 0 1em 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------------- Header / nav ---------------- */

header.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 15px;
}

nav.primary-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav.primary-nav a {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

nav.primary-nav a:hover {
  background: var(--card-bg);
  color: var(--text);
}

nav.primary-nav a.active {
  color: var(--text);
  background: var(--card-bg);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.audio-toggle:hover {
  background: var(--card-bg-hover);
  color: var(--text);
}

.audio-toggle .audio-wave {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.audio-toggle .audio-mute-line {
  opacity: 1;
  transition: opacity 0.15s ease;
}

.audio-toggle.is-playing {
  color: var(--black);
  border-color: var(--black);
}

.audio-toggle.is-playing .audio-wave {
  opacity: 1;
}

.audio-toggle.is-playing .audio-mute-line {
  opacity: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--black);
  color: var(--white) !important;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  opacity: 0.85;
}

.btn-arrow {
  transition: transform 0.15s ease;
}

.btn:hover .btn-arrow {
  transform: translateX(2px);
}

.btn-outline {
  background: transparent;
  color: var(--text) !important;
  border: 1px solid var(--line);
}

/* ---------------- Hero ---------------- */

.hero {
  padding: 64px 0 40px;
}

.hero h1 {
  font-size: clamp(32px, 4.5vw, 48px);
  max-width: 780px;
}

.hero p.lede {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 620px;
}

.hero .hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.hero .wrap.hero-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

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

.hero-photo-wrap {
  flex-shrink: 0;
}

.hero-photo {
  display: block;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--card-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

@media (max-width: 720px) {
  .hero .wrap.hero-flex {
    flex-direction: column-reverse;
    text-align: center;
    gap: 24px;
  }

  .hero-photo {
    width: 140px;
    height: 140px;
  }
}

/* ---------------- Section titles ---------------- */

.section-title {
  font-size: 28px;
  margin: 0 0 28px 0;
}

section.page-section {
  padding: 8px 0 72px;
}

/* ---------------- Card grid ---------------- */

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

@media (max-width: 980px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  transition: background 0.15s ease;
}

.card:hover {
  background: var(--card-bg-hover);
}

.card-thumb {
  margin: -28px -28px 20px -28px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--line);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card h3.card-title {
  font-size: 24px;
  margin-bottom: 12px;
}

.card p.card-body {
  color: var(--text-muted);
  font-size: 15px;
  flex-grow: 1;
}

.card-meta {
  margin-top: 20px;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  font-size: 13px;
}

.card-meta-row .meta-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}

.card-meta-row .meta-value {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

.card .btn {
  margin-top: 20px;
  width: 100%;
  justify-content: center;
}

/* ---------------- Detail page ---------------- */

.detail-hero {
  padding: 56px 0 24px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
}

.back-link:hover {
  color: var(--text);
}

.detail-meta-strip {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.detail-meta-item .meta-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
}

.detail-meta-item .meta-value {
  font-size: 16px;
  font-weight: 500;
}

.detail-body {
  padding: 40px 0 80px;
  max-width: 760px;
}

.detail-body h2 {
  font-size: 22px;
  margin-top: 40px;
}

.detail-body ul {
  padding-left: 20px;
  color: var(--text-muted);
}

.detail-body li {
  margin-bottom: 8px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card-bg);
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  background: var(--card-bg);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------------- Contact page ---------------- */

.contact-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 560px;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 20px 0;
}

.contact-row:first-child {
  border-top: none;
}

.contact-row .contact-label {
  font-family: "Fraunces", serif;
  font-size: 17px;
}

/* ---------------- Empty state ---------------- */

.empty-state {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state code {
  background: var(--bg);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
}

/* ---------------- Footer ---------------- */

footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  color: var(--text-faint);
  font-size: 13px;
}

footer.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------------- Mobile nav tweaks ---------------- */

@media (max-width: 720px) {
  .nav-row {
    flex-wrap: wrap;
    height: auto;
    padding: 16px 0;
    gap: 12px;
  }
  nav.primary-nav {
    flex-wrap: wrap;
  }
  .nav-right {
    flex-wrap: wrap;
  }
}
