/* ============================================================
   robertkfoster.com — Shared Stylesheet
   ============================================================ */

/* ── Variables ── */
:root {
  --bg:         #163360;
  --bg-warm:    #102a50;
  --cream:      #e8e0d0;
  --cream-dim:  #a89f90;
  --gold:       #c8a96e;
  --gold-dim:   #7a6540;
  --rule:       rgba(200,169,110,0.25);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Libre Baskerville', Georgia, serif;

  --max-width:  860px;
  --pad-h:      2rem;
}

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

/* ── Card color variants ──────────────────────────────────
   Three tonal sets: dark (aiartwork), medium (home page),
   light (future use). Pick any class on a .card-link.
   ──────────────────────────────────────────────────────── */

/* Dark set */
.card-crimson    { background-color: #8a1a2a; }
.card-pine       { background-color: #1e5a3a; }
.card-sienna     { background-color: #8a3a1a; }
.card-cobalt     { background-color: #1a3a8a; }
.card-terracotta { background-color: #b04a32; }
.card-teal       { background-color: #27706a; }
.card-purple     { background-color: #5e3d80; }
.card-olive      { background-color: #7a6a20; }
.card-gold       { background-color: #8a6a20; }
.card-rose       { background-color: #903050; }
.card-forest     { background-color: #2a6040; }
.card-steel      { background-color: #2a5080; }
.card-indigo     { background-color: #3a2a7a; }
.card-brown      { background-color: #6a3a18; }
.card-slate      { background-color: #3a4a5a; }
.card-moss       { background-color: #4a5a2a; }

/* Medium set */
.card-rose-med      { background-color: #b84a68; }
.card-forest-med    { background-color: #2a7a50; }
.card-sienna-med    { background-color: #9a4a18; }
.card-cobalt-med    { background-color: #3a4a8a; }
.card-teal-med      { background-color: #2a6a7a; }
.card-purple-med    { background-color: #6a3a7a; }
.card-crimson-med   { background-color: #b83a4a; }
.card-pine-med      { background-color: #2a6a4a; }
.card-gold-med      { background-color: #8a6a2a; }
.card-indigo-med    { background-color: #4a3a8a; }
.card-terracotta-med{ background-color: #b85a3a; }
.card-slate-med     { background-color: #4a5a6a; }
.card-olive-med     { background-color: #6a6a2a; }
.card-brown-med     { background-color: #8a5a2a; }
.card-steel-med     { background-color: #3a5a7a; }
.card-moss-med      { background-color: #5a6a3a; }

/* Light set */
.card-rose-lt      { background-color: #c4607a; }
.card-forest-lt    { background-color: #3a8a6a; }
.card-sienna-lt    { background-color: #b06030; }
.card-cobalt-lt    { background-color: #4a5a9a; }
.card-teal-lt      { background-color: #3a7a8a; }
.card-purple-lt    { background-color: #7a4a8a; }
.card-crimson-lt   { background-color: #c05060; }
.card-pine-lt      { background-color: #3a7a5a; }
.card-gold-lt      { background-color: #9a7a3a; }
.card-indigo-lt    { background-color: #5a4a9a; }
.card-terracotta-lt{ background-color: #c06a4a; }
.card-slate-lt     { background-color: #5a6a7a; }
.card-olive-lt     { background-color: #7a7a3a; }
.card-brown-lt     { background-color: #9a6a3a; }
.card-steel-lt     { background-color: #4a6a8a; }
.card-moss-lt      { background-color: #6a7a4a; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img, video {
  max-width: 100%;
  display: block;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--cream);
}

/* ── Navigation ── */
.site-nav {
  position: relative;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-warm);
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.4rem var(--pad-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-home {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--cream);
  white-space: nowrap;
}

.nav-home:hover {
  color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--gold);
}

.nav-links a.active {
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.is-open .nav-dropdown-toggle {
  color: var(--gold);
}

.dropdown-arrow {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.nav-dropdown.is-open .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  border-radius: 2px;
  list-style: none;
  min-width: 140px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown-menu li a {
  display: block;
  padding: 0.7rem 1.1rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  border-bottom: 1px solid var(--rule);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-dropdown-menu li:last-child a {
  border-bottom: none;
}

.nav-dropdown-menu li a:hover {
  color: var(--gold);
  background: rgba(200,169,110,0.07);
}

.nav-dropdown-menu li a.active {
  color: var(--gold);
}

/* Mobile toggle */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--cream);
  transition: background 0.2s ease;
}

.nav-mobile-toggle:hover span {
  background: var(--gold);
}

/* Mobile menu */
.nav-mobile-menu {
  display: none;
  flex-direction: column;
  padding: 1rem var(--pad-h) 1.5rem;
  border-top: 1px solid var(--rule);
  background: var(--bg-warm);
  gap: 0;
}

.nav-mobile-menu.is-open {
  display: flex;
}

.nav-mobile-menu a {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  transition: color 0.2s ease;
}

.nav-mobile-menu a:last-child {
  border-bottom: none;
}

.nav-mobile-menu a:hover {
  color: var(--gold);
}

.nav-mobile-menu a.active {
  color: var(--gold);
}

.nav-mobile-sub {
  padding-left: 1rem !important;
  font-size: 0.78rem !important;
}

/* ── Page header image ── */
.page-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.page-header-text {
  flex: 1;
  min-width: 0;
}

.page-header-image {
  flex-shrink: 0;
  width: auto;
  height: 222px;
  min-width: 160px ;
  overflow: hidden;
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-header-image img {
  height: 222px;
  width: auto;
  display: block;
  object-fit: cover;
}

.page-header-image.is-circle {
  border-radius: 50%;
  width: 222px;
}

.page-header-image.is-circle img {
  width: 222px;
  border-radius: 50%;
  object-fit: cover;
}

.page-header-placeholder {
  color: var(--gold-dim);
  font-size: 1.5rem;
}

@media (max-width: 640px) {
  .page-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header-image {
    width: 100%;
    height: 180px;
    align-self: stretch;
  }

  .page-header-image img {
    width: 100%;
    height: 180px;
  }

  .page-header-image.is-circle {
    width: 180px;
    height: 180px;
    align-self: center;
    border-radius: 50%;
  }

  .page-header-image.is-circle img {
    width: 180px;
    height: 180px;
  }
}


.page-header {
  border-bottom: 1px solid var(--rule);
  padding: 4rem var(--pad-h) 3rem;
}

.page-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--cream);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.page-tagline {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--cream);
  letter-spacing: 0.04em;
}

/* ── Main content ── */
.page-content {
  flex: 1;
  padding: 3.5rem var(--pad-h) 5rem;
}

.content-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}


/* Sitemap */
.sitemap {
  list-style: disc;
  padding-left: 1.5rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 2rem;
  line-height: 3.2;
  color: var(--cream);
}

.sitemap ul {
  list-style: disc;
  padding-left: 1.5rem;
}

/* Section labels */
.section-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2rem;
}

/* ── Catalog product listing ─────────────────────────────────────
   Dynamic product rows on /catalog/index.html.
   Full-width rows with thumbnail, title, excerpt, and more link.
   ─────────────────────────────────────────────────────────────── */

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.catalog-item {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--rule);
  border-bottom: none;
  background: rgba(255,255,255,0.03);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.catalog-item:last-child {
  border-bottom: 1px solid var(--rule);
}

.catalog-item:hover {
  border-color: var(--gold);
  background: rgba(200,169,110,0.06);
  color: inherit;
}

/* Thumbnail */
.catalog-item-thumb {
  flex-shrink: 0;
  width: 60px;
  min-width: 60px;
  height: 80px;
  min-height: 80px;
  overflow: hidden;
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-item-thumb img {
  width: 60px;
  height: 80px;
  object-fit: cover;
  display: block;
}

/* Body */
.catalog-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

/* Line 1: name · category pill */
.catalog-item-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: var(--gold);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-item-dot {
  color: var(--cream-dim);
  margin: 0 0.3em;
}

.catalog-item-pill {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--gold-dim);
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  vertical-align: middle;
}

/* Line 2: type — excerpt */
.catalog-item-desc {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--cream);
  line-height: 1.5;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Line 3: More Details → */
.catalog-item-more {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  text-align: right;
  transition: color 0.2s ease;
}

.catalog-item:hover .catalog-item-more {
  color: var(--gold);
}

/* Empty / error state */
.catalog-empty {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--cream-dim);
  padding: 1.5rem 0;
}

/* Responsive — thumbnail scales down on small screens */
@media (max-width: 480px) {
  .catalog-item-thumb,
  .catalog-item-thumb img {
    width: 45px;
    min-width: 45px;
    height: 60px;
    min-height: 60px;
  }
}

/* ── Site button component ───────────────────────────────────────
   Reusable button/link style. Apply to <a> or <button> elements.
   Base: .site-btn
   Primary (gold fill): .site-btn.site-btn-primary
   Disabled: .site-btn.site-btn-disabled
   ─────────────────────────────────────────────────────────────── */

.site-btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 0.55rem 1.1rem;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  cursor: pointer;
  background: none;
}

.site-btn:hover {
  border-color: var(--gold);
  background: rgba(200,169,110,0.08);
  color: var(--cream);
}

.site-btn-primary {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}

.site-btn-primary:hover {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--bg);
}

.site-btn-disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

/* ── Product detail purchase area ────────────────────────────────
   Full-width purchase button above three-part nav row.
   ─────────────────────────────────────────────────────────────── */

.product-detail-buy {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  margin-bottom: 1rem;
  padding: 0.9rem 2rem;
  font-size: 1rem;
  letter-spacing: 0.14em;
}

.product-detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* ── Pill contrast corrections ───────────────────────────────────
   All pills use white text on their respective backgrounds for
   adequate contrast. Replaces the earlier mixed color/bg-text approach.
   ─────────────────────────────────────────────────────────────── */

.app-link-category {
  color: #ffffff;
}

.app-link-category-artwork {
  background-color: #c05a28;
}

.app-link-category-writing {
  background-color: #c05a28;
}

.app-link-category-finance {
  background-color: #2a7a50;
}

.app-link-category-philosophy {
  background-color: #7a4a9a;
}

.app-link-category-computing {
  background-color: #2a5a9a;
}

.app-link-category-tools {
  background-color: #2a5a9a;
}

.app-link-category-project {
  background-color: #9a3a3a;
}

/* Catalog item pill — gold-dim background, ink blue text has poor
   contrast; switch to bg-warm background with white text */
.catalog-item-pill {
  background: var(--bg-warm);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}

/* ── Product detail ──────────────────────────────────────────────
   Single product display page. Used on /catalog/product.html.
   Layout: image left, details right, purchase link full-width below.
   ─────────────────────────────────────────────────────────────── */

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
  align-items: start;
}

.product-detail-left {
  grid-column: 1;
  grid-row: 1;
  min-height: 200px;
}

.product-detail-left img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
}

.product-detail-right {
  grid-column: 2;
  grid-row: 1;
}

.product-detail-description {
  margin-top: 1.25rem;
}

.product-detail-purchase {
  grid-column: 1 / -1;
  padding-top: 1.5rem;
}

/* Headings scoped to product detail */
.product-detail h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  letter-spacing: 0.04em;
  color: var(--cream);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.product-detail h3 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.product-detail h4 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--cream-dim);
  margin-bottom: 0.5rem;
  margin-top: 1.25rem;
}

/* Description paragraphs */
.product-detail-description p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--cream);
  margin-bottom: 1rem;
}

/* Purchase link */
.product-detail-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--rule);
  padding: 1rem 2rem;
  margin-top: 1rem;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.product-detail-link:hover {
  border-color: var(--gold);
  background: rgba(200,169,110,0.07);
  color: var(--cream);
}

/* Responsive — stack on small screens */
@media (max-width: 640px) {
  .product-detail {
    grid-template-columns: 1fr;
  }

  .product-detail-left,
  .product-detail-right {
    grid-column: 1;
  }

  .product-detail-left { grid-row: 1; }
  .product-detail-right { grid-row: 2; }
  .product-detail-purchase { grid-row: 3; }
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem var(--pad-h);
  margin-top: auto;
  background: var(--bg-warm);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--cream);
}

.footer-copy {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--cream);
}



/* ── Responsive ── */
@media (max-width: 640px) {
  :root {
    --pad-h: 1.25rem;
  }

  .nav-links {
    display: none;
  }

  .nav-mobile-toggle {
    display: flex;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 641px) {
  .nav-mobile-menu {
    display: none !important;
  }
}

/* ── Placeholder pages ── */
.page-placeholder {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--cream);
  letter-spacing: 0.02em;
  padding-top: 1rem;
}

/* ── Card link component (reusable across site) ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

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

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

.card-link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  padding: 1rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  color: inherit;
}

.card-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 8px 0 0 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: #fff;
  line-height: 1.3;
}

.card-desc {
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.82);
  margin-top: 0.6rem;
}

.card-arrow {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s ease, gap 0.2s ease;
}

.card-link:hover .card-arrow {
  color: #fff;
  gap: 0.65rem;
}


/* Footer name as home link */
a.footer-name {
  color: var(--cream);
  text-decoration: none;
  transition: color 0.2s ease;
}

a.footer-name:hover {
  color: var(--gold);
}

/* Page Text Descriptions */
.tool-descriptions {
    max-width: 900px;
    margin-top: 2.5rem;
    margin: 4rem auto 2rem;
    padding: 0 2rem;
}
 
.tool-desc {
    margin-bottom: 2.5rem;
}
 
.tool-desc h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 1.8rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}
 
.tool-desc p {
    font-family: 'Libre Baskerville', serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--cream);
}
 
.tool-desc.workflow {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
}
 
.tool-desc.workflow h3 {
    color: var(--cream);
}

/* ── App link component ── */
.app-links {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: calc((var(--max-width) / 4) * 3 + 3rem);
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.app-link-item {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.app-link-item:hover {
  border-color: var(--gold);
  background: rgba(255,255,255,0.07);
  color: inherit;
}

.app-link-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

.app-link-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-link-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin-bottom: 0.2rem;
}

.app-link-desc {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--cream);
  line-height: 1.6;
}

.app-link-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  flex-shrink: 0;
  min-width: 4.5rem;
}

/* App link category pills */
.app-link-category {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 300;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  border: 1px solid var(--cream);
  color: #1a1a1a;
}

.app-link-category-artwork {
  background-color: #5a4a9a;
}
.app-link-icon-artwork::before {
  content: '🖼️';
}

.app-link-category-writing {
  background-color: #f0a878;
}
.app-link-icon-writing::before {
  content: '✍️';
}

.app-link-category-finance {
  background-color: #7ec8a0;
}
.app-link-icon-finance::before {
  content: '💰';
}

.app-link-category-philosophy {
  background-color: #b89ad0;
}
.app-link-icon-philosophy::before {
  content: '🧠';
}

.app-link-category-computing {
  background-color: #7aaad0;
}
.app-link-icon-computing::before {
  content: '🖥️';
}

.app-link-category-tools {
  background-color: #c05060;
}
.app-link-icon-tools::before {
  content: '🧰';
}

.app-link-category-project {
  background-color: #d08888;
}
.app-link-icon-project::before {
  content: '🎛️';
}

.app-link-arrow {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.app-link-item:hover .app-link-arrow {
  color: var(--gold);
}

/* ── Projects Display ── */
    .projects-section {
      margin-bottom: 3.5rem;
    }

    .projects-section:last-child {
      margin-bottom: 0;
    }

    .section-intro {
      font-family: var(--font-body);
      font-size: 1rem;
      line-height: 1.85;
      color: var(--cream);
      margin-bottom: 1.5rem;
    }

    .section-heading {
      font-family: var(--font-display);
      font-size: clamp(1.4rem, 3vw, 2rem);
      font-weight: 300;
      letter-spacing: 0.04em;
      color: var(--cream);
      margin-bottom: 0.6rem;
      padding-bottom: 0.6rem;
      border-bottom: 1px solid var(--rule);
    }

/* ── Lightbox ── */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 35, 0.95);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.visible {
  display: flex;
}

.lightbox-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 4rem;
  min-height: 0;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-footer {
  width: 100%;
  background: var(--bg-warm);
  border-top: 1px solid var(--rule);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.lightbox-info {
  flex: 1;
  min-width: 0;
}

.lightbox-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  color: var(--cream);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.lightbox-caption {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--cream-dim);
  line-height: 1.5;
}

.lightbox-meta {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--gold-dim);
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

.lightbox-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.lightbox-btn {
  background: none;
  border: 1px solid var(--rule);
  color: var(--cream);
  font-size: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lightbox-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.lightbox-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 1px solid var(--rule);
  color: var(--cream);
  font-size: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
  z-index: 201;
}

.lightbox-close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.lightbox-counter {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--cream-dim);
  letter-spacing: 0.1em;
  min-width: 3rem;
  text-align: center;
}

@media (max-width: 640px) {
  .lightbox-image-wrap {
    padding: 1rem;
  }

  .lightbox-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .lightbox-nav {
    align-self: flex-end;
  }
}


/* ── Writing pages ── */
body.writing-body {
  background-color: var(--cream);
}

body.writing-body nav,
body.writing-body footer {
  background-color: var(--bg-warm);
}

body.writing-body nav a,
body.writing-body nav button,
body.writing-body footer a,
body.writing-body footer p {
  color: var(--cream);
}

body.writing-body nav a:hover,
body.writing-body nav button:hover,
body.writing-body footer a:hover {
  color: var(--gold);
}

.writing-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  color: var(--bg);
}

.writing-eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.75rem;
}

.writing-page h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 2.8rem;
  line-height: 1.15;
  color: var(--bg);
  margin-bottom: 0.5rem;
}

.writing-meta {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--gold-dim);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(22, 51, 96, 0.2);
}

.writing-page p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  color: var(--bg);
  margin-bottom: 1.5rem;
}

.writing-page h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.8rem;
  color: var(--bg);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.writing-page h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--bg);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.writing-page blockquote {
  border-left: 3px solid var(--gold-dim);
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  color: var(--bg-warm);
  font-style: italic;
}

.writing-page a {
  color: var(--bg-warm);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.writing-page a:hover {
  color: var(--gold-dim);
}

.writing-back {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dim);
  text-decoration: none;
  margin-bottom: 2.5rem;
}

.writing-back:hover { color: var(--bg); }
.writing-back i { margin-right: 0.4em; }

.writing-hero {
  width: 100%;
  max-width: 860px;
  height: auto;
  display: block;
  margin: 0 auto 2.5rem;
}

.writing-figure {
  margin: 2rem 0;
}

.writing-figure img {
  width: 100%;
  max-width: 860px;
  height: auto;
  display: block;
}

.writing-figure figcaption {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--gold-dim);
  margin-top: 0.5rem;
  font-style: italic;
}

.writing-img-full {
  width: 100%;
  max-width: 860px;
  height: auto;
  display: block;
  margin: 2rem auto;
}

.writing-rule {
  border: none;
  border-top: 1px solid rgba(22, 51, 96, 0.2);
  margin: 2.5rem 0;
}

.writing-pullquote {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--bg-warm);
  border-left: 3px solid var(--gold);
  margin: 2.5rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  font-style: italic;
}

@media (max-width: 800px) {
  .writing-page { padding: 2rem 1.25rem 4rem; }
  .writing-page h1 { font-size: 2rem; }
}