/* Neighborhood Tech Help — painted redesign (draft).
   Brand: navy on cream, orange as accent/shadow only (docs: ~/Work/Guidelines/brand-guide.md).
   Type: Oswald (headings), Nunito (text), Courier Prime (anything typed: the terminal line, the typewriter page). */
:root {
  --navy: #065588;
  --navy-deep: #043c61;
  --blue: #1077A2;
  --orange: #F5943D;
  --orange-lt: #F69F4D;
  --cream: #FDF6E8;
  --paper: #F3E8D2;
  --mist: #C1D0C8;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-quick: 180ms;
  --t-std: 450ms;
  --t-slow: 900ms;
  --measure: 66ch;
  --head: 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
  --typed: 'Courier Prime', 'Courier New', monospace;
}
@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--navy); font: 500 1.0625rem/1.65 var(--body); }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.12; margin: 0 0 .5em; color: var(--navy); letter-spacing: .005em; }
h1 { font-size: clamp(2.1rem, 2.2vw + 1.4rem, 3.4rem); }
h2 { font-size: clamp(1.75rem, 1.4vw + 1.2rem, 2.6rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; background: var(--cream); padding: .5rem 1rem; }

/* ---- header ---- */
.bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.5rem;
  padding: .7rem clamp(1rem, 4vw, 3rem); background: rgba(253, 246, 232, .92); backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--navy); }
.brand { font: 700 1.2rem var(--head); color: var(--navy); text-decoration: none; margin-right: auto; }
.bar nav { display: flex; flex-wrap: wrap; gap: .1rem 1.1rem; }
.bar nav a { font: 700 .98rem var(--body); color: var(--navy); text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.bar nav a:hover, .bar nav a[aria-current] { border-bottom-color: var(--orange); }

/* ---- shared pieces ---- */
.btn { display: inline-block; font: 800 1rem var(--body); background: var(--navy); color: #fff; text-decoration: none;
  padding: .7rem 1.15rem; border-radius: 6px; box-shadow: 4px 4px 0 var(--orange);
  transition: transform var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease); }
.btn:hover { color: #fff; transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--orange); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--orange); }
.btn.alt { background: var(--cream); color: var(--navy); border: 2px solid var(--navy); }
.muted { color: var(--blue); }
/* the painted-signal card: cream, navy border, hard orange offset shadow (brand guide) */
.card { background: var(--cream); border: 2px solid var(--navy); border-radius: 8px; box-shadow: 7px 7px 0 var(--orange); }

/* ---- painted scenes ---- */
.scene { position: relative; margin: 0; overflow: hidden; background: #5FA8D3; }
.scene > img { width: 100%; height: 100%; object-fit: cover; }
.band { aspect-ratio: 21 / 9; max-height: 78vh; min-height: 260px; }
.sheet { position: relative; z-index: 2; width: min(72rem, calc(100% - 2rem)); margin: -5.5rem auto 0; padding: clamp(1.4rem, 3vw, 2.6rem); }
.chapter { padding-bottom: clamp(3rem, 7vw, 6rem); }
.chapter .lede { max-width: var(--measure); font-size: 1.15rem; }

/* ---- hero ---- */
.hero { position: relative; }
.hero .scene { height: min(88vh, 56.25vw); min-height: 380px; }
.hero .pan { position: absolute; inset: 0; }
.hero .pan img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 45% 60%; }
.hero .wind { clip-path: polygon(0 58%, 20% 62%, 45% 74%, 70% 80%, 100% 84%, 100% 100%, 0 100%); filter: url(#windfx); }
.fx { position: absolute; inset: 0; pointer-events: none; }
.plume { position: absolute; left: 35.7%; top: 20.5%; width: 7%; margin-left: -3.5%; opacity: 0; }
.spark { position: absolute; width: 1.1%; aspect-ratio: 1; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff 0, #BEF5FF 35%, rgba(47, 209, 255, 0) 70%); }
.petal { position: absolute; left: -3%; width: .9%; aspect-ratio: 1.6; border-radius: 60% 40% 60% 40%; background: var(--orange); opacity: 0; }
.intro { position: absolute; right: clamp(.75rem, 1.5vw, 1.5rem); bottom: clamp(1rem, 4vh, 3rem); width: min(25rem, 30%); padding: 1.4rem 1.6rem 1.5rem; z-index: 3; }
.typed { font: 400 .98rem/1.4 var(--typed); color: var(--blue); margin: 0 0 .7rem; min-height: 1.4em; }
.typed .caret { display: inline-block; width: .55em; border-bottom: 2px solid var(--blue); animation: caret 1s steps(1) infinite; }
.intro h1 { margin-bottom: .35em; font-size: clamp(1.9rem, 1.6vw + 1.2rem, 2.8rem); }
.intro .lead { margin-bottom: 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 0; }
.motto { margin: 1rem 0 0; font: 800 .95rem var(--body); color: var(--blue); }
/* the page-load moment: the scene settles, the line types, then the card lifts in */
.js .hero .pan { animation: settle var(--t-slow) var(--ease) both; }
.js .intro { animation: lift var(--t-std) var(--ease) 1.25s both; }
@keyframes settle { from { transform: scale(1.05); filter: saturate(.7) brightness(1.08); } to { transform: none; filter: none; } }
@keyframes lift { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes rise { 0% { transform: translateY(0) scale(.55); opacity: 0; } 14% { opacity: .95; } 100% { transform: translateY(-120%) scale(1.25); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: .1; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.04) translate(-.8%, -.5%); } }

/* ---- services ---- */
#nth .band img { object-position: 30% 55%; }
.svc-top { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; margin-bottom: 1.4rem; }
.svc-top .steps { margin-bottom: 0; }
.poppies { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem 2rem; }
.poppies li { padding-left: 1.7rem; margin: 0 0 .45rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='%23F5943D'%3E%3Cellipse cx='10' cy='5.5' rx='4' ry='4.5'/%3E%3Cellipse cx='5.5' cy='10' rx='4.5' ry='4'/%3E%3Cellipse cx='14.5' cy='10' rx='4.5' ry='4'/%3E%3Cellipse cx='10' cy='14.5' rx='4' ry='4.5'/%3E%3C/g%3E%3Ccircle cx='10' cy='10' r='2.4' fill='%23065588'/%3E%3C/svg%3E") 0 .3em / 1.05rem no-repeat; }
.poppies > li { margin-bottom: .7rem; font-weight: 700; }
.poppies ul { list-style: none; margin: .15rem 0 0; padding: 0; font-weight: 500; color: var(--blue); font-size: .97rem; }
.poppies ul li { background: none; padding-left: .9rem; margin: 0; position: relative; }
.poppies ul li::before { content: ""; position: absolute; left: 0; top: .72em; width: .35rem; height: 2px; background: var(--mist); }
.steps { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.steps li { margin-bottom: .35rem; padding-left: .3rem; }
.steps li::marker { font: 700 1.05rem var(--head); color: var(--orange); }
/* service area + hours: highlighted in the brand orange (navy text on a light orange wash keeps it readable) */
.facts { margin: 0; padding: 1rem 1.2rem 1rem 1.4rem; background: #FDE3C6; border: 2px solid var(--orange); border-left-width: 8px; border-radius: 6px; color: var(--navy-deep); }
.facts strong { color: var(--navy-deep); }

/* ---- scripts ---- */
#scripts .band img { object-position: 55% 50%; }
.ember { position: absolute; left: 46.5%; top: 63%; width: 3%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #FFF3D6 0, #FFA046 30%, rgba(255, 110, 20, 0) 70%); mix-blend-mode: screen; }
.tools { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.tool { padding: 1.3rem 1.4rem; box-shadow: 5px 5px 0 var(--orange); }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; }
.sec-head .lede { margin-bottom: 0; }
/* GitHub: their mark stays white (GitHub's rules) on our navy button */
.btn.gh { display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap; }
.gh-mark { width: 1.25rem; height: 1.25rem; flex: none; }
.tool.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.2rem 2rem; align-items: start; }
.tool.featured .card-emblem { float: left; width: 6rem; height: 6rem; margin: 0 1.1rem .4rem 0; }
.tool-actions { margin-top: .9rem !important; }
.facts.safe p { margin: 0 0 .4rem; }
.facts.safe ul { margin: 0; padding-left: 1.2rem; }
.facts.safe li { margin-bottom: .3rem; }
.tool p { margin: .35rem 0; }
.tool ul { margin: .3rem 0 .4rem; padding-left: 1.2rem; }
.tool .soon { color: var(--blue); font-style: italic; }
.tool .credit { font-size: .85rem; color: var(--blue); }

/* ---- blog: the typewriter ---- */
#latest { background: #2c3e4f; color: var(--cream); }
#latest .scene { aspect-ratio: 1680 / 944; max-height: 92vh; margin: 0 auto; container-type: inline-size; background: #2c3e4f; }
.desk { position: absolute; inset: 0; }
.desk > img { width: 100%; height: 100%; object-fit: contain; }
.page { position: absolute; left: 33.04%; top: 29.45%; width: 36.31%; height: 28.6%; z-index: 2;
  /* the sheet carries its own slice of the painting, so it can leave the typewriter */
  background: url(/img/scenes/typewriter-1680.webp) 51.87% 41.25% / 275.4% 349.6% no-repeat;
  padding: 2.4cqw 3.6cqw; color: #2a2a2a; font-family: var(--typed); view-transition-name: paper; display: block; text-decoration: none; cursor: pointer;
  transform-origin: 50% 100%; }
.page .kicker, .page .h, .page .p { display: block; }
.page:hover .h { color: var(--navy); }
.page .kicker { font-size: .95cqw; margin: 0 0 .4cqw; color: #5a4a36; }
.page .h { font: 700 1.6cqw/1.2 var(--typed); color: #1f2b38; margin: 0 0 .9cqw; text-decoration: underline; text-decoration-thickness: .12cqw; text-underline-offset: .35cqw; }
.page .p { font-size: 1.05cqw; line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.page.grab { animation: grab 520ms var(--ease) forwards; }
@keyframes grab {
  0% { transform: none; }
  20% { transform: translateY(2.5%); }                       /* the platen lets go */
  100% { transform: translateY(-34%) rotate(-1.6deg) scale(1.04); box-shadow: 0 2.5cqw 4cqw rgba(0, 0, 0, .35); }
}
.blog-copy { width: min(72rem, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; display: grid; grid-template-columns: 1fr 1.2fr; gap: 2.5rem; align-items: start; }
.blog-copy h2, .blog-copy h3 { color: var(--cream); }
.blog-copy .btn { background: var(--orange); color: #1d1206; box-shadow: 4px 4px 0 var(--cream); }
.blog-copy .btn:hover { color: #1d1206; }
.blog-copy p { color: #e6eef5; }
.blog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.4rem; }
.blog-copy a:not(.btn):not(.slip) { color: #BEF5FF; }
.drawer { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.slip { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; align-items: baseline; padding: .8rem 1rem; text-decoration: none;
  background: var(--paper); color: #2a2a2a; border-radius: 2px; box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  transition: transform var(--t-quick) var(--ease); }
.drawer li:nth-child(odd) .slip { transform: rotate(-.6deg); }
.drawer li:nth-child(even) .slip { transform: rotate(.5deg); }
.slip:hover { transform: translateY(-3px) rotate(0); color: #000; }
.slip time { font: 400 .85rem var(--typed); color: #6b5638; }
.slip span { font: 700 1rem var(--typed); }

/* ---- questions / about ---- */
.qa { width: min(72rem, calc(100% - 2rem)); margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) 0 2rem; }
.qa-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 1.6rem 3rem; align-items: baseline; }
.qa-grid h3, .qa-grid p { margin: 0; }
.qa-grid p { max-width: var(--measure); }
.about { width: min(72rem, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 3.5rem; display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; border-top: 2px dashed var(--mist); }

/* ---- contact ---- */
#contact .scene { height: min(80vh, 56.25vw); min-height: 360px; }
#contact .scene > img { object-position: 45% 50%; }
.lamp { position: absolute; left: 34.6%; top: 45.5%; width: 7%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 220, 160, .9) 0, rgba(255, 170, 70, .35) 35%, rgba(255, 140, 40, 0) 70%); mix-blend-mode: screen; }
.reach { position: absolute; right: clamp(.75rem, 1.5vw, 1.5rem); top: 50%; transform: translateY(-50%); width: min(22rem, 27%); padding: 1.5rem 1.7rem; z-index: 2; }
.reach .big { font: 700 1.6rem var(--head); }
.reach .actions.stack { flex-direction: column; align-items: stretch; margin-bottom: 1.1rem; }
.reach .actions.stack .btn { text-align: center; }

footer { background: var(--navy-deep); color: var(--cream); text-align: center; padding: 1.4rem 1rem; font-size: .95rem; }

/* ---- ambient motion, only while a scene is on screen ---- */
.live .plume { animation: rise 4.5s var(--ease) infinite; }
.live .plume:nth-child(2) { animation-delay: 1.5s; }
.live .plume:nth-child(3) { animation-delay: 3s; }
.live .spark { animation: twinkle 3.4s ease-in-out infinite; }
.live .ember { animation: twinkle 1.6s ease-in-out infinite; }
.live .lamp { animation: twinkle 5s ease-in-out infinite; }
#scripts.live .band img, #nth.live .band img { animation: drift 30s ease-in-out infinite alternate; }

/* ---- blog archive + article pages ---- */
.page-head { position: relative; height: clamp(180px, 26vw, 320px); overflow: hidden; }
.page-head img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.archive { width: min(72rem, calc(100% - 2rem)); margin: -4rem auto 4rem; position: relative; padding: 2rem clamp(1.2rem, 3vw, 2.4rem); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 1.5rem; }
.chip { font: 700 .95rem var(--body); color: var(--navy); background: var(--cream); border: 2px solid var(--navy); border-radius: 99px; padding: .3rem .9rem; cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.6rem; }
.tile a { display: block; background: var(--paper); color: #2a2a2a; text-decoration: none; padding: .8rem .8rem 1rem; box-shadow: 0 3px 0 rgba(0, 0, 0, .18), 0 10px 22px rgba(4, 60, 97, .12); transition: transform var(--t-quick) var(--ease); }
.tile:nth-child(3n+1) a { transform: rotate(-.7deg); }
.tile:nth-child(3n+2) a { transform: rotate(.5deg); }
.tile a:hover { transform: translateY(-4px) rotate(0); }
.tile-img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; margin-bottom: .7rem; }
.tile time { font: 400 .85rem var(--typed); color: #6b5638; display: block; }
.tile-title { font: 700 1.05rem/1.3 var(--typed); display: block; margin: .25rem 0; }
.tile-topics { font-size: .85rem; color: var(--blue); }
.article { padding: 2.5rem 1rem 5rem; background: linear-gradient(#2c3e4f 0 260px, var(--cream) 260px); }
.sheet-paper { width: min(46rem, 100%); margin: 0 auto; padding: clamp(1.6rem, 5vw, 3.6rem); view-transition-name: paper;
  background: var(--paper) radial-gradient(rgba(120, 90, 50, .06) 1px, transparent 1px) 0 0 / 5px 5px;
  color: #23272c; box-shadow: 0 2px 0 rgba(0, 0, 0, .2), 0 24px 50px rgba(4, 30, 50, .25); }
.sheet-paper .crumb { font: 400 .95rem var(--typed); margin: 0 0 1.4rem; }
.sheet-paper h1 { font: 700 clamp(1.7rem, 3vw, 2.4rem)/1.2 var(--typed); color: #1f2b38; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.sheet-paper .post-meta { font: 400 .95rem var(--typed); color: #6b5638; }
.sheet-paper p, .sheet-paper li { font: 400 1.08rem/1.75 var(--typed); max-width: var(--measure); }
.taped { position: relative; margin: 1.6rem auto 2rem; width: 88%; transform: rotate(-1deg); background: #fff; padding: .6rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.taped::before { content: ''; position: absolute; top: -.8rem; left: 50%; width: 7rem; height: 1.6rem; margin-left: -3.5rem; background: rgba(246, 159, 77, .55); transform: rotate(2deg); }
::view-transition-group(paper) { animation-duration: 600ms; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 350ms; }

/* ---- small screens ---- */
@media (max-width: 860px) {
  .hero .scene { height: auto; aspect-ratio: 16 / 10; min-height: 0; }
  .intro { position: relative; right: auto; bottom: auto; width: auto; margin: -2.5rem 1rem 0; }
  .svc-top, .blog-copy, .about, .qa-grid { grid-template-columns: 1fr; }
  .poppies { grid-template-columns: repeat(2, 1fr); }
  .about { gap: .5rem; }
  .tools { grid-template-columns: 1fr; }
  .tool.featured { grid-column: auto; grid-template-columns: 1fr; }
  .band { aspect-ratio: 16 / 10; }
  .sheet { margin-top: -2.5rem; }
  .reach { position: relative; right: auto; top: auto; transform: none; width: auto; margin: -3rem 1rem 0; }
  #contact .scene { height: auto; overflow: visible; }
  #contact .scene > img { aspect-ratio: 16 / 10; }
  .lamp { top: 21%; }
}
/* phones: keep it compact — shorter painting crops, tighter spacing, one column */
@media (max-width: 700px) {
  .band { aspect-ratio: 16 / 9; min-height: 0; }
  .typed { font-size: .8rem; }
  #nth .band img { object-position: 52% 55%; }
  .chapter { padding-bottom: 2.5rem; }
  .sheet { padding: 1.2rem 1.1rem 1.4rem; box-shadow: 4px 4px 0 var(--orange); }
  .poppies { grid-template-columns: 1fr; }
  .qa { padding-top: 2.5rem; }
  .qa-grid { gap: .4rem; }
  .qa-grid p { margin-bottom: 1rem; }
  .about { padding: 1.5rem 0 2.5rem; }
  .blog-copy { padding: 1.5rem 0 2.5rem; gap: 1.5rem; }
  /* the camera leans in to the typewriter so the page can be read */
  .desk { transform: scale(1.9); transform-origin: 51% 44%; }
  .page { padding: 2cqw 3cqw; }
  .page .kicker { font-size: 1.3cqw; }
  .page .h { font-size: 2cqw; }
  .page .p { font-size: 1.45cqw; -webkit-line-clamp: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .petal, .plume, .spark { display: none; }
  html { scroll-behavior: auto; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---- 404 ---- */
.lost { min-height: 100vh; padding-bottom: 3rem; }
.lost .scene { aspect-ratio: 21 / 9; max-height: 60vh; }
.lost .sheet { max-width: 38rem; }
