/* Layout: one living stage per page — the orbiting portrait at the centre, knowledge in motion around it, content in a calm column */
:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --ink: #14213D;
  --muted: #5A6275;
  --gold: #D4A24C;
  --gold-ink: #8A5F12;
  --rule: #E3DED3;
  --frag-bg: rgba(255, 255, 255, .82);
  --halo: rgba(247, 245, 240, 0);
  --night: #14213D;
  --on-night: #F7F5F0;
  --thread: rgba(212, 162, 76, .24);
  --thread-ink: rgba(20, 33, 61, .055);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Montserrat", Arial, Helvetica, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F203F; --surface: #172A4D; --ink: #F7F5F0; --muted: #B4BBCB; --gold: #D4A24C; --gold-ink: #E2B866;
    --rule: rgba(247, 245, 240, .14); --frag-bg: rgba(20, 33, 61, .78); --halo: transparent;
    --night: #F7F5F0; --on-night: #14213D; --thread: rgba(212, 162, 76, .22); --thread-ink: rgba(247, 245, 240, .05); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F203F; --surface: #172A4D; --ink: #F7F5F0; --muted: #B4BBCB; --gold: #D4A24C; --gold-ink: #E2B866;
  --rule: rgba(247, 245, 240, .14); --frag-bg: rgba(20, 33, 61, .78); --halo: transparent;
  --night: #F7F5F0; --on-night: #14213D; --thread: rgba(212, 162, 76, .22); --thread-ink: rgba(247, 245, 240, .05); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* ---------- Day / night: the orbit toggle ---------- */
.orbit-toggle {
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--gold);
  display: grid; place-items: center; position: relative;
}
.orbit-toggle svg { width: 44px; height: 44px; overflow: visible; }
.orbit-toggle .ring { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .8; }
.orbit-toggle .sun { fill: var(--gold); transition: r .5s var(--ease); }
.orbit-toggle .bite { fill: var(--bg); transform: translate(14px, -10px); transition: transform .6s var(--ease), fill .6s var(--ease); }
.orbit-toggle .rays { stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; transform-origin: 22px 22px; transition: opacity .4s, transform .6s var(--ease); }
.orbit-toggle .moonlet { fill: var(--ink); transform-origin: 22px 22px; transition: transform .8s var(--ease); }
.orbit-toggle:hover .ring { opacity: 1; }
html.is-dark .orbit-toggle .bite { transform: translate(4px, -3px); }
html.is-dark .orbit-toggle .rays { opacity: 0; transform: rotate(45deg) scale(.6); }
html.is-dark .orbit-toggle .moonlet { transform: rotate(180deg); }
.orbit-toggle .auto-half { fill: var(--ink); opacity: 0; transition: opacity .5s; }
html.is-auto .orbit-toggle .bite { transform: translate(14px, -10px); }
html.is-auto .orbit-toggle .rays { opacity: .5; transform: rotate(22deg) scale(.85); }
html.is-auto .orbit-toggle .auto-half { opacity: 1; }
html.is-auto .orbit-toggle .moonlet { transform: rotate(90deg); }
.orbit-toggle.flash svg { animation: tspin .7s var(--ease); }
@keyframes tspin { from { transform: rotate(-120deg) scale(.8); } to { transform: none; } }
.toggle-label {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; white-space: nowrap;
  font-size: .76rem; font-weight: 500; color: var(--ink); background: var(--surface); padding: 6px 10px; border-radius: 10px;
  box-shadow: 0 0 0 1px var(--rule), 0 10px 24px -14px rgba(20, 33, 61, .5);
  opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.orbit-toggle.tip .toggle-label, .fresh-btn.tip .toggle-label { opacity: 1; transform: none; }

/* ---------- Floating tools: clear cache (left) and day / night / auto (right), always just above the footer ---------- */
.float-tools { position: fixed; left: 0; right: 0; bottom: 18px; z-index: 30; display: flex; justify-content: space-between; align-items: center;
  padding: 0 max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.float-tools > * { pointer-events: auto; }
.float-tools .orbit-toggle, .fresh-btn { width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 0 0 1px var(--rule), 0 12px 26px -16px rgba(20, 33, 61, .55); }
.float-tools .toggle-label { top: auto; bottom: calc(100% + 10px); transform: translateY(4px); }
.float-tools .orbit-toggle .toggle-label { right: 0; }
.fresh-btn { padding: 0; border: 0; cursor: pointer; color: var(--gold); display: grid; place-items: center; position: relative; }
.fresh-btn .toggle-label { left: 0; right: auto; }
.fresh-btn svg { width: 44px; height: 44px; overflow: visible; }
.fresh-btn .ring { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .8; transform-origin: 22px 22px; }
.fresh-btn .sweep, .fresh-btn .tip { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transform-origin: 22px 22px; transition: transform .6s var(--ease); }
.fresh-btn .spark { stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; transform-origin: 33px 10.5px; transition: transform .5s var(--ease); }
.fresh-btn .dot { fill: var(--ink); }
.fresh-btn:hover .sweep, .fresh-btn:hover .tip { transform: rotate(-40deg); }
.fresh-btn:hover .spark { transform: rotate(45deg) scale(1.2); }
.fresh-btn.working .sweep, .fresh-btn.working .tip { animation: fresh-spin .65s linear infinite; }
.fresh-btn.working .ring { animation: ringspin 3s linear infinite; }
@keyframes fresh-spin { to { transform: rotate(-360deg); } }
@keyframes ringspin { to { transform: rotate(360deg); } }
.fresh-toast { position: fixed; left: 50%; top: 18px; z-index: 60; transform: translateX(-50%); margin: 0; padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-size: .86rem; font-weight: 500; box-shadow: 0 14px 30px -16px rgba(0,0,0,.6); transition: opacity .5s, transform .5s; }
.fresh-toast.out { opacity: 0; transform: translate(-50%, -10px); }
@media (max-width: 640px) { .float-tools .orbit-toggle, .fresh-btn { width: 46px; height: 46px; } .fresh-btn svg, .float-tools .orbit-toggle svg { width: 38px; height: 38px; } }

/* ---------- Inner pages: threads of order ---------- */
.threads { position: fixed; inset: 0; z-index: 0; pointer-events: none; width: 100%; height: 100%; }
.frag {
  position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: auto;
  display: inline-flex; align-items: baseline; gap: 8px;
  font-size: .84rem; color: var(--ink); padding: 6px 12px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--frag-bg);
  will-change: transform, opacity; user-select: none; -webkit-user-select: none; cursor: default;
  transition: background-color .6s, border-color .6s, color .6s;
}
.frag .tag { font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
body.inner { overflow-x: clip; }

/* ---------- Inner page chrome ---------- */
body.inner::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 104px; padding-block: 10px; }
.home-link { display: flex; align-items: center; text-decoration: none; }
.home-link img { width: clamp(180px, 19vw, 230px); height: auto; }
.home-link .logo-night { display: none; }
html.is-dark .home-link .logo-day { display: none; }
html.is-dark .home-link .logo-night { display: block; }
.top-right { display: flex; align-items: center; gap: 6px; }
/* Navigation: an orbit button that opens a full-screen sheet with a circular reveal */
.nav-orb { position: relative; z-index: 60; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.nav-orb svg { width: 40px; height: 40px; overflow: visible; }
@media (max-width: 760px) { .nav-orb svg { width: 46px; height: 46px; } }
.nav-orb .o-ring { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-dasharray: 2 4; transform-origin: 24px 24px; animation: ringspin 22s linear infinite; }
.nav-orb .o-moon { fill: var(--gold); transform-origin: 24px 24px; animation: ringspin 7s linear infinite; }
.nav-orb path { stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; transform-origin: 24px 24px; transition: transform .45s var(--ease), opacity .3s, d .45s var(--ease); }
.nav-orb .o-l2 { stroke: var(--gold); }
.nav-orb:hover .o-l2 { transform: translateX(6px); }
.nav-orb:hover .o-l1 { transform: translateX(-2px); }
.nav-orb[aria-expanded="true"] { color: var(--ink); }
.nav-orb[aria-expanded="true"] .o-l1 { transform: translateY(5px) rotate(45deg); }
.nav-orb[aria-expanded="true"] .o-l3 { transform: translateY(-5px) rotate(-45deg); }
.nav-orb[aria-expanded="true"] .o-l2 { opacity: 0; transform: translateX(10px); }
.nav-sheet { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: center; gap: 28px;
  padding: 130px max(24px, 7vw) 50px; background: var(--bg); color: var(--ink); overflow-y: auto;
  clip-path: circle(0 at var(--ox, calc(100% - 50px)) var(--oy, 50px)); visibility: hidden; transition: clip-path .7s cubic-bezier(.7, 0, .2, 1), visibility 0s .7s; }

.nav-sheet.open { clip-path: circle(150vmax at var(--ox, calc(100% - 50px)) var(--oy, 50px)); visibility: visible; transition: clip-path .75s cubic-bezier(.7, 0, .2, 1), visibility 0s; }
.nav-sheet::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(60vmax 60vmax at 85% 10%, rgba(212, 162, 76, .14), transparent 60%), radial-gradient(50vmax 50vmax at 0% 100%, rgba(90, 98, 117, .16), transparent 60%); }
.ns-list { position: relative; list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 0; width: 100%; max-width: 760px; }
.ns-quote { margin-inline: auto !important; width: 100%; max-width: 760px; }
.ns-list a { display: grid; grid-template-columns: 3.2rem 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: baseline; padding: 11px 0; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--rule); opacity: 0; transform: translateY(30px); transition: opacity .5s, transform .6s var(--ease), color .3s; }
.nav-sheet.open .ns-list a { opacity: 1; transform: none; }
.nav-sheet.open li:nth-child(1) a { transition-delay: .25s; } .nav-sheet.open li:nth-child(2) a { transition-delay: .33s; }
.nav-sheet.open li:nth-child(3) a { transition-delay: .41s; } .nav-sheet.open li:nth-child(4) a { transition-delay: .49s; } .nav-sheet.open li:nth-child(5) a { transition-delay: .57s; }
.ns-n { grid-row: 1 / 3; font: 600 .85rem var(--body); letter-spacing: .1em; color: var(--gold-ink); }
.ns-t { font-family: var(--display); font-weight: 500; font-size: clamp(1.7rem, 3.4vw, 2.7rem); line-height: 1.05; letter-spacing: -0.02em; transition: transform .45s var(--ease), color .3s; transform-origin: left center; }
.ns-d { font-size: .86rem; color: var(--muted); margin-top: 2px; }
.ns-list a:hover .ns-t, .ns-list a:focus-visible .ns-t { color: var(--gold-ink); transform: translateX(14px); font-style: italic; }
.ns-list a[aria-current="page"] .ns-t { color: transparent; -webkit-text-stroke: 1px var(--gold-ink); }
.ns-list a:focus-visible { outline: none; }
.ns-quote { position: relative; margin: 0; max-width: 760px; font-family: var(--display); font-style: italic; color: var(--muted); opacity: 0; transition: opacity .6s .6s; }
.ns-quote span { font-style: normal; font: 600 .8rem var(--body); color: var(--gold-ink); }
.nav-sheet.open .ns-quote { opacity: 1; }
body.nav-open { overflow: hidden; }
body.nav-open .float-tools { opacity: 0; pointer-events: none; }
body.nav-open .top { z-index: 70; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (prefers-reduced-motion: reduce) { .nav-sheet, .nav-sheet.open, .ns-list a { transition: none; } }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-2deg); } }

main.inner-main { position: relative; z-index: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 999px; border: 2px solid transparent;
  font: 600 .98rem/1 var(--body); text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s, color .25s, border-color .25s, box-shadow .25s;
}
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--ink) 70%, transparent); transform: translateY(-2px); }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: var(--bg); }
.btn-gold { background: var(--gold); color: #14213D; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -12px rgba(212, 162, 76, .9); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--rule); }
.btn-ghost:hover { color: var(--ink); border-color: var(--muted); }

/* Footer: the fields keep moving; below them the legal links and social icons. */
main.inner-main { min-height: calc(100vh - 104px); padding-bottom: 72px; }
.foot { position: relative; z-index: 1; margin-top: 120px; padding-block: 0 20px; background: #14213D; color: #F7F5F0; overflow: hidden; }
:root[data-theme="dark"] .foot { background: #172A4D; }
.foot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, #D4A24C 20%, #D4A24C 80%, transparent); }
.marquee { overflow: hidden; white-space: nowrap; }
.m-track { display: inline-flex; align-items: center; gap: 28px; padding-right: 28px; animation: marquee 48s linear infinite; will-change: transform; }
.marquee:hover .m-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.m-big { padding-block: 18px 16px; border-bottom: 1px solid rgba(247, 245, 240, .12); }
.m-big span { font-family: var(--display); font-weight: 500; font-size: clamp(1.35rem, 3.6vw, 2.4rem); line-height: 1; letter-spacing: -0.02em; }
.m-big span:nth-child(odd) { color: #D4A24C; }
.m-big span:nth-child(even) { color: transparent; -webkit-text-stroke: 1px rgba(247, 245, 240, .6); }
.m-big span::after { content: "\2726"; display: inline-block; margin-left: 28px; font-size: .32em; vertical-align: middle; color: #D4A24C; -webkit-text-stroke: 0; }
.foot-row { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; }
.foot-small { margin: 0; font-size: .84rem; color: #C9CEDA; min-width: 0; }
.foot-small { white-space: nowrap; }
@media (max-width: 520px) { .foot-row { gap: 10px; padding-top: 16px; } .foot-small { font-size: .64rem; letter-spacing: -.005em; } .foot-links a { font-size: .7rem; } .foot-links { gap: 12px; flex: none; flex-wrap: nowrap; } }
.foot-links { display: flex; gap: 6px 22px; flex-wrap: wrap; }
.foot-links a { color: #F7F5F0; font-size: .88rem; font-weight: 500; text-decoration: none; padding: 6px 0; }
.foot-links a:hover { color: #D4A24C; }

/* Social icons (footer, home and About) */
.foot-social { display: flex; flex-wrap: wrap; gap: 8px; }
.social-link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 44px; min-height: 44px; border-radius: 999px; color: inherit; text-decoration: none; transition: background-color .25s, color .25s, transform .25s var(--ease); }
.social-link svg { width: 21px; height: 21px; flex: none; }
.foot .social-link { color: #F7F5F0; box-shadow: inset 0 0 0 1px rgba(247, 245, 240, .22); }
.foot .social-link:hover { color: #14213D; background: #D4A24C; box-shadow: none; transform: translateY(-2px); }
.foot-social.small .social-link { min-width: 36px; min-height: 36px; color: var(--muted); }
.foot-social.small .social-link:hover { color: var(--gold-ink); }
.foot-social.small svg { width: 18px; height: 18px; }

@media (max-width: 760px) {
  .home-link img { width: 168px; }
  .top-row { min-height: 84px; }
  .nav-sheet { padding-top: 100px; }
  .ns-list a { grid-template-columns: 2.4rem 1fr; padding: 12px 0; }
}
}
@media (max-width: 640px) {
  .frag { font-size: .76rem; padding: 5px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* The living button: gold that turns navy as you come near, a light sweep, a breathing halo, and a pull toward your pointer */
.btn-alive { --p: 0; --mx: 0px; --my: 0px; position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; gap: 12px;
  min-height: 62px; padding: 0 30px 0 34px; border: 0; border-radius: 999px; cursor: pointer; font: 700 1.06rem var(--body); letter-spacing: .01em;
  color: color-mix(in srgb, #D4A24C calc(var(--p) * 100%), #14213D);
  background: color-mix(in srgb, #14213D calc(var(--p) * 100%), #D4A24C);
  transform: translate(var(--mx), var(--my)) scale(calc(1 + var(--p) * .05)); transition: transform .25s var(--ease);
  box-shadow: 0 0 0 calc(var(--p) * 2px) #D4A24C, 0 18px 40px -16px color-mix(in srgb, #D4A24C calc(100% - var(--p) * 60%), #14213D);
  animation: rise .8s var(--ease) 1s both; }
.btn-alive::before { content: ""; position: absolute; inset: -8px; z-index: -2; border-radius: inherit; border: 2px solid #D4A24C; opacity: 0; animation: halo 2.6s ease-out 1.8s infinite; }
.ba-fill { position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: radial-gradient(circle at var(--fx, 50%) 50%, #14213D 0, #14213D 40%, transparent 41%); transform: scale(0); transition: transform .55s var(--ease); }
.ba-shine { position: absolute; top: 0; bottom: 0; width: 46%; left: -60%; z-index: 0; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-20deg); animation: shine 3.4s ease-in-out 1.6s infinite; pointer-events: none; }
.ba-text { position: relative; z-index: 1; }
.ba-arrow { position: relative; z-index: 1; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; animation: nudge 1.6s ease-in-out infinite; }
.btn-alive:hover, .btn-alive:focus-visible { --p: 1; outline: none; }
.btn-alive:hover .ba-arrow { animation-duration: .7s; }
.btn-alive.pressed { --p: 1; }
.btn-alive:active { transform: translate(var(--mx), var(--my)) scale(.96); }
@keyframes halo { 0% { opacity: .7; transform: scale(.94); } 70%, 100% { opacity: 0; transform: scale(1.25); } }
@keyframes shine { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
@keyframes nudge { 50% { transform: translateX(5px); } }
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
@keyframes breathe { 0%, 100% { --p: 0; } 50% { --p: 1; } }
.btn-alive { text-decoration: none; }
