/* ============================================================
   Stoneforge Labs — shared site styles
   Quiet-luxury dark theme · used by every page
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500&display=swap');

:root {
  --bg:          #070a12;
  --bg-soft:     #0d1420;
  --text:        #f4f8fb;
  --text-soft:   #c8d3dc;
  --text-muted:  #8fa0ae;
  --accent:      #6ea8fe;
  --accent-soft: #b6d1ff;
  --line:        rgba(110, 168, 254, 0.28);
  --line-faint:  rgba(200, 211, 220, 0.12);
  --maxw:        680px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text-soft);
  background-color: var(--bg);
  background-image: radial-gradient(120% 55% at 50% -8%, rgba(110, 168, 254, 0.13), transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* fine film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(110, 168, 254, 0.32); color: var(--text); }
a, button { touch-action: manipulation; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 4px;
}

/* ---- sticky nav ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem clamp(1.25rem, 5vw, 2.5rem);
  background: rgba(10, 10, 11, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid var(--line-faint);
}
.site-nav .wordmark {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.74rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s ease;
}
.site-nav .wordmark:hover { color: var(--accent-soft); }
.site-nav nav { display: flex; gap: clamp(0.9rem, 3vw, 1.9rem); flex-wrap: wrap; }
.site-nav nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.3s ease;
}
.site-nav nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right 0.35s ease;
}
.site-nav nav a:hover { color: var(--text); }
.site-nav nav a:hover::after { right: 0; }
.site-nav nav a.active { color: var(--accent); }
.site-nav nav a.active::after { right: 0; opacity: 0.6; }

/* ---- layout ---- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.75rem, 7vw, 5.5rem) 1.75rem 4rem;
}

/* ---- home hero ---- */
.portrait-frame { position: relative; width: 100%; max-width: 420px; margin: 0 auto 2.75rem; }
.portrait-frame.wide { max-width: 100%; }
.portrait-frame::before {
  content: "";
  position: absolute;
  inset: -14% -10% -6%;
  background: radial-gradient(60% 55% at 50% 38%, rgba(110, 168, 254, 0.22), transparent 70%);
  filter: blur(22px);
  z-index: 0;
}
.portrait-frame img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.85), 0 2px 0 rgba(236, 232, 225, 0.04) inset;
}

.monogram {
  display: block;
  text-align: center;
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--accent);
  margin-bottom: 2.2rem;
  opacity: 0.9;
}

h1.name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: clamp(3rem, 9vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: var(--text);
  text-align: center;
  margin: 0 0 1rem;
}
.tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 1.6rem;
}
.tagline em { color: var(--accent-soft); font-style: italic; }
.rule { width: 56px; height: 1px; margin: 0 auto 4rem; background: linear-gradient(90deg, transparent, var(--accent), transparent); }

/* ---- subpage header ---- */
.page-head { text-align: center; margin-bottom: 3.75rem; }
.eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.page-head h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  line-height: 1.05;
  color: var(--text);
  margin: 0 0 1rem;
}
.page-head .lede {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.15rem, 3.5vw, 1.4rem);
  color: var(--text-muted);
  max-width: 30rem;
  margin: 0 auto;
}
.page-head .rule { margin-top: 2.25rem; margin-bottom: 0; }

/* ---- sections / prose ---- */
section { margin-bottom: 3.5rem; }
h2.label {
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin: 0 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
h2.label::before { content: ""; width: 26px; height: 1px; background: var(--accent); opacity: 0.7; flex: none; }
p { margin: 0 0 1.5rem; font-size: 1.06rem; color: var(--text-soft); }
p:last-child { margin-bottom: 0; }
.muted { color: var(--text-muted); }
a.inline { color: var(--accent-soft); text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color .25s, color .25s; }
a.inline:hover { color: var(--text); border-bottom-color: var(--accent); }

/* ---- founder ---- */
.founder-profile {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: start;
}
.founder-portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.founder-copy { padding-top: 0.4rem; }
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #071018;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease;
}
.button:hover { background: var(--accent-soft); color: #071018; }
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 1.5rem;
}
.profile-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

/* ---- research: entry list ---- */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-faint);
  border-radius: 10px;
  overflow: hidden;
}
.metric {
  min-width: 0;
  padding: clamp(1.2rem, 3vw, 1.6rem);
  border-left: 1px solid var(--line-faint);
}
.metric:first-child { border-left: 0; }
.metric strong {
  display: block;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}
.metric span, .metric small { display: block; }
.metric span {
  margin-top: 0.65rem;
  color: var(--accent-soft);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}
.metric small {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}
.result-note {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}
.entries { border-top: 1px solid var(--line-faint); }
.entry {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.9rem 0;
  border-bottom: 1px solid var(--line-faint);
  transition: padding-left 0.4s cubic-bezier(0.2,0.7,0.2,1);
}
.entry:hover { padding-left: 0.6rem; }
.entry .meta { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.6rem; }
.entry h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.7rem;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 0.5rem;
  transition: color 0.3s ease;
}
.entry:hover h3 { color: var(--accent-soft); }
.entry p { font-size: 1rem; color: var(--text-muted); margin: 0; }
.entry .more { display: inline-block; margin-top: 0.7rem; font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }

/* ---- giving ---- */
.causes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; margin-bottom: 4rem; }
.cause {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-faint);
  border-radius: 10px;
  padding: 1.6rem 1.5rem;
  background: linear-gradient(180deg, rgba(110, 168, 254, 0.05), transparent);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.cause:hover { border-color: var(--line); transform: translateY(-3px); }
.cause .mark { color: var(--accent); font-size: 1.1rem; margin-bottom: 0.7rem; }
.cause h3 { font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: 1.4rem; color: var(--text); margin: 0 0 0.5rem; }
.cause p { font-size: 0.97rem; color: var(--text-muted); margin: 0; }
.cause .donate {
  align-self: flex-start;
  margin-top: 1.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.cause .donate:hover { background: var(--accent); color: #071018; border-color: var(--accent); }

.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-faint); }
.ledger li { display: flex; gap: 1.4rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line-faint); align-items: baseline; }
.ledger time { flex: none; width: 6.5rem; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); padding-top: 0.15rem; }
.ledger .what { color: var(--text-soft); }
.ledger .what strong { color: var(--text); font-weight: 500; }

/* ---- travel gallery ---- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.gallery a { display: block; overflow: hidden; border-radius: 10px; border: 0; }
.gallery img {
  width: 100%; height: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  filter: saturate(0.9) brightness(0.95);
  transition: transform 0.5s cubic-bezier(0.2,0.7,0.2,1), filter 0.5s ease;
}
.gallery a:hover img { transform: scale(1.045); filter: saturate(1.05) brightness(1.02); }
.empty-state {
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 3.5rem 2rem;
  color: var(--text-muted);
}
.empty-state .mark { font-size: 2rem; color: var(--accent); opacity: 0.5; margin-bottom: 1rem; }

/* ---- contact ---- */
.contact-block { text-align: center; }
.contact-lead { max-width: 32rem; margin: 0 auto 2.75rem; color: var(--text-soft); font-size: 1.06rem; }
.address-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.9rem clamp(2rem, 8vw, 3.25rem);
  background: linear-gradient(180deg, rgba(110, 168, 254, 0.06), transparent);
  transition: border-color 0.3s ease, transform 0.3s ease, background 0.3s ease;
}
.address-card:hover { border-color: var(--accent); transform: translateY(-3px); background: linear-gradient(180deg, rgba(110, 168, 254, 0.11), transparent); }
.address-card .ac-label { font-size: 0.7rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent); }
.address-card .ac-value { font-family: 'Cormorant Garamond', Georgia, serif; font-size: clamp(1.7rem, 5.5vw, 2.3rem); color: var(--text); line-height: 1.1; }
.contact-alt { margin-top: 2.6rem; }
.ig-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  transition: color 0.3s ease;
}
.ig-link:hover { color: var(--accent-soft); }
.ig-link svg { width: 20px; height: 20px; display: block; }

/* ---- gaming / stream ---- */
.wrap-wide { max-width: 920px; }
.stream {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.85);
  background: #000;
}
.stream iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stream-note { text-align: center; margin-top: 1.2rem; font-size: 0.92rem; }
.watch-wrap { text-align: center; margin-top: 2.5rem; }
.watch-btn {
  display: inline-block;
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.75rem 1.6rem;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.watch-btn:hover { background: var(--accent); color: #071018; border-color: var(--accent); }

/* ---- footer ---- */
.site-footer {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 4rem auto 0;
  padding: 2.75rem 1.75rem 3.5rem;
  border-top: 1px solid var(--line-faint);
  text-align: center;
}
.site-footer .sigil { font-size: 1.3rem; color: var(--accent); opacity: 0.5; margin-bottom: 1.4rem; }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.4rem; margin-bottom: 1.5rem; }
.site-footer nav a {
  display: inline-flex; min-height: 44px; align-items: center;
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none; transition: color 0.3s ease;
}
.site-footer nav a:hover { color: var(--accent-soft); }
.site-footer .email {
  display: inline-block;
  font-size: 0.82rem; letter-spacing: 0.16em;
  color: var(--text-soft); text-decoration: none;
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.site-footer .email:hover { color: var(--text); border-bottom-color: var(--accent); }
.site-footer .fineprint { font-size: 0.72rem; color: var(--text-muted); margin: 1.5rem 0 0; opacity: 0.7; }
.site-footer .social { display: flex; justify-content: center; margin: 1.4rem 0 0; color: var(--text-muted); transition: color 0.3s ease, transform 0.3s ease; }
.site-footer .social:hover { color: var(--accent-soft); transform: translateY(-2px); }
.site-footer .social svg { width: 22px; height: 22px; display: block; }

/* ---- responsive ---- */
/* nav auto-hide on scroll */
.site-nav { transition: transform 0.4s ease, background 0.3s ease; }
.site-nav.nav-hidden { transform: translateY(-100%); }

/* hamburger toggle (shown on mobile only) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 0; margin: 0;
  background: none; border: 0; cursor: pointer;
  z-index: 20;
}
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--text); border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease; }
.site-nav.open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.site-nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-nav.open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* touch devices: tap feedback in place of hover */
@media (hover: none) {
  .cause:active { transform: scale(0.985); border-color: var(--line); }
  .address-card:active { transform: scale(0.985); border-color: var(--accent); }
  .entry:active { padding-left: 0.6rem; }
  .cause .donate:active, .watch-btn:active, .nav-toggle:active { transform: scale(0.94); }
  .site-nav nav a:active { color: var(--accent); }
}

/* mobile: kill iOS background jank */
@media (max-width: 760px) {
  body { background-attachment: scroll; }
}

/* mobile: hamburger menu + tightened layout */
@media (max-width: 640px) {
  .site-nav { padding: 0.85rem 1.25rem; }
  .nav-toggle { display: inline-flex; }
  .site-nav nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 10, 11, 0.97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-faint);
    padding: 0.25rem 1.5rem 1.5rem;
    transform: translateY(-10px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  }
  .site-nav.open nav { opacity: 1; transform: translateY(0); visibility: visible; }
  .site-nav nav a { width: 100%; min-height: 48px; padding: 0.8rem 0; font-size: 0.85rem; border-bottom: 1px solid var(--line-faint); }
  .site-nav nav a:last-child { border-bottom: 0; }
  .site-nav nav a::after { display: none; }
  .ledger li { flex-direction: column; gap: 0.3rem; }
  .ledger time { width: auto; }
  .founder-profile { grid-template-columns: 1fr; }
  .founder-portrait { max-width: 300px; margin: 0 auto; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { border-top: 1px solid var(--line-faint); }
  .metric:nth-child(-n+2) { border-top: 0; }
  .metric:nth-child(odd) { border-left: 0; }
}

/* ============ interactive features ============ */

/* scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  z-index: 60; pointer-events: none; will-change: transform;
}

/* page fade transitions */
body { animation: pageIn 0.25s ease both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
body.page-leave { animation: none; opacity: 0; transition: opacity 0.18s ease; }

/* accessibility: skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #071018;
  padding: 0.65rem 1.1rem; border-radius: 0 0 8px 0;
  font-size: 0.78rem; letter-spacing: 0.08em; text-decoration: none;
}
.skip-link:focus { left: 0; }
main:focus, .wrap:focus { outline: none; }

/* external-link arrow on inline links */
.inline[target="_blank"]::after { content: " ↗"; font-size: 0.82em; color: var(--accent); }

/* footer privacy link */
.fineprint a { color: var(--text-muted); text-decoration: none; border-bottom: 1px solid var(--line-faint); transition: color 0.3s ease, border-color 0.3s ease; }
.fineprint a:hover { color: var(--accent-soft); border-bottom-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { background-attachment: scroll; animation: none; }
  .gallery img, .gallery a:hover img, .entry, .cause { transition: none; }
  .scroll-progress { display: none; }
}
