/* ==========================================================================
   Lithea — lithea.xyz
   Static rebuild. Base reset (Tailwind preflight subset) + site styles.
   ========================================================================== */

/* ---------- reset ---------- */
*, ::after, ::before, ::backdrop { box-sizing: border-box; border: 0 solid; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
small { font-size: 80%; }
img, svg, video, canvas, audio, iframe, embed, object { vertical-align: middle; display: block; }
img, video { max-width: 100%; height: auto; }
button, input, select, optgroup, textarea {
  font: inherit; letter-spacing: inherit; color: inherit;
  opacity: 1; background-color: transparent; border-radius: 0;
}
button, input:where([type=button], [type=reset], [type=submit]) { appearance: button; }
ol, ul, menu { list-style: none; }
[hidden]:where(:not([hidden=until-found])) { display: none !important; }

/* ---------- fonts ---------- */
@font-face {
  font-family: Altform;
  src: url("fonts/Altform-Light.ttf") format("truetype");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: Altform;
  src: url("fonts/Altform-Regular.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: Altform;
  src: url("fonts/Altform-SemiBold.otf") format("opentype");
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ---------- theme tokens ---------- */
:root {
  --font-altform: "Altform", ui-sans-serif, system-ui, sans-serif;
  --bg-base: #e8e8e8;
  --text-primary: #0f1219;
  --text-secondary: #343b47;
  --text-muted: #6b7280;
  --link: #1a6b8a;
  --link-hover: #0f4f68;
  --overlay-start: #e8e8e81f;
  --overlay-mid: #e8e8e80a;
  --overlay-end: #e8e8e829;
  --badge-cover-start: #e8e8e8;
  --badge-cover-mid: #e8e8e8f7;
  --badge-cover-end: #e8e8e8bf;
}
html.dark {
  --bg-base: #000;
  --text-primary: #eef1f6;
  --text-secondary: #a8b0be;
  --text-muted: #7d8696;
  --link: #6ec8e0;
  --link-hover: #9edcf0;
  --overlay-start: #0000001f;
  --overlay-mid: #0000000a;
  --overlay-end: #00000029;
  --badge-cover-start: #000;
  --badge-cover-mid: #000000f7;
  --badge-cover-end: #000000bf;
}

html { color-scheme: light; background: var(--bg-base); min-height: 100%; }
html.dark { color-scheme: dark; }

body {
  min-height: 100dvh;
  font-family: var(--font-altform);
  color: var(--text-primary);
  background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  font-size: 18px;
  line-height: 1.65;
  overflow-x: hidden;
}

button, a { font: inherit; }
a {
  color: var(--link);
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  transition: color .2s;
}
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }

/* ---------- animated background ---------- */
.background-spline {
  z-index: 0;
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
}
.background-spline__fallback { background: var(--bg-base); position: absolute; inset: 0; }
.background-spline__viewer-slot { position: absolute; inset: 0; }
.background-spline__viewer,
.background-spline__viewer-slot spline-viewer,
.background-spline__viewer-slot canvas,
.background-spline__viewer-slot img.background-spline__still {
  pointer-events: none;
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
  inset: 0;
}
.background-spline__viewer-slot img.background-spline__still {
  object-fit: cover;
  object-position: center;
  max-width: none;
}
/* The original loads a second, darker Spline scene in dark mode. That scene was
   not part of the capture and hotlinking it is not allowed, so the bundled
   light scene is tone-mapped to a dark equivalent instead. */
html.dark .background-spline__viewer-slot {
  filter: invert(1) hue-rotate(180deg) brightness(.42) saturate(1.6) contrast(1.15);
}

.background-spline__overlay {
  background: linear-gradient(180deg, var(--overlay-start) 0%, var(--overlay-mid) 45%, var(--overlay-end) 100%);
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.noise-overlay {
  z-index: 50;
  pointer-events: none;
  opacity: .22;
  mix-blend-mode: overlay;
  background-image: url("grain.gif");
  background-repeat: repeat;
  background-size: 200px 200px;
  position: fixed;
  inset: 0;
}
html.dark .noise-overlay { opacity: .3; mix-blend-mode: soft-light; }

.spline-badge-cover {
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(to top,
    var(--badge-cover-start) 0%,
    var(--badge-cover-start) 50%,
    var(--badge-cover-mid) 65%,
    var(--badge-cover-end) 82%,
    transparent 100%);
  height: 160px;
  position: fixed;
  bottom: 0; left: 0; right: 0;
}

/* ---------- layout ---------- */
.page-shell {
  z-index: 100;
  background: 0 0;
  flex-direction: column;
  min-height: 100dvh;
  display: flex;
  position: relative;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  cursor: pointer;
  background: 0 0;
  border: 0;
  border-radius: 999px;
  justify-content: center;
  align-items: center;
  padding: 0;
  transition: color .2s, background-color .2s;
  display: inline-flex;
}
.theme-toggle--fixed {
  z-index: 200;
  position: fixed;
  top: 1.25rem;
  right: clamp(1.25rem, 4vw, 2.5rem);
}
.theme-toggle:hover { color: var(--text-primary); background-color: #8080801f; }
.theme-toggle__icon--hidden { display: none; }

.main-content {
  flex-direction: column;
  flex: 1;
  justify-content: center;
  min-height: 100dvh;
  padding: clamp(2rem, 6vh, 3.5rem) clamp(1.25rem, 4vw, 2.5rem) clamp(2.5rem, 5vh, 3.5rem);
  display: flex;
}
.content-column {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  animation: .8s both fade-in;
}
.content-brand { margin-bottom: clamp(2rem, 5vh, 2.75rem); line-height: 0; }
.content-brand img { width: auto; height: clamp(24px, 3vw, 30px); }

.section { margin-bottom: clamp(2rem, 5vh, 3rem); }
.section--contact { margin-top: clamp(1.25rem, 3vh, 2rem); margin-bottom: 0; }
.section-title {
  color: var(--text-primary);
  font-family: var(--font-altform);
  letter-spacing: -.02em;
  margin: 0 0 1.25rem;
  font-size: clamp(1.375rem, 2.5vw, 1.625rem);
  font-weight: 600;
  line-height: 1.3;
}

.prose p, .cta-text, .site-footer__links {
  color: var(--text-secondary);
  font-size: clamp(1.0625rem, 1.1vw, 1.125rem);
  line-height: 1.7;
}
.prose p { margin: 0 0 1.35rem; }
.prose p:last-child { margin-bottom: 0; }
.cta-text { margin: 0; }
.cta-text--spaced { margin-top: 1.35rem; }

.site-footer { margin-top: clamp(1.75rem, 4vh, 2.5rem); padding-bottom: .25rem; }
.site-footer__links { margin: 0; }
.site-footer__sep { color: var(--text-muted); }

@keyframes fade-in {
  0%  { opacity: 0; transform: translateY(8px); }
  to  { opacity: 1; transform: translateY(0); }
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .theme-toggle--fixed { top: 1rem; right: 1rem; }
  .main-content { justify-content: flex-start; padding-top: 2rem; }
  .content-brand { margin-bottom: 1.75rem; }
  .section { margin-bottom: 2.75rem; }
  .prose p, .cta-text, .site-footer__links { font-size: 1.0625rem; line-height: 1.65; }
  .spline-badge-cover { height: 130px; }
}
