/* Everforest Dark Hard — shared stylesheet for es.tote.lol */
:root {
  /* Everforest Dark Hard palette */
  --bg-dim:  #1E2326;
  --bg0:     #272E33;
  --bg1:     #2E383C;
  --bg2:     #374145;
  --bg3:     #414B50;
  --bg4:     #495156;
  --fg:      #D3C6AA;
  --red:     #E67E80;
  --orange:  #E69875;
  --yellow:  #DBBC7F;
  --green:   #A7C080;
  --aqua:    #83C092;
  --blue:    #7FBBB3;
  --purple:  #D699B6;
  --grey0:   #7A8478;
  --grey1:   #859289;
  --grey2:   #9DA9A0;

  /* semantic aliases — landing page */
  --bg:      var(--bg0);
  --bg1:     var(--bg-dim);
  --card:    var(--bg1);
  --card-h:  var(--bg2);
  --line:    rgba(211,198,170,.08);
  --ink:     var(--fg);
  --muted:   var(--grey1);
  --accent:  var(--green);

  /* essay aliases */
  --rule:    var(--bg2);
  --panel:   var(--bg1);

  /* type */
  --serif: 'Iowan Old Style','Palatino Linotype',Palatino,Georgia,'Times New Roman',serif;
  --sans: -apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
  --mono: 'Courier New',monospace;
  --mx: 48rem;
}

/* ── reset ── */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.75 var(--serif);
  background: var(--bg0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
::selection { background: var(--accent); color: var(--bg0); }
img { max-width: 100%; display: block; }
a { color: var(--accent); }

/* ── scrollbar ── */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg0); }
::-webkit-scrollbar-thumb { background: var(--bg2); border-radius: 5px; }

/* ── watermark ── */
body::before {
  content: "";
  position: fixed; left: 0; right: 0; bottom: 0; height: 100vh;
  z-index: 0; pointer-events: none;
  background: url(toteLogowt.png) 50% 88% / min(64vw, 430px) auto no-repeat;
  opacity: .05;
}

/* ── noise overlay ── */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .45; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
}

/* ════════════════════════════════════════
   LANDING PAGE
   ════════════════════════════════════════ */
.wrap { position: relative; z-index: 2; max-width: var(--mx); margin: 0 auto; padding: 0 1.4rem; }

.mast { padding-top: clamp(5rem,16vh,10rem); padding-bottom: clamp(3rem,8vh,5rem); text-align: center; }
.title {
  margin: 0 0 .6rem;
  font-size: clamp(2.2rem,8vw,3.8rem);
  line-height: 1.05; letter-spacing: -.02em;
  font-weight: 800;
}
.title em { font-weight: 400; font-style: italic; color: var(--accent); }
.rule { width: 56px; height: 1.5px; background: var(--accent); margin: 1.4rem auto; opacity: .35; border-radius: 1px; }
.intro {
  max-width: 34em; margin: 0 auto;
  font-size: clamp(1rem,2.6vw,1.12rem); line-height: 1.7;
  color: var(--muted); font-family: var(--sans);
}
.intro b { color: var(--ink); font-weight: 600; }

.essays { margin: clamp(2rem,6vh,4rem) 0; }
.essays h2 {
  margin: 0 0 1.4rem;
  font: 600 .68rem/1 var(--sans); letter-spacing: .32em;
  color: var(--muted); text-transform: uppercase; text-align: center;
}

.card {
  display: block; margin-bottom: .8rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: var(--ink);
  background: var(--card); position: relative; overflow: hidden;
  transition: background .2s, border-color .2s, transform .2s;
}
.card:hover { background: var(--card-h); border-color: rgba(211,198,170,.18); transform: translateY(-1px); }
.card:active { transform: translateY(0); }
.card .num {
  display: inline-block;
  font: 600 .62rem/1 var(--sans); letter-spacing: .24em;
  color: var(--muted); text-transform: uppercase; margin-bottom: .5rem;
  padding: .25rem .5rem; border: 1px solid var(--line); border-radius: 4px;
}
.card .card-title { margin: 0 0 .3rem; font: 700 clamp(1.2rem,4vw,1.5rem)/1.15 var(--serif); }
.card .card-sub { margin: 0; font: 400 .88rem/1.5 var(--sans); color: var(--muted); }
.card .arrow {
  position: absolute; top: 50%; right: 1.2rem; transform: translateY(-50%);
  font-size: 1.1rem; color: var(--muted); transition: color .2s;
}
.card:hover .arrow { color: var(--accent); }

/* ── footer ── */
footer {
  position: relative;
  text-align: center;
  padding: clamp(2.75rem, 7vh, 5rem) 1.5rem clamp(2.25rem, 6vh, 3.5rem);
  font: 500 .65rem/1.9 var(--sans); letter-spacing: .22em;
  color: var(--bg4); text-transform: uppercase;
}
footer p { margin: 0; font-size: inherit; line-height: inherit; }
footer.site { width: 100vw; margin-left: calc(50% - 50vw); }

.sig {
  display: block; width: 44px; height: auto;
  margin: 0 auto 1rem; opacity: .5; filter: saturate(.75);
}
footer .back a { color: var(--bg4); text-decoration: none; }
footer .back a:hover { color: var(--accent); }

/* photo accent band behind footers — texture only, never the focus */
footer.with-photo { overflow: hidden; }
footer.with-photo::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url(me_00002_.webp) 50% 100% / cover no-repeat;
  opacity: .22; filter: grayscale(.35) brightness(.82);
}
footer.site.with-photo::before { background-image: url(me_00005_.webp); }
footer.with-photo::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, var(--bg0) 0%, rgba(27,32,34,.6) 40%, rgba(22,27,29,.95) 100%);
}
.essay footer.with-photo::after {
  background: linear-gradient(180deg, var(--bg-dim) 0%, rgba(27,32,34,.6) 40%, rgba(22,27,29,.95) 100%);
}
footer.with-photo > * { position: relative; z-index: 1; }

/* ════════════════════════════════════════
   ESSAY PAGES
   ════════════════════════════════════════ */
.essay body,
body.essay {
  display: flex; flex-direction: column; align-items: center;
  background:
    radial-gradient(80% 40% at 50% -5%, rgba(167,192,128,.06), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg-dim));
  background-attachment: fixed;
}

main {
  position: relative; z-index: 2;
  width: 100%; max-width: 42rem;
  padding: 2.25rem 1.5rem 4rem;
}

header {
  text-align: center;
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.75rem;
}

h1 {
  font-size: 1.9rem; font-weight: normal;
  letter-spacing: .01em; margin: 0 0 1.5rem; line-height: 1.2;
}

.byline {
  font-size: .8rem; letter-spacing: .28em;
  text-transform: uppercase; color: var(--muted); margin: 0;
}

h2 {
  font-size: 1.15rem; font-weight: normal;
  letter-spacing: .02em; margin: 2.5rem 0 1.25rem; color: var(--ink);
}

h3 {
  font-size: 1.05rem; font-weight: normal;
  letter-spacing: .01em; margin: 2rem 0 1rem; color: var(--ink);
}

p { margin: 0 0 1.6rem; font-size: 1.06rem; text-align: left; }

blockquote {
  margin: 0 0 1.6rem; padding-left: 1.25rem;
  border-left: 3px solid var(--green);
  color: var(--muted); font-style: italic;
}
blockquote p { margin: 0; }

hr {
  border: 0; height: 1px; background: var(--rule);
  width: 40%; margin: 2.75rem auto;
}

strong { font-weight: bold; }
em { font-style: italic; }

ul, ol { margin: 0 0 1.6rem; padding-left: 1.5rem; }
li { margin-bottom: .4rem; }

.sources {
  margin-top: 3rem; border-top: 1px solid var(--rule);
  padding-top: 2rem; font-size: .85rem; color: var(--muted);
}
.sources h2 {
  font-size: .85rem; letter-spacing: .12em;
  text-transform: uppercase; margin: 0 0 1rem; color: var(--muted);
}
.sources p { font-size: .85rem; line-height: 1.6; }

/* ════════════════════════════════════════
   VAULT PAGE
   ════════════════════════════════════════ */
.vault-body {
  background: var(--bg0);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1.5rem;
}
.vault-body .wrap { text-align: center; max-width: 24rem; }
.vault-body h1 {
  font-weight: normal; letter-spacing: .25em;
  margin-bottom: 1.5rem; color: var(--muted);
}
.screen {
  background: var(--bg1);
  border: 1px solid var(--bg3);
  border-radius: 12px; padding: 1rem;
  margin-bottom: 1.25rem; min-height: 4.25rem;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 1.35rem;
  letter-spacing: .18em; word-break: break-all; user-select: none;
  color: var(--fg);
}
.screen.error { border-color: var(--red); color: var(--red); }
.keys {
  display: grid; grid-template-columns: repeat(5,1fr);
  gap: .65rem; margin-bottom: 1rem;
}
.key, .ctl {
  appearance: none;
  border: 1px solid var(--bg3); border-radius: 10px;
  background: var(--bg2); color: var(--fg);
  font-size: 1.6rem; font-family: var(--mono);
  padding: .9rem 0; cursor: pointer;
  transition: background .12s ease, transform .06s ease;
  user-select: none;
}
.key:hover, .ctl:hover { background: var(--bg3); }
.key:active, .ctl:active { transform: scale(.96); }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.ct { font-size: 1.05rem; letter-spacing: .08em; }
.clear { color: var(--red); }
.enter { color: var(--green); }
.hint { margin-top: 1rem; color: var(--muted); font-size: .85rem; }
#gate { transition: opacity .3s ease; }
#message {
  display: none; opacity: 0;
  background: var(--bg1);
  border: 1px solid var(--blue);
  border-radius: 12px; padding: 2rem 1.5rem;
  font-size: 1.15rem; line-height: 1.6;
  color: var(--fg);
}
#message.show { display: block; opacity: 1; transition: opacity 1.2s ease; }

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */
@media (min-width: 520px) {
  main { padding: 3rem 2.5rem 5rem; }
  h1 { font-size: 2.4rem; }
  p { font-size: 1.12rem; }
}
@media (min-width: 600px) {
  .wrap { padding: 0 2rem; }
}
@media (min-width: 900px) {
  .wrap { padding: 0 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none; }
}
