/* ============================================================================
   The Lens — the owner's essays, open to everyone (portal/lens/).

   The design of the Lens as it was on the public website (its source:
   src/styles/base.css, nav.css, components.css, lens.css), carried over
   whole so the essays read the same here; the member site's own stylesheet
   is not loaded on these pages. At the end, what this site adds: the way
   into membership, the preview notice, and a slim footer.
   ============================================================================ */

@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 300; font-display: swap; src: url(/assets/fonts/dm-sans-300.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/dm-sans-400.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/dm-sans-500.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/dm-sans-700.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url(/assets/fonts/dm-sans-italic-400.woff2) format('woff2'); }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/dm-mono-400.woff2) format('woff2'); }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/dm-mono-500.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/cormorant-400.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/cormorant-600.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url(/assets/fonts/cormorant-italic-400.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 600; font-display: swap; src: url(/assets/fonts/cormorant-italic-600.woff2) format('woff2'); }

:root {
  --navy: #0f193c;
  --navy-deep: #080f24;
  --navy-deeper: #070e20;
  --navy-ink: #070d1f;
  --navy-mid: #0a1228;
  --gold: #daa520;
  --gold-light: #e8b84b;
  --gold-bright: #f0c040;
  --cream: #f5f0e8;
  --muted: #8a9ab5;
  --slate: #c8d0e0;
  --slate-dim: #7e8da8;

  --sans: 'DM Sans', 'DM Sans Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Cormorant Garamond', 'Cormorant Fallback', Georgia, 'Times New Roman', serif;
  --mono: 'DM Mono', 'DM Mono Fallback', ui-monospace, Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --nav-h: 4.5rem;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  line-height: 1.5;
  scrollbar-gutter: stable;
  -webkit-tap-highlight-color: transparent;
  background: var(--navy-deep);
}
/* Smooth in-page scrolling, switched on after load so a link like /#contact
   jumps straight there instead of gliding through the whole page. */
@media (prefers-reduced-motion: no-preference) { html.smooth-scroll { scroll-behavior: smooth; } }
body {
  min-height: 100vh;
  background: var(--navy-deep);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
ol, ul { list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; background: transparent; border-radius: 0; }
button { cursor: pointer; }
blockquote, figure { margin: 0; }
em { font-style: italic; }
strong, b { font-weight: 600; }
[hidden] { display: none !important; }
::selection { background: rgba(218, 165, 32, 0.35); color: var(--cream); }

/* Keyboard focus: a clear gold ring, never shown for mouse clicks */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 1px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 1000;
  padding: 0.75rem 1.25rem; background: var(--gold); color: var(--navy-deep);
  font: 500 0.7rem/1 var(--mono); letter-spacing: 0.15em; text-transform: uppercase;
  transform: translateY(-200%); transition: transform 0.2s;
}
.skip-link:focus { transform: none; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
/* Matches the original's effective widths (stepped max-width + side padding) */
.container { width: 100%; margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 640px) { .container { max-width: 40rem; padding-inline: 2rem; } }
@media (min-width: 768px) { .container { max-width: 48rem; } }
@media (min-width: 1024px) { .container { max-width: 64rem; padding-inline: 3rem; } }
@media (min-width: 1280px) { .container { max-width: 80rem; } }
@media (min-width: 1440px) { .container { padding-inline: 5rem; } }
@media (min-width: 1536px) { .container { max-width: 96rem; } }
@media (min-width: 1600px) { .container { padding-inline: 7rem; } }

.layer { position: relative; z-index: 10; }
.center { text-align: center; margin-inline: auto; }

/* Scroll-in reveal. Only hidden when JavaScript is running, so the page is
   always readable (search engines, link previews, script failures).
   The script removes these classes once an element has arrived, so hover
   effects on cards keep their own transitions. */
.js .reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity 0.8s var(--ease-out) var(--rd, 0s), transform 0.8s var(--ease-out) var(--rd, 0s); }
.js .reveal.visible { opacity: 1; transform: none; }
/* Safety net: if the script hasn't taken over within 2.5 s (slow or failed
   download), show everything rather than leave the page blank. */
html.js:not(.reveal-ready) .reveal, html.js:not(.reveal-ready) .gold-rule:not(.visible) { animation: reveal-fallback 0.6s ease 2.5s forwards; }
@keyframes reveal-fallback { to { opacity: 1; transform: none; } }
.reveal-delay-1 { --rd: 0.1s; }
.reveal-delay-2 { --rd: 0.2s; }
.reveal-delay-3 { --rd: 0.3s; }
.reveal-delay-4 { --rd: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js .reveal { transform: none; }
}

/* The brand mark (components.css) */
.brand { font-family: var(--serif); font-weight: 600; font-style: italic; font-size: 1.25rem; letter-spacing: 0.01em; white-space: nowrap; }
.brand__btc { color: var(--gold); }
.brand__name { color: var(--cream); }


/* ── Header on The Lens ────────────────────────────────────────────────────── */
.lens-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}
.lens-nav.is-scrolled { background-color: rgba(8, 15, 36, 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom-color: rgba(218, 165, 32, 0.12); }
.lens-nav__inner { position: relative; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.lens-nav__home {
  position: absolute; left: 50%; transform: translateX(-50%); padding: 0.5rem 0.75rem;
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); transition: opacity 0.2s;
}
.lens-nav__home:hover { opacity: 0.7; }
.lens-nav__members { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(218, 165, 32, 0.7); transition: color 0.2s; }
.lens-nav__members:hover { color: var(--gold); }

/* ── The Lens ──────────────────────────────────────────────────────────────── */
.page-lens, .page-article { background: var(--navy-ink); }
.lens { background: var(--navy-ink); }
.lens-narrow { max-width: 860px; }
.lens-label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.lens-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0 1rem; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--slate-dim); }
.lens-meta .dot { color: rgba(218, 165, 32, 0.3); }
.gold-meta { color: rgba(218, 165, 32, 0.75); }
.lens-back { display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 3rem; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(218, 165, 32, 0.75); transition: color 0.2s; }
.lens-back:hover { color: var(--gold); }
.lens-more { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(218, 165, 32, 0.82); transition: gap 0.2s, color 0.2s; }
.lens-more:hover { gap: 0.75rem; color: var(--gold); }
.lens-more--lg { color: var(--gold); gap: 0.5rem; }
.lens-more--lg:hover { gap: 0.9rem; }

.lens-hero { position: relative; min-height: 72vh; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: var(--navy-ink); }
.lens-hero__field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lens-hero__vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 80% 60% at 50% 50%, transparent 30%, rgba(7,13,31,0.7) 80%, var(--navy-ink) 100%); }
.lens-hero__fade { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--navy-ink)); }
.lens-hero__content { position: relative; z-index: 10; padding-top: 10rem; padding-bottom: 5rem; }
.lens-hero__content .lens-back { color: rgba(218, 165, 32, 0.72); }
.lens-hero__content .lens-label { display: block; margin-bottom: 1rem; }
.lens-hero__title { margin-bottom: 1.5rem; font-family: var(--serif); font-weight: 600; font-size: clamp(4rem, 10vw, 9rem); line-height: 1.08; letter-spacing: -0.02em; color: var(--cream); }
.lens-hero__title em { color: var(--gold); }
.lens-hero__lede { max-width: 48ch; font-size: clamp(0.95rem, 1.6vw, 1.15rem); line-height: 1.75; color: #8494ad; }
.lens-hero__rule { width: 3.5rem; height: 1px; margin-top: 2.5rem; background: rgba(218, 165, 32, 0.45); }
.fade-up { animation: fade-up 0.8s var(--ease-out) both; }
.fade-up--2 { animation-delay: 0.2s; }
.fade-up--3 { animation-delay: 0.4s; }
.fade-up--4 { animation-delay: 0.6s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } }

.lens-list { padding-bottom: 8rem; }
.lens-latest { padding: 3.5rem 0; border-top: 1px solid rgba(218, 165, 32, 0.2); }
.lens-latest__bar { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.75rem; }
.lens-latest__bar .lens-label { color: rgba(218, 165, 32, 0.7); }
.lens-latest__line { flex: 1; height: 1px; background: rgba(218, 165, 32, 0.12); }
.lens-latest__title { max-width: 18ch; margin-bottom: 1.25rem; font-family: var(--serif); font-weight: 600; font-size: clamp(2.4rem, 5.5vw, 4.5rem); line-height: 1.08; letter-spacing: -0.02em; }
.lens-latest__title a, .lens-item__title a { color: var(--cream); transition: color 0.25s; }
.lens-latest__title a:hover, .lens-item__title a:hover { color: var(--gold); }
.lens-latest__excerpt { max-width: 58ch; margin-bottom: 2rem; font-size: clamp(1rem, 1.6vw, 1.2rem); line-height: 1.75; color: #a8b4c8; }
.lens-item { display: grid; gap: 0.75rem; padding: 2.75rem 0; border-top: 1px solid rgba(218, 165, 32, 0.12); }
.lens-item:last-child { border-bottom: 1px solid rgba(218, 165, 32, 0.12); }
.lens-item__num { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.2em; color: rgba(218, 165, 32, 0.72); }
.lens-item__title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.08; letter-spacing: -0.02em; }
.lens-item__excerpt { max-width: 60ch; margin-top: 0.25rem; font-size: 0.975rem; line-height: 1.75; color: var(--muted); }
.lens-item .lens-more { margin-top: 0.5rem; justify-self: start; }
.lens-colophon { padding: 3rem 0 4rem; border-top: 1px solid rgba(218, 165, 32, 0.08); }
.lens-colophon__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; }
.lens-colophon__text { font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: #8090ab; }
.lens-colophon__link { color: rgba(218, 165, 32, 0.75); transition: color 0.2s; }
.lens-colophon__link:hover { color: var(--gold); }

/* ── Article ───────────────────────────────────────────────────────────────── */
.read-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 200; height: 2px; background: rgba(218, 165, 32, 0.1); }
.read-progress span { display: block; height: 100%; width: 100%; background: var(--gold); box-shadow: 0 0 8px rgba(218, 165, 32, 0.6); transform-origin: left; transform: scaleX(0); }
.article__header { padding: 9rem 0 4rem; border-bottom: 1px solid rgba(218, 165, 32, 0.1); }
.article__meta { gap: 0 1rem; margin-bottom: 1.75rem; }
.article__title { max-width: 16ch; margin-bottom: 1.5rem; font-family: var(--serif); font-weight: 600; font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1.08; letter-spacing: -0.02em; color: var(--cream); }
.article__excerpt { max-width: 52ch; font-family: var(--serif); font-style: italic; font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.55; color: var(--muted); }
.article__body-wrap { padding: 4.5rem 0 7rem; }
.article__measure { max-width: 680px; }
.article__rule { width: 3rem; height: 1px; margin-bottom: 3.5rem; background: rgba(218, 165, 32, 0.45); }
.article__sign { display: flex; align-items: center; gap: 1.25rem; margin-top: 5rem; padding-top: 2.5rem; border-top: 1px solid rgba(218, 165, 32, 0.1); font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--slate-dim); }
.article__sign span { flex: none; width: 2.5rem; height: 1px; background: rgba(218, 165, 32, 0.35); }

.prose { font-size: 1.1rem; line-height: 1.85; color: var(--slate); overflow-wrap: break-word; }
.prose p { margin-bottom: 1.6rem; }
.prose h2, .prose h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; scroll-margin-top: 6rem; }
.prose h2 { margin: 3.5rem 0 1.25rem; padding-top: 2.5rem; border-top: 1px solid rgba(218, 165, 32, 0.14); font-size: clamp(1.5rem, 2.8vw, 2rem); color: var(--cream); }
.prose h3 { margin: 2.5rem 0 1rem; font-size: clamp(1.2rem, 2vw, 1.5rem); color: #e8dfc8; }
.prose hr { width: 30%; height: 1px; margin: 3rem auto; border: 0; background: rgba(218, 165, 32, 0.35); }
.prose blockquote { margin: 2.5rem 0; padding-left: 1.75rem; border-left: 2px solid rgba(218, 165, 32, 0.7); font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.55; color: #e8dfc8; }
.prose blockquote p { margin: 0; }
.prose ul, .prose ol { margin-bottom: 1.6rem; }
.prose li { position: relative; padding-left: 1.75rem; margin-bottom: 1rem; }
.prose ul > li::before { content: '•'; position: absolute; left: 0.5rem; color: var(--gold); }
.prose ol { counter-reset: n; }
.prose ol > li { counter-increment: n; padding-left: 2.1rem; }
.prose ol > li::before { content: counter(n) '.'; position: absolute; left: 0.5rem; top: 0.1em; font-family: var(--mono); font-size: 0.85rem; color: var(--gold); }
.prose code { font-family: var(--mono); font-size: 0.9em; font-weight: 500; color: #4caf50; }
.prose a { color: var(--gold); text-decoration: underline; text-decoration-color: rgba(218, 165, 32, 0.35); text-underline-offset: 3px; transition: color 0.2s, text-decoration-color 0.2s; }
.prose a:hover { color: var(--gold-bright); text-decoration-color: rgba(240, 192, 64, 0.7); }
.prose strong { color: var(--cream); font-weight: 600; }
.prose__update { gap: 0 0.75rem; margin: -0.25rem 0 2rem; }
.prose__figure { margin: 2.5rem 0; }
.prose__figure img { border: 1px solid rgba(218, 165, 32, 0.2); }
.gallery { margin: 3rem 0; }
.gallery__grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 0.875rem; }
.gallery__frame { display: block; overflow: hidden; border: 1px solid rgba(218, 165, 32, 0.2); background: var(--navy-mid); }
.gallery__frame img { width: 100%; transition: transform 0.35s var(--ease-out); }
.gallery__frame:hover img { transform: scale(1.02); }
.gallery figcaption { margin-top: 0.9rem; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; line-height: 1.6; text-transform: uppercase; color: var(--slate-dim); }

.lens-pn { padding: 3.5rem 0; border-top: 1px solid rgba(218, 165, 32, 0.1); }
.lens-pn__grid { display: grid; gap: 2rem; }
.lens-pn__grid--two { grid-template-columns: 1fr 1fr; }
.lens-pn__link { display: block; }
.lens-pn__link .lens-label { color: rgba(218, 165, 32, 0.72); }
.lens-pn__title { display: block; margin-top: 0.6rem; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.2; color: var(--cream); transition: color 0.2s; }
.lens-pn__link:hover .lens-pn__title { color: var(--gold); }
.lens-pn__grid--two .lens-pn__next { text-align: right; }
@media (max-width: 600px) { .lens-pn__grid--two { grid-template-columns: 1fr; } .lens-pn__grid--two .lens-pn__next { text-align: left; } }
.lens-cta { padding: 5rem 0 6rem; text-align: center; border-top: 1px solid rgba(218, 165, 32, 0.08); }
.lens-cta__text { margin: 0.75rem 0 2rem; font-family: var(--serif); font-style: italic; font-size: clamp(1rem, 2vw, 1.3rem); color: #8090ab; }
.lens-cta .lens-more { color: rgba(218, 165, 32, 0.82); }

/* ── Added on the member site ─────────────────────────────────────────────── */
.lens-nav__side { display: flex; align-items: center; gap: 1.5rem; }
.lens-nav__join { padding: 0.55rem 0.9rem; border: 1px solid rgba(218, 165, 32, 0.55); font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); transition: background-color 0.2s, color 0.2s; }
.lens-nav__join:hover { background: var(--gold); color: var(--navy-deep); }
@media (max-width: 640px) { .lens-nav__home { display: none; } .lens-nav__side { gap: 1rem; } }
@media (max-width: 420px) { .lens-nav__join { display: none; } }

/* The way into membership, after the essays */
.lens-join { padding: 5rem 0 6rem; border-top: 1px solid rgba(218, 165, 32, 0.12); background: linear-gradient(to bottom, rgba(218, 165, 32, 0.03), transparent 60%); }
.lens-join__inner { max-width: 680px; }
.lens-join__title { margin: 1rem 0 1.25rem; font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.08; letter-spacing: -0.02em; color: var(--cream); }
.lens-join__title em { color: var(--gold); }
.lens-join__text { max-width: 58ch; font-size: 1.02rem; line-height: 1.8; color: var(--slate); }
.lens-join__actions { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; margin-top: 2rem; }
.lens-button { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.95rem 1.4rem; border: 1px solid var(--gold); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); transition: background-color 0.2s, color 0.2s; }
.lens-button:hover { background: var(--gold); color: var(--navy-deep); }

/* A draft's preview, seen only through its private link */
.lens-preview { position: relative; z-index: 150; padding: 0.85rem 0; background: rgba(218, 165, 32, 0.14); border-bottom: 1px solid rgba(218, 165, 32, 0.35); font-size: 0.85rem; color: var(--cream); margin-top: var(--nav-h); }
.lens-preview + main .article__header { padding-top: 5rem; }

/* Footer */
.lens-footer { padding: 3rem 0 3.5rem; border-top: 1px solid rgba(218, 165, 32, 0.15); background: var(--navy-deep); }
.lens-footer__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; }
.lens-footer__links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; }
.lens-footer__links a { color: rgba(218, 165, 32, 0.75); transition: color 0.2s; }
.lens-footer__links a:hover { color: var(--gold); }
.lens-footer__note { max-width: 70ch; margin-top: 2rem; font-size: 0.78rem; line-height: 1.7; color: var(--slate-dim); }

/* Small text links still give a finger at least 24px to land on. */
.lens-nav__members, .lens-back, .lens-more, .lens-colophon__link, .lens-footer__links a {
  display: inline-flex; align-items: center; min-height: 24px;
}
