/* =========================================================================
   LouThomas.com — Core Stylesheet
   Hand-written CSS. No framework. Carbon-fiber / industrial editorial.
   ========================================================================= */

/* ----- Design Tokens ---------------------------------------------------- */
:root {
  /* Surfaces */
  --bg:          #0e0e0f;
  --bg-raised:   #121212;
  --bg-panel:    #1a1a1a;
  --bg-hover:    #202022;

  /* Lines */
  --line:        #2a2a2c;
  --line-strong: #3a3a3d;

  /* Ink */
  --ink:         #f4f4f5;
  --ink-soft:    #b8b8bd;
  --ink-mute:    #79797f;
  --ink-faint:   #54545a;

  /* Accent — cold metallic */
  --steel:       #c9ccd1;
  --steel-glow:  rgba(201, 204, 209, 0.08);

  /* Type */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  /* Rhythm */
  --maxw: 1080px;
  --pad:  clamp(1.25rem, 5vw, 4rem);

  /* Carbon-fiber weave (pure CSS, no images) */
  --carbon:
    repeating-linear-gradient(45deg,  #141416 0 2px, #0f0f10 2px 4px),
    repeating-linear-gradient(-45deg, #141416 0 2px, #0f0f10 2px 4px);
}

/* ----- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--steel); color: #0a0a0b; }

a { color: inherit; text-decoration: none; }

/* ----- Layout primitives ------------------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section {
  padding-block: clamp(4.5rem, 11vw, 9rem);
  border-top: 1px solid var(--line);
  position: relative;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}

/* ----- Type scale ------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.04;
}

.display {
  font-size: clamp(2.6rem, 8.5vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}

h2.title {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  margin-bottom: 1.5rem;
}

.lede {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 46ch;
  line-height: 1.55;
}

p + p { margin-top: 1.1rem; }

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-mute); }

/* ----- Top bar ---------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 14, 15, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
}
.brand .dot { color: var(--ink-faint); font-family: var(--font-mono); }
.nav {
  display: flex;
  gap: clamp(1.1rem, 3vw, 2.4rem);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nav a { color: var(--ink-mute); transition: color 0.2s ease; }
.nav a:hover { color: var(--ink); }
@media (max-width: 560px) { .nav { display: none; } }

/* ----- Hero ------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(6rem, 16vw, 11rem) clamp(4.5rem, 11vw, 8rem);
  border-top: none;
  overflow: hidden;
}
.hero::before {
  /* faint carbon weave wash, fades downward */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--carbon);
  opacity: 0.4;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
  z-index: 0;
}
.hero::after {
  /* cold top-edge glow */
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 80%;
  background: radial-gradient(ellipse at center, var(--steel-glow), transparent 65%);
  z-index: 0;
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero .display { max-width: 16ch; }
.hero .display .stroke { color: var(--ink-mute); }
.hero .lede { margin-top: 1.9rem; }

.cta-row {
  margin-top: 2.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* ----- Buttons ---------------------------------------------------------- */
.btn {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.95rem 1.6rem;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.btn:hover { background: var(--bg-hover); border-color: var(--steel); transform: translateY(-1px); }
.btn--solid { background: var(--ink); color: #0a0a0b; border-color: var(--ink); }
.btn--solid:hover { background: var(--steel); border-color: var(--steel); }
.btn .arr { font-family: var(--font-body); }

/* ----- Stat strip ------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  margin-top: 3.5rem;
}
.stat { padding: 1.6rem 1.5rem; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; }
.stat .n {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.stat .k {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 0.4rem;
}
@media (max-width: 620px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: none; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: none; }
}

/* ----- Two-column section grid ----------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; gap: 2.5rem; } }

.bio-body p { color: var(--ink-soft); max-width: 62ch; }
.bio-body .pull {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 1.8rem;
}

/* ----- Service cards ---------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 3rem;
}
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-raised);
  padding: clamp(1.8rem, 4vw, 2.6rem);
  transition: background 0.25s ease;
  position: relative;
}
.card:hover { background: var(--bg-panel); }
.card .idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}
.card h3 {
  font-size: 1.4rem;
  margin: 1.1rem 0 0.85rem;
}
.card p { color: var(--ink-soft); font-size: 0.97rem; }

/* ----- Book catalog placeholder ---------------------------------------- */
.shelf {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 3rem;
}
@media (max-width: 720px) { .shelf { grid-template-columns: 1fr; } }

.slot {
  border: 1px dashed var(--line-strong);
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.4rem;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.015), transparent 60%),
    var(--bg-raised);
  transition: border-color 0.25s ease, background 0.25s ease;
}
.slot:hover { border-color: var(--steel); }
.slot .tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.slot .ti {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin-top: 0.5rem;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}

/* ----- Contact ---------------------------------------------------------- */
.contact { text-align: left; }
.mailto {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 6vw, 3.4rem);
  letter-spacing: -0.03em;
  margin-top: 1.5rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.15rem;
  transition: border-color 0.2s ease, color 0.2s ease;
  word-break: break-word;
}
.mailto:hover { border-color: var(--steel); color: #fff; }

/* ----- Footer ----------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--line);
  padding-block: 2.4rem;
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.foot a { color: var(--ink-mute); transition: color 0.2s ease; }
.foot a:hover { color: var(--ink); }

/* ----- Sub-page hero (books / services shells) ------------------------- */
.subhero { padding-block: clamp(5rem, 13vw, 9rem) clamp(2.5rem, 6vw, 4rem); border-top: none; }
.subhero .display { font-size: clamp(2.4rem, 7vw, 4.4rem); }
.backlink {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  transition: color 0.2s ease;
}
.backlink:hover { color: var(--ink); }

.notice {
  border: 1px solid var(--line);
  background: var(--bg-raised);
  padding: clamp(1.8rem, 4vw, 2.6rem);
  margin-top: 2.5rem;
  max-width: 60ch;
}
.notice .eyebrow { margin-bottom: 1rem; }

/* ----- Reveal-on-scroll (progressive enhancement) ---------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
