/* One coordinate plane: desktop artwork is 1600 × 900, never stretched.
   --x / --y / --w are scene units, not independent viewport percentages.
   Text stays in normal flow; an unusually tall header pushes the whole canvas
    down instead of clipping titles or letting them collide with the person. */
@font-face { font-family: "Caveat"; src: url("/assets/fonts/caveat-latin.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
.home-page { position: relative; width: 100%; max-width: none; }
/* Navigation keeps its original measure and position, over the room's sky. */
.home-page .journal-header { position: absolute; z-index: 10; top: 0; left: 50%; flex-wrap: wrap; row-gap: .5rem; width: min(100% - 48px, 1160px); margin: 0; border: 0; background: transparent; transform: translateX(-50%); }
.home-page .journal-header a { color: #f8f3df; text-decoration-color: #c0d7d4; text-shadow: 0 2px 6px #102335; }
.home-page .journal-header a:focus-visible { outline-color: #ffe599; }
.home-page .site-nav { margin-left: auto; }
.home-page .page { width: 100%; }
.home-page .landing {
  isolation: isolate;
  background: linear-gradient(#1a2a38 0 70%, #263c46 70% 88%, #1a303a 88%);
}
.landing-stage { --scene-sky: 26.25cqw; position: relative; min-height: 100svh; max-width: 1600px; margin-inline: auto; container-type: inline-size; }
.landing-heading {
  /* 420 / 1600 reserved sky; rem padding also accommodates text-only zoom.
     The camera's entire frame begins below this boundary, including when
     long titles expand the panel and push the canvas down. */
  position: relative;
  z-index: 6;
  display: grid;
   grid-template-columns: 20.625cqw 27.5cqw;
  align-items: start;
   gap: 3.625cqw;
  min-height: var(--scene-sky);
  padding: max(6rem, 6.5625cqw) 5cqw 0 7cqw;
  pointer-events: none;
}
.landing-heading > * { min-width: 0; pointer-events: auto; }
.landing-copy { max-width: 600px; color: #f8f3df; text-shadow: 0 2px 10px #132741; }
.landing-copy h1 { color: #f8f3df; font-family: "Caveat", "Segoe Print", cursive; font-weight: 600; font-size: clamp(3.5rem, 5cqw, 5rem); line-height: 1.05; letter-spacing: -.015em; overflow-wrap: anywhere; }
.landing-period { color: #f1c17a; }
.landing-intro { max-width: 38ch; margin: 1.2rem 0 0; color: #f8f3df; font-size: 1.125rem; line-height: 1.55; }
.scene-canvas { position: relative; aspect-ratio: 1600 / 900; margin-top: calc(-1 * var(--scene-sky)); }
.landing-art { position: absolute; inset: 0; pointer-events: none; }
.landing-landscape, .landing-room { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.landing-room { z-index: 2; }
.landing-mobile { display: none; }
.landing-person {
  position: absolute; z-index: 3;
  left: calc(970 / 1600 * 100%); top: calc(310 / 900 * 100%);
  width: calc(270 / 1600 * 100%); height: calc(540 / 900 * 100%);
  object-fit: contain;
  filter: drop-shadow(5px 5px 0 #08172745);
}
/* A puffy thought cloud. The element itself keeps its original box and
   normal-flow auto height; only two decorative, aria-free pseudo elements draw
   the puffy silhouette and its pixel-art shadow. Text is never masked. */
.thought-cloud {
  --puff: 16px;
  --shadow-x: 5px;
  --shadow-y: 6px;
  position: relative;
  isolation: isolate;
  padding: 1rem 1.15rem;
  border: 0;
  background: transparent;
  color: #173d47;
  overflow-wrap: anywhere;
}
.thought-cloud::before,
.thought-cloud::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: calc(-1 * var(--puff));
  pointer-events: none;
  /* Uneven lobes, not repeating stamp edges. Only decoration is masked:
     content and keyboard focus outlines remain normal, unclipped HTML. */
  background: var(--cloud-fill);
  -webkit-mask: url("/assets/thought-cloud.svg") center / 100% 100% no-repeat;
  mask: url("/assets/thought-cloud.svg") center / 100% 100% no-repeat;
}
.thought-cloud::before { --cloud-fill: #f6f2df; }
.thought-cloud::after { --cloud-fill: #1b3945; z-index: -2; transform: translate(var(--shadow-x), var(--shadow-y)); }
.thought-heading { display: flex; justify-content: center; align-items: center; gap: .55rem; color: #335c55; text-align: center; }
.thought-heading > span { flex: none; font-size: 1.5rem; }
.thought-heading h2 { margin: 0; font-size: 1.1rem; line-height: 1.3; letter-spacing: -.02em; }
.thought-cloud ol { margin: .7rem 0 .5rem; padding: 0; list-style: none; }
.thought-cloud li { padding: .5rem 0; border-top: 1px solid #c2cdbf; line-height: 1.35; }
.home-page .thought-cloud li a { display: block; color: #173d47; font-size: 1rem; font-weight: 720; text-decoration: none; }
.thought-cloud li a:hover, .thought-cloud li a:focus-visible { text-decoration: underline; }
.thought-cloud li > span { display: block; margin-top: .25rem; color: #425e58; font-size: .8rem; }
.home-page .thought-cloud .all-thoughts { display: flex; width: fit-content; margin-inline: auto; align-items: center; min-height: 44px; gap: .4em; color: #24566a; font-size: .9rem; font-weight: 750; }
.thought-trail { position: absolute; z-index: 4; left: calc(920 / 1600 * 100%); top: calc(175 / 900 * 100%); width: calc(200 / 1600 * 100%); aspect-ratio: 200 / 140; pointer-events: none; }
.thought-trail svg { display: block; width: 100%; height: auto; fill: #f6f2df; }
.thought-trail-compact { display: none; }
.field-object {
  position: absolute; z-index: 5;
  left: calc(var(--x) / 1600 * 100%); top: calc(var(--y) / 900 * 100%); width: calc(var(--w) / 1600 * 100%);
  display: grid; justify-items: center; min-height: 44px;
  text-align: center; text-decoration: none !important;
}
.object-art { display: block; width: 100%; filter: drop-shadow(0 0 3px var(--halo)); transition: filter .18s ease; }
.object-art > svg, .object-art > img { display: block; width: 100%; height: auto; }
/* All bases share the room's y=650 tabletop, except camera and cabinet. */
.field-camera { --x: 1352; --y: 424; --w: 114; --halo: #fbd785; }
.field-radio { --x: 550; --y: 577; --w: 144; --halo: #a9e3c2; }
.field-laptop { --x: 152; --y: 460; --w: 360; --halo: #a4d7f4; }
.field-printer { --x: 1360; --y: 619; --w: 158; --halo: #a2d9c7; }
.object-label { position: absolute; z-index: 2; bottom: calc(100% + 10px); left: 50%; width: max-content; max-width: 14rem; padding: .4rem .65rem; border: 2px solid #ffe7a9; background: #193a46; color: #fff8df; font-size: .9rem; font-weight: 750; line-height: 1.35; opacity: 0; transform: translateX(-50%); pointer-events: none; }
/* The outdoor tripod is above the printer: put this label over its cabinet. */
.field-printer .object-label { top: calc(100% + 10px); bottom: auto; }
.field-object:hover .object-label, .field-object:focus-visible .object-label { opacity: 1; }
/* Steady silhouette glow lives on a wrapper; internal animations never change
   its filter. The transparent printer image keeps an alpha-shaped halo. */
.field-object:hover .object-art, .field-object:focus-visible .object-art { filter: brightness(1.15) drop-shadow(0 0 5px var(--halo)) drop-shadow(0 0 12px var(--halo)); }
.monitor-screen { animation: screen-glow 5s ease-in-out infinite; }
.monitor-cursor { animation: cursor-blink 1.2s steps(1, end) infinite; }
.camera-flash { opacity: 0; animation: camera-flash 9s linear infinite; }
.camera-capture-preview { opacity: 0; animation: camera-capture 9s linear infinite; }
.home-page .landing :focus-visible { outline: 3px solid #ffe599; outline-offset: 5px; box-shadow: 0 0 0 7px #18313a; }
.home-page .thought-cloud :focus-visible { outline-color: #124f8b; box-shadow: none; }
.home-page .landing-scroll { position: absolute; z-index: 5; right: 5%; bottom: 3%; display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: .25rem .5rem; border: 0; background: transparent; color: #f8f3df; font-family: "Caveat", "Segoe Print", cursive; font-size: clamp(1.9rem, 2.5cqw, 2.5rem); font-weight: 600; line-height: 1.1; text-decoration: none; }
.landing-scroll-label { white-space: nowrap; }
.home-page .landing-scroll:hover { color: #ffe09a; }
.scroll-cue { display: block; flex: none; width: 2.75rem; height: 3.5rem; overflow: visible; animation: scroll-nudge 2.6s ease-in-out infinite; }
.home-page .about-me { width: min(100% - 48px, 760px); margin: auto; padding-top: 4rem; }
.home-page .footer { width: min(100% - 48px, 760px); margin: auto; }
.about-me [id] { scroll-margin-top: 2rem; }
@keyframes screen-glow { 50% { fill: #20434d; } }
@keyframes cursor-blink { 50% { opacity: 0; } }
@keyframes camera-flash { 0%, 12%, 15%, 100% { opacity: 0; } 13% { opacity: .8; } 14% { opacity: .2; } }
@keyframes camera-capture { 0%, 14%, 70%, 100% { opacity: 0; } 18%, 55% { opacity: 1; } }
@keyframes scroll-nudge { 0%, 65%, 100% { transform: translateY(0); } 35% { transform: translateY(7px); } }

/* Compact is an art-directed 400 × 380 frame, always fully visible.
   Keep text and cards out of the picture; never crop the moon to fill a box. */
@media (max-width: 74.99rem) {
  .home-page .journal-header { width: min(100% - 32px, 760px); }
  .home-page .landing { background: #f1f2e5; }
  .landing-stage { display: flex; flex-direction: column; min-height: 0; padding-bottom: 2rem; }
  .landing-heading { display: contents; }
  .landing-copy { order: 0; width: 100%; max-width: none; padding: 7rem max(1rem, calc((100% - 680px) / 2)) 2rem; background: #192b3a; }
  .landing-copy h1 { font-size: clamp(2.75rem, 6vw, 4rem); }
  .landing-intro { max-width: 44ch; font-size: 1.0625rem; }
  /* Smaller puffs and a shorter shadow keep the silhouette inside the 16px
     side gutters at 320px, so the cloud never creates horizontal scroll. */
  .thought-cloud { --puff: 10px; --shadow-x: 3px; --shadow-y: 4px; order: 2; width: min(100% - 32px, 680px); margin: 1.5rem auto 2rem; }
  .thought-cloud { filter: drop-shadow(-1px 0 0 #1b3945) drop-shadow(0 -1px 0 #1b3945); }
  .thought-cloud ol { padding-inline: .35rem; }
  .thought-trail-compact { filter: drop-shadow(-1px 0 0 #1b3945) drop-shadow(0 -1px 0 #1b3945); }
  .thought-cloud li a { min-height: 44px; display: flex !important; align-items: center; }
  .scene-canvas { display: contents; }
  .landing-art { position: relative; order: 1; inset: auto; width: min(100%, 680px); aspect-ratio: 400 / 380; margin-inline: auto; background: #192b3a; }
  .landing-landscape, .landing-room { display: none; }
  .landing-mobile { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
  .landing-person { left: 45%; top: 30%; width: 32%; height: auto; aspect-ratio: 1 / 2; filter: drop-shadow(3px 3px 0 #08172745); }
  .thought-trail { display: none; }
  /* Curve from the crown around the empty right side to the panel below. */
  .thought-trail-compact { position: absolute; z-index: 4; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; fill: #f6f2df; }
  .field-objects { position: relative; order: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; width: min(100% - 32px, 680px); margin-inline: auto; }
  .field-object { position: relative; inset: auto; width: 100%; min-height: 176px; grid-template-rows: 124px auto; align-items: center; gap: .5rem; padding: .8rem; border: 2px solid #587f7e; background: #1e3943; }
  .object-art { display: grid; place-items: center; width: 100%; height: 120px; }
  .object-art > svg, .object-art > img { width: 100%; height: 120px; object-fit: contain; }
  .field-camera .object-art > svg { width: 108px; }
  .field-laptop .object-art > svg { max-width: 250px; }
  .field-radio .object-art > svg { max-width: 210px; }
  .field-printer .object-art > svg { width: auto; max-width: 100%; }
  .object-label { position: static; max-width: 100%; width: auto; border: 0; padding: .2rem 0; background: none; font-size: 1rem; opacity: 1; transform: none; }
  .home-page .landing-scroll { position: relative; order: 4; inset: auto; align-self: center; margin-top: 1.5rem; color: #234853; font-size: 2.1rem; }
  .home-page .landing-scroll:hover { color: #124f8b; }
  .home-page .about-me, .home-page .footer { width: min(100% - 32px, 760px); }
}
@media (hover: none) and (min-width: 75rem) {
  .object-label { opacity: 1; font-size: .85rem; }
}
@media (max-width: 350px) {
  .field-objects { gap: .75rem; }
  .field-object { padding: .6rem; grid-template-rows: 100px auto; min-height: 156px; }
  .object-art, .object-art > svg, .object-art > img { height: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .monitor-screen, .monitor-cursor, .camera-flash, .camera-capture-preview, .scroll-cue { animation: none; }
  .camera-flash { display: none; }
  .camera-capture-preview { opacity: 1; }
  .object-art { transition: none; }
}
@media (forced-colors: active) {
  .thought-cloud, .field-object, .object-label { border: 2px solid CanvasText; }
  .thought-cloud { border-radius: 2rem; background: Canvas; color: CanvasText; filter: none; }
  .thought-cloud::before, .thought-cloud::after { display: none; }
  .home-page .landing-scroll { color: LinkText; }
  .landing-copy { color: CanvasText; text-shadow: none; }
  .object-label { forced-color-adjust: auto; }
  .home-page .landing :focus-visible { outline-color: Highlight; box-shadow: none; }
}
