@import url('https://fonts.googleapis.com/css2?family=La+Belle+Aurore&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@400;500&display=swap');

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

:root {
  --ink: #1a1a1a;
  --paper: #f5f0e8;
  --paper-light: #faf6ef;
  --amber: #d97706;
  --amber-dark: #b45309;
  --brown: #4a3728;
  --brown-light: #6b5344;
  --cream: #e8e0d0;
  --rule: #c4b8a4;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ── */

.page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Home Header ── */

.home-header {
  padding: 3.5rem 0 3.5rem;
  text-align: center;
  border-bottom: none;
  margin-bottom: 0;
}

.home-header h1 {
  font-family: 'La Belle Aurore', cursive;
  font-size: 4rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--brown);
  margin-bottom: 0;
  display: inline-block;
}

.brand-title {
  font-family: 'La Belle Aurore', cursive !important;
  font-size: 2.8rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.02em !important;
}

/* Header with brand title — compact sub-page treatment */
header:has(.brand-title) {
  position: relative;
  padding: 3rem 0 1.5rem;
  text-align: center;
  border-bottom: none;
  margin-bottom: 1.5rem;
}

header:has(.brand-title) .back-link {
  position: absolute;
  left: 0;
  top: 3rem;
  margin-bottom: 0;
}

/* ── Default Header (legal pages) ── */

header:not(.home-header):not(:has(.brand-title)) {
  position: relative;
  padding: 4rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 3rem;
}

header:not(.home-header):not(:has(.brand-title)) .back-link {
  position: absolute;
  left: 0;
  top: 4.5rem;
  margin-bottom: 0;
}

header:not(.home-header):not(:has(.brand-title)) h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brown);
  margin-bottom: 0.25rem;
}

.tagline {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brown-light);
  text-align: center;
  margin: 0.4rem auto 0;
  display: block;
}

/* ── Thesis ── */

.thesis {
  max-width: 620px;
  margin: 0 auto;
  text-align: left;
}

.thesis p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--brown-light);
}

.thesis-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--amber);
  text-decoration: none;
  border-bottom: none;
  transition: opacity 0.2s;
}

.thesis-link:hover {
  opacity: 0.7;
}

.thesis-link-sep {
  font-size: 0.7rem;
  color: var(--rule);
  margin: 0 0.4rem;
}

/* ── Divider ── */

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3.5rem 0 2.5rem;
  color: var(--rule);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.divider span {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--brown-light);
  opacity: 0.7;
}

/* ── Audio Samples ── */

.samples {
  display: flex;
  flex-direction: column;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.sample {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sample-location {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.55rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brown-light);
  opacity: 0.45;
}
.sample-location a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}
.sample-location a:hover { opacity: 0.7; }

.sample-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brown);
  margin: 0.05rem 0 0.1rem;
}

.sample-hook {
  display: block;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--brown-light);
  font-style: italic;
  opacity: 0.6;
}

.play-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  background: transparent;
  color: var(--brown);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  padding: 0;
}

.play-btn:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.play-btn svg {
  width: 14px;
  height: 14px;
}

.play-btn .icon-play {
  margin-left: 2px;
}

.scrubber {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.scrub-track {
  flex: 1;
  height: 3px;
  background: var(--cream);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.scrub-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.scrub-time {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  color: var(--rule);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Products ── */

.products {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  max-width: 620px;
  margin: 0 auto;
}

.product .product-body {
  margin-top: 1.25rem;
}

.product h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.product h3 .glyph {
  width: 18px;
  height: 18px;
  opacity: 0.35;
  flex-shrink: 0;
}

.product h3 a {
  color: var(--brown);
  text-decoration: none;
  border-bottom: 1px solid var(--cream);
  transition: border-color 0.2s, color 0.2s;
}

.product h3 a:hover {
  color: var(--amber);
  border-color: var(--amber);
}

.product .product-body p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--brown-light);
}

.product .product-body p a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid var(--cream);
  transition: border-color 0.2s, color 0.2s;
}

.product .product-body p a:visited {
  color: var(--brown);
  border-color: var(--cream);
}

.product .product-body p a:hover {
  color: var(--amber-dark);
  border-color: var(--amber);
}

.city-list {
  margin-top: 0.75rem;
}

.product .city-list a,
.city-list a,
.city-list span {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--amber);
  text-decoration: none;
  border-bottom: none;
  transition: opacity 0.2s;
}

.product .city-list a:visited,
.city-list a:visited {
  color: var(--amber);
  border-bottom: none;
}

.city-list a:hover {
  opacity: 0.7;
}

.city-list a + a::before,
.city-list span + span::before,
.city-list a + span::before,
.city-list span + a::before {
  content: '\00b7';
  margin: 0 0.6rem;
  color: var(--amber);
}

.badge {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.55rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brown-light);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.15em 0.5em;
  vertical-align: middle;
  margin-left: 0.5rem;
}

.trail-list span {
  color: var(--brown-light);
}

.trail-list span + span::before {
  color: var(--brown-light);
}

/* ── Pipeline Note ── */

.pipeline-note {
  max-width: 620px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--cream);
}

.pipeline-note p {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--rule);
  letter-spacing: 0.01em;
}

/* ── Intro (legacy, kept for any other pages) ── */

.intro {
  max-width: 620px;
  margin: 0 auto 3.5rem;
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--brown-light);
}

.intro em {
  color: var(--brown);
  font-style: italic;
}

/* ── App Cards (legacy, kept for any other pages) ── */

.apps {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.app-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.app-card .icon {
  overflow: hidden;
  border-radius: 4px 0 0 4px;
  display: flex;
}

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

.app-card .details {
  min-width: 0;
  padding: 2rem;
  border: 0.5px solid var(--rule);
  border-left: none;
  border-radius: 0 4px 4px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-card .app-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 0.15rem;
}

.app-card .app-subtitle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--amber);
  margin-bottom: 0.75rem;
}

.app-card .app-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--brown-light);
}

.app-card .app-badge {
  display: inline-block;
  margin-top: 1rem;
}

.app-card .app-badge img {
  height: 40px;
}

/* ── Footer ── */

footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  text-align: center;
}

footer nav {
  margin-bottom: 0.75rem;
}

footer nav a {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brown-light);
  text-decoration: none;
  margin: 0 1rem;
  transition: color 0.2s ease;
}

footer nav a:hover {
  color: var(--amber);
}

footer .copyright {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  color: var(--rule);
  letter-spacing: 0.05em;
}

/* ── Essay Pages ── */

.essay {
  max-width: 620px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.essay h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 1rem;
}

.essay-subtitle {
  font-size: 0.95rem;
  font-weight: 400;
  font-style: italic;
  color: var(--brown-light);
  margin-bottom: 1.5rem;
}

.essay p {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--brown);
  margin-bottom: 1.25rem;
}

.essay p:first-of-type {
}

/* ── Legal Pages ── */

.legal {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.legal h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 0.25rem;
}

.legal .effective-date {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--amber);
  margin-bottom: 2rem;
}

.legal h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--brown);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.legal p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--brown-light);
  margin-bottom: 1rem;
}

.legal ul {
  list-style: none;
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.legal ul li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--brown-light);
  margin-bottom: 0.25rem;
}

.legal ul li::before {
  content: '\2014';
  margin-right: 0.5rem;
  color: var(--rule);
}

.legal a {
  color: var(--amber-dark);
  text-decoration: none;
  border-bottom: 1px solid var(--cream);
  transition: border-color 0.2s ease;
}

.legal a:hover {
  border-color: var(--amber);
}

/* ── Back link ── */

.back-link {
  display: inline-flex;
  align-items: center;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brown-light);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s ease;
}

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

.back-link .back-text::before {
  content: '\2190\00a0';
}

.back-link .back-icon {
  display: none;
}

@media (max-width: 640px) {
  .back-link .back-text { display: none; }
  .back-link .back-icon {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--rule);
    color: var(--brown-light);
    transition: border-color 0.2s, color 0.2s;
  }
  .back-link:hover .back-icon {
    border-color: var(--amber); color: var(--amber);
  }
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .page-container {
    padding: 0 1.25rem;
  }

  .home-header {
    padding: 2rem 0 2.5rem;
  }

  .home-header h1 {
    font-size: 3rem;
  }

  .desktop-only {
    display: none !important;
  }

  header:not(.home-header):not(:has(.brand-title)) {
    padding: 3rem 0 1.5rem;
  }

  header:not(.home-header):not(:has(.brand-title)) h1 {
    font-size: 2.2rem;
  }

  header:has(.brand-title) {
    padding: 2rem 0 1rem;
  }

  header:has(.brand-title) .back-link {
    top: 2rem;
  }

  .brand-title {
    font-size: 3rem !important;
  }

  .thesis {
    margin-top: 1.5rem;
  }

  .thesis p {
    font-size: 0.95rem;
  }

  .divider {
    margin: 2.5rem 0 2rem;
  }

  .sample-title {
    font-size: 1.15rem;
  }

  .intro {
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
  }

  .app-card {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.25rem;
  }

  .app-card .icon {
    max-width: 240px;
    margin: 0 auto;
  }

  .app-card .app-name {
    font-size: 1.3rem;
  }

  footer nav a {
    font-size: 0.65rem;
    margin: 0 0.5rem;
  }
}
