/* Home: a calm canvas — a name, an eye, six shapes that stand for nothing */
.page-home { height: 100vh; height: 100dvh; overflow: hidden; background: #fff; }
.page-home::before, .page-home::after { display: none !important; }

.home-header { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: flex-start; padding: 26px 44px 0; pointer-events: none; }
.home-header a { pointer-events: auto; }
.home-id { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.home-mark { height: 64px; width: auto; display: block; margin-bottom: 4px; align-self: flex-start; }
.home-mark path { fill: var(--rose); }
.home-en { font-family: var(--display); font-style: italic; font-size: 22px; line-height: 1.1; color: var(--ink); }
.home-role { font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-muted); }
.home-nav { display: flex; gap: 30px; padding-top: 10px; }
.home-nav a { font-family: var(--display); font-style: italic; font-size: 20px; color: var(--ink-muted); text-decoration: none; }
.home-nav a:hover, .home-nav a:focus-visible { color: var(--rose); }

.home-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.eye-wrap { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); width: min(210px, 17vw); z-index: 2; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.eye { width: 100%; height: auto; display: block; overflow: visible; }
.eye > * { filter: url(#wobbleHome); }

.shapes { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.shape { position: absolute; width: var(--sz, 120px); height: var(--sz, 120px); margin: calc(var(--sz, 120px) / -2) 0 0 calc(var(--sz, 120px) / -2);
  pointer-events: auto; cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; transition: left .9s cubic-bezier(.3,1.2,.4,1), top .9s cubic-bezier(.3,1.2,.4,1); }
.shape.dragging { cursor: grabbing; transition: none; z-index: 5; }
.shape .bob { width: 100%; height: 100%; animation: bob var(--dur, 9s) ease-in-out infinite alternate; animation-delay: var(--delay, 0s); }
.shape svg { width: 100%; height: 100%; display: block; overflow: visible; }
.shape.poke svg { animation: poke .55s cubic-bezier(.3,1.6,.5,1); }
.shape.dragging svg { transform: scale(1.08) rotate(-4deg); transition: transform .2s; }
.shape:focus-visible { outline: 1px dashed var(--rose); outline-offset: 6px; border-radius: 50%; }
@keyframes bob { 0% { transform: translate(0, 0) rotate(-6deg); } 35% { transform: translate(calc(var(--bx, 8px) * .6), calc(var(--by, -12px) * -.4)) rotate(3deg); } 70% { transform: translate(calc(var(--bx, 8px) * -.3), var(--by, -12px)) rotate(-2deg); } 100% { transform: translate(var(--bx, 8px), calc(var(--by, -12px) * .5)) rotate(7deg); } }
@keyframes poke { 0% { transform: scale(1); } 30% { transform: scale(1.18, .86) rotate(-8deg); } 60% { transform: scale(.92, 1.1) rotate(6deg); } 100% { transform: scale(1); } }

.home-tools { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 10; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
.tool { font-family: var(--display); font-style: italic; font-size: 19px; color: var(--ink-muted); background: none; border: 0; border-bottom: 1px solid transparent; padding: 2px 0; cursor: pointer; }
.tool + .tool::before { content: "·"; color: var(--rose); margin: 0 14px 0 0; font-style: normal; }
.tool:hover, .tool:focus-visible { color: var(--rose); outline: none; }
.tool:hover span, .tool:focus-visible span { border-bottom: 1px solid currentColor; }
.tool-note { flex-basis: 100%; text-align: center; margin: 2px 0 0; font-family: var(--display); font-style: italic; font-size: 15px; color: var(--ink-muted); min-height: 1em; }

@media (max-width: 760px) {
  .home-header { padding: 18px 18px 0; }
  .home-mark { height: 44px; }
  .home-en { font-size: 17px; }
  .home-role { font-size: 9.5px; letter-spacing: .12em; }
  .home-nav { gap: 16px; padding-top: 6px; }
  .home-nav a { font-size: 17px; }
  .eye-wrap { width: 40vw; top: 50%; }
  .home-tools { bottom: 18px; width: calc(100% - 36px); }
  .tool { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .shape .bob { animation: none; } .shape { transition: none; } }


/* the eye drifts too, as one more thing floating on the canvas */
.eye { animation: eyeFloat 14s ease-in-out infinite alternate; }
@keyframes eyeFloat { 0% { transform: translate(-10px, 6px) rotate(-3deg); } 50% { transform: translate(8px, -10px) rotate(2deg); } 100% { transform: translate(-4px, 12px) rotate(-1deg); } }
@media (prefers-reduced-motion: reduce) { .eye { animation: none; } }

/* the pencil */
.tool-draw { display: inline-flex; align-items: center; gap: 6px; }
.tool-draw .pencil { width: 17px; height: 17px; }
.tool-draw[aria-pressed="true"] { color: var(--rose); }
.tool-draw[aria-pressed="true"] span { border-bottom: 1px solid currentColor; }
.ink { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.ink path { fill: none; stroke: #A8233A; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-stage.drawing { cursor: crosshair; }
.home-stage.drawing .shape { cursor: crosshair; }
.shape.drawn .bob { animation-duration: calc(var(--dur, 9s) * 1.4); }
.shape.placed .bob { animation: none; }

/* letting visitors know the canvas is theirs */
.hint { order: -1; flex-basis: 100%; text-align: center; margin: 0 0 4px; font-family: var(--display); font-style: italic; font-size: 17px; color: var(--ink-muted); transition: opacity .8s ease; pointer-events: none; }
.hint.gone { opacity: 0; }
.shape.nudging .bob { animation-play-state: paused; }
.shape.nudging { transition: left 1s cubic-bezier(.4,0,.2,1), top 1s cubic-bezier(.4,0,.2,1); }
.home-stage:not(.drawing) .shape:hover svg { transform: scale(1.08); transition: transform .25s; }
/* a clear way out of drawing */
.done-btn { position: absolute; top: 150px; left: 50%; transform: translateX(-50%); z-index: 12; font-family: var(--display); font-style: italic; font-size: 19px; color: #fff; background: var(--rose); border: 0; border-radius: 999px; padding: 8px 22px; cursor: pointer; box-shadow: 0 6px 18px rgba(168,35,58,.25); }
.done-btn:hover, .done-btn:focus-visible { background: var(--rose-deep, #8E1E30); outline: none; }
.done-btn[hidden] { display: none; }
@media (max-width: 760px) { .hint { font-size: 15px; } .done-btn { top: 120px; } .tool + .tool::before { margin-right: 10px; } }
