:root {
  --bg: #f6f2eb;
  --card: #fffdf9;
  --ink: #26221d;
  --gray: #7b736a;
  --faint: #a39a8f;
  --line: #e6dfd3;
  --accent: #b5532a;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --max: 720px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --out: cubic-bezier(.23, 1, .32, 1);
  --shadow: -0.6px 0.36px 0.35px -0.65px rgba(120,70,40,.19), -1.6px 1px 0.94px -1.3px rgba(120,70,40,.19), -3.5px 2.1px 2px -1.95px rgba(120,70,40,.18), -7.9px 4.7px 4.6px -2.6px rgba(120,70,40,.16), -20px 12px 11.7px -3.25px rgba(120,70,40,.11);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--gray); font: 400 18px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
b { font-weight: 500; color: var(--ink); }
em { font-style: normal; color: var(--accent); }
::selection { background: #ecd3c2; color: var(--ink); }
.ink { color: var(--ink); }

.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 90; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; font-size: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 48px, var(--max)); margin-inline: auto; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  width: min(100% - 48px, var(--max)); margin-inline: auto;
  padding: 18px 0 14px;
  background: var(--bg);
}
.nav::after { content: ""; position: absolute; left: -50vw; right: -50vw; top: 0; bottom: 0; background: var(--bg); z-index: -1; }
.nav-face { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--card); box-shadow: var(--shadow); transition: transform .35s var(--spring); }
.nav-face-link:hover .nav-face { transform: rotate(-6deg) scale(1.06); }
.nav-links { display: flex; gap: 26px; font: 400 13px var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.nav-links a { text-decoration: none; color: var(--gray); transition: color .2s; }
.nav-links a:hover { color: var(--accent); }
.burger { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 10px 6px; cursor: pointer; position: relative; z-index: 60; }
.burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; margin: 6px 0; transition: transform .35s var(--out), opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 56px;
  opacity: 0; transition: opacity .3s;
}
.menu[hidden] { display: none; }
.menu.open { opacity: 1; }
.menu nav { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.menu nav a { font: 400 38px/1 var(--sans); letter-spacing: -.03em; text-transform: uppercase; color: var(--ink); text-decoration: none; opacity: 0; transform: translateY(18px); transition: opacity .5s var(--out), transform .6s var(--out), color .2s; }
.menu nav i { width: 3px; height: 3px; border-radius: 50%; background: var(--accent); opacity: .6; }
.menu nav a:active, .menu nav a:hover { color: var(--accent); }
.menu.open nav a { opacity: 1; transform: none; }
.menu.open nav a:nth-of-type(2) { transition-delay: .05s; }
.menu.open nav a:nth-of-type(3) { transition-delay: .1s; }
.menu.open nav a:nth-of-type(4) { transition-delay: .15s; }
.pill { font: 400 16px var(--sans); text-transform: uppercase; color: var(--ink); text-decoration: none; border: 1.5px solid var(--ink); border-radius: 999px; padding: 12px 26px; transition: background .2s, color .2s, transform .15s; }
.pill:active { transform: scale(.96); }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 12vh, 120px) 0 clamp(40px, 8vh, 72px); }
.hero h1 { font: 400 clamp(26px, 4.4vw, 38px)/1.32 var(--sans); letter-spacing: -.025em; color: var(--gray); }
.hero h1 > span { display: block; }
.name-row { display: flex !important; align-items: center; gap: 18px; }
.stack { display: inline-flex; align-items: center; padding-left: 4px; }
.card {
  width: clamp(52px, 7vw, 66px); aspect-ratio: 1; object-fit: cover;
  border-radius: 12px; border: 2px solid var(--card); box-shadow: var(--shadow);
  margin-left: -10px; background: var(--card);
  transition: transform .35s var(--spring), filter .35s;
}
.card:first-child { margin-left: 0; }
.c1 { --rot: -3deg; } .c2 { --rot: 2deg; } .c3 { --rot: 4deg; object-position: 50% 14%; }
.card { transform: rotate(var(--rot)); }
.stack:hover .card { transform: rotate(0) translateY(-3px); }
.stack:hover .c1 { transform: rotate(-8deg) translate(-6px, -3px); }
.stack:hover .c3 { transform: rotate(9deg) translate(6px, -3px); }

.hero-sub { margin-top: clamp(36px, 6vh, 56px); padding-left: 2px; font-size: 18px; line-height: 1.6; }
.hero-sub p + p { margin-top: 10px; }
.connect { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: clamp(36px, 6vh, 56px); }
.connect > span { margin-right: 4px; }
.ico {
  width: 50px; height: 50px; display: grid; place-items: center;
  background: var(--card); border-radius: 15px;
  box-shadow: 0 1px 2px rgba(60,40,20,.08), 0 4px 12px -4px rgba(60,40,20,.12);
  color: var(--ink); transition: transform .35s var(--spring), color .2s;
}
.ico jigg-icon { display: block; width: 24px; height: 24px; }
.ico jigg-icon svg { width: 100%; height: 100%; }
.ico:hover { transform: translateY(-3px) rotate(-4deg); color: var(--accent); }
.ico:active { transform: scale(.94); }

/* ---------- Sections ---------- */
section:not(.hero) { padding: clamp(40px, 8vh, 72px) 0; }
.label { display: flex; align-items: center; gap: 12px; font: 500 22px var(--mono); letter-spacing: -.01em; text-transform: uppercase; color: var(--accent); margin: 0 0 32px; }
.label jigg-icon { display: block; width: 30px; height: 30px; color: var(--ink); transform: rotate(-6deg); }
.label jigg-icon svg { width: 100%; height: 100%; }
jigg-icon:not(:defined) { visibility: hidden; }

/* Book as a work card */
.work { display: block; text-decoration: none; }
.work-img { display: block; overflow: hidden; border-radius: 20px; background: #e9dfcf; aspect-ratio: 16 / 11; }
.work-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; transition: transform 1.2s var(--out); }
.work:hover .work-img img { transform: scale(1.03); }
.work-title { display: block; margin-top: 18px; font-size: 21px; line-height: 1.35; color: var(--ink); letter-spacing: -.015em; }
.work-meta { display: block; margin-top: 6px; font: 400 13px var(--mono); text-transform: uppercase; color: var(--faint); letter-spacing: .02em; }
.book-copy { margin-top: 18px; }
.book-copy > p + p { margin-top: 16px; }
.parts { font-size: 16px; color: var(--ink); }
.parts span { font: 400 12px var(--mono); text-transform: uppercase; color: var(--faint); margin-right: 6px; }
.parts span:nth-of-type(2) { margin-left: 18px; }
.buy { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.btn { display: inline-flex; align-items: center; font: 500 15px/1 var(--sans); text-decoration: none; padding: 13px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); transition: transform .35s var(--spring), background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.96); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }

.love { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.love blockquote { margin: 0; background: var(--card); border-radius: 18px; padding: 22px; box-shadow: 0 1px 2px rgba(60,40,20,.06), 0 10px 24px -14px rgba(60,40,20,.18); }
.love p { color: var(--ink); font-size: 16.5px; line-height: 1.55; }
.love footer { margin-top: 16px; font-size: 13.5px; line-height: 1.45; color: var(--faint); }
.love footer b { display: block; font-size: 14.5px; }

/* Journey timeline (like a "Now" page) */
.tl { list-style: none; margin: 0; padding: 0 0 0 30px; position: relative; }
.tl::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.tl > li { position: relative; padding-bottom: 30px; }
.tl > li::before { content: ""; position: absolute; left: -30px; top: 9px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 1.5px var(--line); }
.tl > li::after { content: ""; position: absolute; left: -25px; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.tl h3 { font: 500 24px/1.4 var(--sans); color: var(--ink); letter-spacing: -.02em; margin-bottom: 8px; }
.tl ul { list-style: none; margin: 0; padding: 0; }
.tl ul li { position: relative; padding-left: 24px; color: var(--ink); opacity: .86; }
.tl ul li + li { margin-top: 8px; }
.tl ul li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; background: var(--faint); transform: rotate(45deg); border-radius: 1px; opacity: .7; }

/* Floating supplementary lines */
.float {
  width: min(100% - 48px, var(--max)); margin: clamp(24px, 6vh, 56px) auto;
  font: italic 400 clamp(24px, 3.4vw, 32px)/1.25 var(--serif); color: var(--ink); opacity: .78;
  max-width: 19em; text-wrap: balance;
}
.float.right { text-align: right; }
.float-in { display: block; transform: translateY(var(--py, 0px)) rotate(var(--r, 0deg)); will-change: transform; }
.float-in > span { display: block; animation: bob 7s ease-in-out infinite; }
.float.right .float-in > span { animation-duration: 8.5s; animation-delay: -2s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* Contact */
.contact-line { margin-bottom: 14px; }
.email { font: 400 clamp(26px, 4.6vw, 38px)/1.2 var(--sans); letter-spacing: -.03em; color: var(--ink); text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) left 100% / 0 2px no-repeat; transition: background-size .5s var(--out), color .2s; }
.email:hover { background-size: 100% 2px; color: var(--accent); }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; padding: 28px 0 44px; margin-top: 24px; border-top: 1px solid var(--line); font: 400 12px var(--mono); text-transform: uppercase; color: var(--faint); letter-spacing: .03em; }

/* ---------- Appear animations (spring-ish, like Framer appear) ---------- */
.js .up { opacity: 0; transform: translateY(60px); transition: opacity .9s var(--out), transform 1.1s var(--out); transition-delay: var(--d, 0s); }
.js .up.in { opacity: 1; transform: none; }
.js .float.up { transform: translateY(40px); }
.js .float.up.in { transform: none; }
.js .stack .card { opacity: 0; transform: translateX(-20px) scale(1.1) rotate(0); transition: opacity .5s ease, transform .8s var(--spring); }
.js .stack.in .card { opacity: 1; transform: rotate(var(--rot)); }
.js .stack.in .c2 { transition-delay: .1s; }
.js .stack.in .c3 { transition-delay: .2s; }
.js .stack.in:hover .card { transition-delay: 0s; }
.js .stack.in:hover .card { transform: rotate(0) translateY(-3px); }
.js .stack.in:hover .c1 { transform: rotate(-8deg) translate(-6px, -3px); }
.js .stack.in:hover .c3 { transform: rotate(9deg) translate(6px, -3px); }
.js .name-row .ink { display: inline-block; opacity: 0; filter: blur(6px); transition: opacity .8s var(--out), filter .8s var(--out); }
.js .name-row.in .ink { opacity: 1; filter: none; }

/* ---------- Loader: Proverbs 4:23 ---------- */
.loader { display: none; }
.intro .loader { display: block; position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow: hidden; transition: opacity .8s ease-out; }
.intro body { overflow: hidden; }
.loader.out { opacity: 0; pointer-events: none; }
.ld-stack { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; }
.ld-text { font: 500 22px/1.4 var(--sans); letter-spacing: -.01em; color: var(--accent); text-align: center; max-width: 22em; min-height: 2.8em; text-wrap: balance; transition: opacity .3s, transform .3s; }
.ld-caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -.15em; background: var(--accent); animation: blink .9s steps(1) infinite; }
.ld-caret.done { opacity: 0; animation: none; }
@keyframes blink { 50% { opacity: 0; } }
.ld-ref { font: 400 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); opacity: 0; transition: opacity .6s; margin-bottom: 22px; }
.ld-ref.on { opacity: 1; }
.ld-stage { position: relative; display: grid; place-items: center; }
.ld-win { width: min(62vw, 250px); aspect-ratio: 4 / 5; border-radius: 999px 999px 18px 18px; overflow: hidden; border: 3px solid var(--card); box-shadow: 0 18px 36px -14px rgba(70,40,20,.35); clip-path: inset(0 50% 0 50%); transform: scale(.94); transition: clip-path 1s var(--out), transform 1s var(--out), opacity .3s, filter .3s; }
.ld-win img { width: 100%; height: 100%; object-fit: cover; }
.ld-win.open { clip-path: inset(0 0 0 0); transform: scale(1); }
.ld-win.sway { animation: sway 4s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-1deg) translateY(0); } 50% { transform: rotate(1deg) translateY(-3px); } }
.loader.out .ld-win { opacity: 0; filter: blur(6px); }
.ld-face { position: absolute; width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid var(--card); box-shadow: var(--shadow); opacity: 0; filter: blur(5px); z-index: 2; }
.ld-face.show { opacity: 1; filter: blur(0); transition: opacity .3s ease-out, filter .35s ease-out; }
.ld-skip { position: absolute; right: 18px; bottom: 18px; font: 400 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--faint); background: none; border: 0; padding: 10px; cursor: pointer; }
.ld-skip:hover { color: var(--ink); }

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  body { font-size: 17px; }
  .nav-links { display: none; }
  .burger { display: block; }
  .name-row { gap: 12px; }
  .love { grid-template-columns: 1fr; }
  .work-img { aspect-ratio: 1; }
  .parts span:nth-of-type(2) { display: block; margin: 6px 0 0; width: max-content; }
}
@media (max-width: 480px) {
  .ld-text { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .up, .js .stack .card, .js .name-row .ink { opacity: 1 !important; transform: none; filter: none; transition: none; }
  .js .stack .card { transform: rotate(var(--rot)); }
  .float-in > span { animation: none; }
}

section[id] { scroll-margin-top: 84px; }
