/* lifepuzzles.net. Hand-written; bump CSS_V in src/lifepuzzles/build.py after changing. */
@font-face { font-family: "Young Serif"; src: url(/fonts/young-serif-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(/fonts/instrument-sans-var.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --paper: #F7F6F2;      /* page */
  --ink: #1E2124;        /* text, buttons */
  --stone: #535B5F;      /* secondary text */
  --pine: #E3C796;       /* cut wood: bands and edges */
  --pine-soft: #F0E3C9;
  --pine-deep: #8A6738;
  --red: #C9252C;        /* the balloon: tiny accents only */
  --line: #D9D6CC;
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.4rem, 6.5vw, 4.25rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1rem; }
a { color: var(--ink); text-decoration-color: var(--pine-deep); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 76rem; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 50rem; }
.lede { font-size: clamp(1.15rem, 2.2vw, 1.35rem); line-height: 1.5; color: var(--stone); max-width: 38rem; }
.small { font-size: 0.9rem; color: var(--stone); }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

/* Buttons and links */
.btn {
  display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none;
  font: 600 1rem/1 var(--sans); padding: 0.95rem 1.4rem; border-radius: 999px; border: 0; cursor: pointer;
}
.btn:hover { background: #33383C; color: var(--paper); }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: #fff; color: var(--ink); }
.quiet { font-weight: 600; margin-left: 0.9rem; }
.quiet.light { color: var(--paper); text-decoration-color: var(--pine); }

/* Header: logo left, burger right */
.top { border-bottom: 1px solid var(--line); position: relative; z-index: 30; background: var(--paper); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.85rem; padding-bottom: 0.85rem; }
.mark { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; font: 400 1.4rem/1 var(--serif); }
.mark .logo { width: auto; height: 3rem; flex: none; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 0.7rem; background: none; border: 0; padding: 0.6rem 0.2rem;
  font: 600 1rem/1 var(--sans); color: var(--ink); cursor: pointer;
}
.burger { position: relative; width: 26px; height: 18px; }
.burger span { position: absolute; left: 0; width: 100%; height: 2.5px; border-radius: 2px; background: currentColor; transition: transform .3s, opacity .2s, top .3s; }
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 7.75px; }
.burger span:nth-child(3) { top: 15.5px; }
.menu-open .burger span:nth-child(1) { top: 7.75px; transform: rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { top: 7.75px; transform: rotate(-45deg); }
/* The menu slides in from the right, over a dimmed page */
.shade { position: fixed; inset: 0; background: rgba(30, 33, 36, .45); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(24rem, 88vw); z-index: 50;
  background: var(--ink); color: var(--paper); padding: 5.5rem 2rem 2rem;
  transform: translateX(100%); visibility: hidden; transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility .35s;
  display: flex; flex-direction: column; overflow-y: auto;
}
.drawer ol { list-style: none; margin: 0; padding: 0; }
.drawer li { border-bottom: 1px solid rgba(247, 246, 242, .14); }
.drawer li a { display: block; padding: 0.85rem 0; color: var(--paper); text-decoration: none; font: 400 1.6rem/1.15 var(--serif); }
.drawer li a:hover, .drawer li a[aria-current] { color: var(--pine); }
.drawer li a[aria-current]::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--red); margin: 0 0.6rem 0.25rem 0; vertical-align: middle; }
.drawer-foot { margin-top: auto; padding-top: 2rem; }
.drawer-foot a { color: var(--pine); font-weight: 600; text-decoration-color: rgba(227, 199, 150, .5); }
.menu-open .shade { opacity: 1; visibility: visible; }
.menu-open .drawer { transform: none; visibility: visible; }
.menu-open .top { z-index: 60; background: transparent; border-bottom-color: transparent; }
.menu-open .mark { visibility: hidden; }
.menu-open .menu-btn { color: var(--paper); }
body.menu-open { overflow: hidden; }
body { overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) { .drawer, .shade, .burger span { transition: none; } }

/* Home hero */
.hero-in { display: grid; gap: 0.75rem; padding-top: 1.5rem; padding-bottom: 3rem; }
.hero h1 { max-width: 13ch; }
.hero .lede { margin-top: 0.5rem; }
.hero-links { margin-top: 1.75rem; }
/* The puzzle that comes apart (src/lifepuzzles/puzzle.js) */
.lp-stage { position: relative; z-index: 5; width: 100%; perspective: 1200px; user-select: none; -webkit-user-select: none; }
.lp-board { position: relative; }

.lp-stage[style] .lp-board { position: absolute; }
.lp-board img { width: 100%; height: auto; display: block; border-radius: 4px; box-shadow: 0 22px 44px -22px rgba(30, 33, 36, .6); }
.lp-piece { position: absolute; left: 0; top: 0; transform-style: preserve-3d; cursor: grab; touch-action: none; outline: none; z-index: 1; }
.lp-piece.anim { transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.lp-piece.held { cursor: grabbing; }
.lp-inner { position: relative; transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.lp-face, .lp-edge, .lp-shadow { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-face { display: block; pointer-events: none; }
.lp-edge, .lp-shadow { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.lp-edge { background: repeating-linear-gradient(100deg, #E6C995 0 5px, #D4B078 5px 7px, #EBD3A6 7px 12px); visibility: hidden; }
.lp-edge:nth-child(odd) { filter: brightness(.93); }
.lp-shadow { background: rgba(20, 16, 10, .55); filter: blur(6px); opacity: 0; transition: opacity .3s; }
.lp-piece:not(.home) .lp-edge { visibility: visible; }
.lp-piece:not(.home) .lp-shadow { opacity: .55; }
.lp-piece:not(.home) .lp-inner { transform: translateZ(calc(var(--lift) * .3)) rotateX(8deg) rotateY(-6deg); }
.lp-piece.held .lp-inner { transform: translateZ(var(--lift)) rotateX(16deg) rotateY(-12deg) scale(1.06); }
.lp-piece.held .lp-shadow { opacity: .85; }
@media (hover: hover) {
  .lp-piece:hover .lp-edge, .lp-piece:focus-visible .lp-edge { visibility: visible; }
  .lp-piece:hover .lp-inner, .lp-piece:focus-visible .lp-inner { transform: translateZ(var(--lift)) rotateX(24deg) rotateY(-20deg) scale(1.06); }
  .lp-piece:hover .lp-shadow, .lp-piece:focus-visible .lp-shadow { opacity: .85; }
}
.lp-piece:focus-visible .lp-face { filter: drop-shadow(0 0 3px var(--red)) drop-shadow(0 0 2px var(--red)); }
.lp-piece.snap .lp-inner { animation: lp-snap .45s ease-out; }
@keyframes lp-snap { 40% { transform: translateZ(4px) scale(1.03); } 100% { transform: none; } }
.lp-controls { margin-top: 0.5rem; text-align: center; }
.lp-status { min-height: 1.5em; margin: 0 0 0.5rem; font-weight: 600; font-size: 0.95rem; line-height: 1.35; }
.lp-btns { margin: 0 0 0.6rem; }
.btn-small { padding: 0.65rem 1.05rem; font-size: 0.92rem; }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.lp-note { font-size: 0.88rem; color: var(--stone); margin: 0; }
@media (prefers-reduced-motion: reduce) { .lp-piece.anim, .lp-inner, .lp-shadow { transition: none; } .lp-piece.snap .lp-inner { animation: none; } }
@media (min-width: 56rem) {
  .hero-in { padding-top: 3rem; padding-bottom: 3.5rem; }
  .hero h1 { max-width: none; text-align: center; }
  .hero-text { display: grid; grid-template-columns: 1fr auto; gap: 0 3rem; align-items: center; max-width: 60rem; margin: 1rem auto 0; }
  .hero .lede { margin: 0; }
  .hero-links { margin: 0; }
}

/* Pine band */
.band { background: var(--pine-soft); padding: 3.5rem 0; }
.band h2 { max-width: 22ch; }
.three { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.75rem; }
.three h3 { margin-bottom: 0.5rem; }
.three p { color: #3D4448; margin: 0; }
@media (min-width: 48rem) { .three { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

/* Subject tiles */
.subjects { padding: 3.5rem 0; }
.split-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 2rem; }
.split-head .quiet { margin: 0; }
.tiles { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.tiles a { display: block; text-decoration: none; }
.tiles img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; border-radius: 6px; transition: transform .3s; }
.tiles a:hover img { transform: translateY(-4px); }
.tile-name { display: block; font: 400 1.15rem/1.2 var(--serif); margin-top: 0.6rem; }
.tile-n { display: block; color: var(--stone); font-size: 0.9rem; }
@media (min-width: 48rem) { .tiles { grid-template-columns: repeat(5, 1fr); } }

/* Maker strip */
.maker { padding: 0 0 3.5rem; }
.maker-in { display: grid; gap: 1.75rem; align-items: center; }
.maker figure { margin: 0; }
.maker img { border-radius: 6px; }
.maker h2 { margin-bottom: 1rem; max-width: 18ch; }
.maker p { max-width: 34rem; }
@media (min-width: 48rem) { .maker-in { grid-template-columns: 1fr 1fr; gap: 3rem; } }

/* Call to action */
.cta { background: var(--ink); color: var(--paper); padding: 3.25rem 0; }
.cta-in { display: grid; gap: 1.25rem; align-items: center; }
.cta h2 { max-width: 20ch; }
.cta p { margin: 0; }
@media (min-width: 48rem) { .cta-in { grid-template-columns: 1fr auto; } }

/* Inner pages */
.page-top { padding: 2.5rem 0 3.5rem; }
.page-top h1 { margin-bottom: 1rem; }
@media (min-width: 48rem) { .page-top { padding-top: 3.5rem; } }

/* The work */
.chips ul { list-style: none; padding: 0; margin: 1.75rem 0 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-block; text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 0.5rem 0.9rem; border: 1.5px solid var(--ink); border-radius: 999px; }
.chip span { color: var(--stone); font-weight: 400; margin-left: 0.2rem; }
.chip[aria-current] { background: var(--ink); color: var(--paper); }
.chip[aria-current] span { color: var(--pine); }
.w-count { min-height: 1.6em; color: var(--stone); font-size: 0.95rem; margin: 0.25rem 0 0.75rem; }
.w-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem 0.9rem; }
.w-item figure { margin: 0; }
.w-link { display: block; overflow: hidden; border-radius: 5px; background: var(--pine-soft); }
.w-link img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .35s; }
.w-link:hover img { transform: scale(1.04); }
.w-item figcaption { font-size: 0.9rem; line-height: 1.35; margin-top: 0.45rem; }
.yr { color: var(--stone); }
@media (min-width: 36rem) { .w-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 60rem) { .w-grid { grid-template-columns: repeat(4, 1fr); gap: 1.75rem 1.25rem; } }

/* Photo viewer */
.viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; }
.viewer::backdrop { background: rgba(20, 22, 24, .93); }
.viewer figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3.5rem 1rem 1.5rem; }
.viewer img { max-width: 100%; max-height: calc(100vh - 8rem); width: auto; object-fit: contain; }
.viewer figcaption { color: var(--paper); text-align: center; max-width: 40rem; margin-top: 0.9rem; font-size: 0.98rem; }
.v-btn { position: fixed; background: rgba(247, 246, 242, .14); color: var(--paper); border: 0; width: 3rem; height: 3rem; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.v-btn:hover { background: rgba(247, 246, 242, .28); }
.v-close { top: 0.75rem; right: 0.75rem; font-size: 1.8rem; }
.v-prev { left: 0.75rem; top: 50%; transform: translateY(-50%); }
.v-next { right: 0.75rem; top: 50%; transform: translateY(-50%); }

/* The puzzles */
.features { padding-bottom: 3rem; }
.feature { display: grid; gap: 1.5rem; align-items: center; padding: 2rem 0; border-top: 1px solid var(--line); }
.feature figure { margin: 0; }
.feature img { border-radius: 6px; }
.feature figcaption { font-size: 0.9rem; color: var(--stone); margin-top: 0.5rem; }
.feature h2 { margin-bottom: 1rem; }
.feature p { max-width: 34rem; }
@media (min-width: 48rem) {
  .feature { grid-template-columns: 7fr 5fr; gap: 3rem; padding: 3rem 0; }
  .feature.flip { grid-template-columns: 5fr 7fr; }
  .feature.flip figure { order: 2; }
}
.feature.flip img { max-height: 34rem; width: auto; margin: 0 auto; }
.by-hand { display: grid; gap: 1.75rem; align-items: center; }
.by-hand figure { margin: 0; }
.by-hand img { border-radius: 6px; }
.by-hand h2 { margin-bottom: 1rem; }
@media (min-width: 48rem) { .by-hand { grid-template-columns: 1fr 1fr; gap: 3rem; } }

/* About */
.about { display: grid; gap: 2rem; }
.about-text p { max-width: 36rem; }
.about-text h2 { margin: 2.25rem 0 1rem; }
.about-pic { margin: 0; }
.about-pic img { border-radius: 6px; }
.about-pic figcaption { font-size: 0.9rem; color: var(--stone); margin-top: 0.5rem; }
.years { list-style: none; padding: 0; margin: 0 0 2rem; max-width: 34rem; }
.years li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.years li:last-child { border-bottom: 1px solid var(--line); }
.years .y { font-family: var(--serif); color: var(--pine-deep); }
@media (min-width: 56rem) { .about { grid-template-columns: 7fr 5fr; gap: 4rem; align-items: start; } .about-pic { position: sticky; top: 2rem; margin-top: 4.5rem; } }

/* Available */
.note-box { background: var(--pine-soft); border-left: 6px solid var(--pine); padding: 1.5rem 1.5rem 0.75rem; margin: 2rem 0 2.5rem; border-radius: 0 6px 6px 0; }
.note-box h2 { font-size: 1.5rem; margin-bottom: 0.6rem; }
.mini { font-size: 1.35rem; margin-bottom: 1rem; }
.trio { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 1rem; }
.trio img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: 5px; }
@media (min-width: 40rem) { .trio { grid-template-columns: repeat(3, 1fr); } }
.plain { padding-left: 1.2rem; }

/* Keep in touch */
.kit { display: grid; gap: 2rem; }
@media (min-width: 52rem) { .kit { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.form { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 1.5rem; }
.form label { display: block; font-weight: 600; margin: 0 0 0.35rem; }
.form input[type=text], .form input[type=email] {
  width: 100%; font: inherit; padding: 0.75rem 0.85rem; border: 1.5px solid #B9B5AA; border-radius: 6px; background: var(--paper); margin-bottom: 1.1rem;
}
.form input:focus { border-color: var(--ink); }
.opt { font-weight: 400; color: var(--stone); }
.form .check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; margin-bottom: 1.25rem; }
.form .check input { width: 1.2rem; height: 1.2rem; margin-top: 0.2rem; accent-color: var(--ink); flex: none; }
.form-msg { min-height: 1.6em; margin: 0.75rem 0 0.25rem; font-weight: 600; }
.hp { position: absolute; left: -9999px; }

/* Footer */
.foot { background: #ECEAE3; border-top: 1px solid var(--line); padding: 3rem 0 1.5rem; font-size: 0.95rem; color: var(--stone); margin-top: 0; }
.foot-top { display: grid; gap: 2rem; padding-bottom: 2rem; }
.foot-name { display: flex; align-items: center; gap: 0.6rem; font: 400 1.25rem/1 var(--serif); color: var(--ink); margin-bottom: 0.9rem; }
.foot-name .logo { width: auto; height: 2.4rem; }
.foot-brand p:last-child { max-width: 28rem; }
.foot h2 { font: 600 0.95rem/1.3 var(--sans); color: var(--ink); margin: 0 0 0.5rem; }
.foot a { color: var(--ink); }
.foot-legal { border-top: 1px solid var(--line); padding-top: 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; font-size: 0.85rem; }
.foot-legal p { margin: 0; }
@media (min-width: 48rem) { .foot-top { grid-template-columns: 2fr 1fr; gap: 3rem; } }
.prose h2 { font-size: 1.5rem; margin: 2rem 0 0.6rem; }
.prose p { max-width: 40rem; }
