:root {
  --bg: #111111;
  --surface: #1C1C1C;
  --surface-hover: #212121;
  --accent: #C69C5D;
  --accent-soft: #D8C4A3;
  --accent-hover: #B88945;
  --text: #F5F3EF;
  --muted: #A7A7A7;
  --border: #2C2C2C;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  animation: pageIn 0.6s ease forwards;
}
@keyframes pageIn { to { opacity: 1; } }

a { color: inherit; }
.serif { font-family: 'Libre Baskerville', Georgia, serif; }

/* ---- Scroll-reveal (JS toggles .is-visible) ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---- Word-by-word mask reveal (hero + section headings) ---- */
.word-mask { display: inline-block; overflow: hidden; vertical-align: top; }
.word {
  display: inline-block;
  transform: translateY(115%);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}
.word.is-visible { transform: translateY(0); opacity: 1; }

/* ---- Marquee ticker ---- */
.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  position: relative;
}
.marquee::before, .marquee::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.marquee::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }
.marquee-track {
  display: flex;
  width: max-content;
  gap: 52px;
  animation: marqueeScroll 26s linear infinite;
}
.marquee-track span {
  font-family: 'Libre Baskerville', serif;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 52px;
}
.marquee-track span::after { content: '—'; color: var(--accent); font-style: normal; }
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---- Cursor glow (desktop pointer devices only, added by JS) ---- */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 360px; height: 360px;
  margin-left: -180px; margin-top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198,156,93,0.14), transparent 70%);
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
.cursor-glow.is-active { opacity: 1; }

/* ---- Magnetic buttons (desktop pointer devices only) ---- */
.magnetic { transition: transform 0.2s ease-out; }

/* ---- Header ---- */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 26px 48px; border-bottom: 1px solid var(--border);
}
.brand { font-family: 'Libre Baskerville', serif; font-size: 18px; text-decoration: none; letter-spacing: 0.01em; }
.btn-outline {
  border: 1px solid var(--accent); padding: 9px 20px; border-radius: var(--radius);
  font-size: 13px; text-decoration: none; color: var(--accent-soft);
  font-family: 'Inter', sans-serif; transition: background 0.25s ease, color 0.25s ease;
}
.btn-outline:hover { background: var(--accent); color: var(--bg); }

/* ---- Hero ---- */
.hero { padding: 100px 48px 64px; max-width: 800px; }
.eyebrow {
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: 0.18em;
  color: var(--accent); margin: 0 0 20px; text-transform: uppercase;
}
.hero h1 {
  font-family: 'Libre Baskerville', serif; font-weight: 700; font-size: clamp(36px, 5.4vw, 58px);
  line-height: 1.18; margin: 0 0 26px; letter-spacing: -0.005em;
}
.hero-sub { color: var(--muted); font-size: 17px; max-width: 540px; margin: 0 0 54px; }

.hero-stats { display: flex; align-items: center; gap: 36px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: 'Libre Baskerville', serif; font-size: 36px; color: var(--accent); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 10px; letter-spacing: 0.04em; }
.stat-divider { width: 1px; height: 42px; background: var(--border); }

/* ---- Controls ---- */
.controls {
  padding: 22px 48px; display: flex; flex-wrap: wrap; gap: 20px;
  justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border); margin: 0 0 44px;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-tab {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 8px 16px; border-radius: 8px; font-size: 13px; cursor: pointer;
  font-family: 'Inter', sans-serif; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.filter-tab:hover { border-color: var(--accent); color: var(--text); }
.filter-tab.active { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.search-row input {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 18px; color: var(--text); font-size: 13px; width: 260px; font-family: 'Inter', sans-serif;
}
.search-row input::placeholder { color: var(--muted); }
.search-row input:focus { outline: none; border-color: var(--accent); }

/* ---- Ledger Grid ---- */
.ledger-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px; padding: 0 48px 96px; max-width: 1400px; margin: 0 auto;
}
.empty-note { color: var(--muted); grid-column: 1/-1; text-align: center; padding: 60px 0; }

.ledger-card {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  display: flex; flex-direction: column;
}
.ledger-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -20px rgba(0,0,0,0.6);
}
.ledger-card.is-hidden { display: none; }

.card-media { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; background: #161616; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform 0.5s ease; }
.ledger-card:hover .card-media img { transform: scale(1.05); }
.media-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: 'Libre Baskerville', serif; font-size: 46px; color: var(--accent);
}
.featured-tag {
  position: absolute; top: 12px; right: 12px; background: var(--accent); color: var(--bg);
  font-size: 10px; letter-spacing: 0.06em; padding: 4px 10px; border-radius: 4px;
  font-family: 'Inter', sans-serif; font-weight: 600; text-transform: uppercase;
}

.card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.card-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.file-no { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.industry-tag {
  background: transparent; color: var(--accent-soft); border: 1px solid var(--border);
  font-size: 11px; padding: 4px 11px; border-radius: 6px; letter-spacing: 0.02em;
}
.card-body h3 { font-family: 'Libre Baskerville', serif; font-size: 21px; margin: 0 0 10px; font-weight: 700; }
.card-desc { color: var(--muted); font-size: 14px; margin: 0 0 18px; flex: 1; }
.card-footer { border-top: 1px solid var(--border); padding-top: 16px; font-size: 13px; }
.card-link { text-decoration: none; color: var(--accent); font-weight: 600; transition: color 0.2s ease; }
.card-link:hover { color: var(--accent-soft); }

/* ---- CTA band ---- */
.cta-band {
  text-align: center; padding: 100px 24px; border-top: 1px solid var(--border);
}
.cta-band h2 { font-family: 'Libre Baskerville', serif; font-size: 36px; margin: 0 0 8px; font-weight: 700; }
.cta-band p { color: var(--muted); margin: 0 0 32px; }
.btn-solid {
  display: inline-block; background: var(--accent); color: var(--bg); text-decoration: none;
  padding: 14px 32px; border-radius: var(--radius); font-weight: 600; font-size: 14px;
  transition: background 0.25s ease, transform 0.25s ease;
}
.btn-solid:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* ---- Footer ---- */
.site-footer { text-align: center; padding: 32px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }

/* ---- Case file (single project page) ---- */
.case-file { max-width: 920px; margin: 0 auto; padding: 64px 24px 100px; }
.case-hero { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 44px; }
.case-hero img { width: 100%; display: block; }
.case-header { margin-bottom: 54px; }
.case-header .file-no { display: block; margin-bottom: 14px; }
.case-header h1 { font-family: 'Libre Baskerville', serif; font-size: clamp(30px, 4.6vw, 46px); margin: 0 0 10px; font-weight: 700; }
.case-project-name { color: var(--muted); font-size: 16px; margin: 0; }

.case-body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 64px; }
.case-main h3 { font-family: 'Libre Baskerville', serif; font-size: 19px; margin: 34px 0 10px; font-weight: 700; }
.case-lead { font-size: 18px; color: var(--text); }
.case-main p { color: var(--muted); }
.case-note {
  margin-top: 36px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-size: 13px; display: inline-block;
}

.case-spec { border-left: 1px solid var(--border); padding-left: 38px; height: fit-content; }
.spec-row { margin-bottom: 24px; }
.spec-label { display: block; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 11px; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; }
.spec-value { font-size: 14px; }
.spec-chip {
  display: inline-block; background: var(--bg); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 6px; font-size: 12px; margin: 0 6px 6px 0;
}

.case-nav {
  display: flex; justify-content: space-between; margin-top: 74px;
  padding-top: 32px; border-top: 1px solid var(--border);
}
.case-nav-link { text-decoration: none; color: var(--accent); font-size: 14px; transition: color 0.2s ease; }
.case-nav-link:hover { color: var(--accent-soft); }

.not-found { text-align: center; padding: 120px 24px; }
.not-found h1 { font-family: 'Libre Baskerville', serif; }
.not-found a { color: var(--accent); text-decoration: none; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .site-header, .hero, .controls, .ledger-grid { padding-left: 24px; padding-right: 24px; }
  .case-body { grid-template-columns: 1fr; }
  .case-spec { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 30px; }

  /* Filters: wrap into multiple rows just like desktop — safe to do now
     since .controls is no longer sticky, so it won't pin to the screen. */
  .controls {
    flex-direction: column;
    align-items: stretch;
    padding-top: 16px;
    padding-bottom: 16px;
    gap: 14px;
  }
  .filter-row { flex-wrap: wrap; }
  .search-row input { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
