@font-face {
  font-family: Hanken;
  src: url('/assets/fonts/hanken-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
}
:root {
  color-scheme: light;
  --vermillon: #e73121;
  --ivory: #fff8eb;
  --cycle: 7.2s;
  background: var(--vermillon);
  color: var(--ivory);
  font-family: Hanken, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
main {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 5rem;
}
.logo { display: block; width: clamp(220px, 23vw, 320px); height: auto; flex-shrink: 0; }
.house {
  display: block;
  width: min(100%, 410px);
  height: auto;
  margin-block: clamp(2.5rem, 7vh, 4.5rem) 2rem;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
  overflow: visible;
}
.foundation path + path { stroke-width: .7; }
.openings { stroke-width: 1.3; }
h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.1vw, 1.875rem);
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: .015em;
  text-align: center;
  text-wrap: balance;
}
/* Shared timeline: base → rising walls → openings → roof → hold → reset. */
.is-playing path { stroke-dasharray: 1; animation: foundation var(--cycle) linear infinite; }
.is-playing .walls path { animation-name: walls; }
.is-playing .openings path { animation-name: openings; }
.is-playing .roof path { animation-name: roof; }
.is-playing .construction { animation: reset var(--cycle) linear infinite; }
.is-paused path, .is-paused .construction { animation-play-state: paused; }
@keyframes foundation {
  0%, 3% { stroke-dashoffset: 1; }
  18%, 100% { stroke-dashoffset: 0; }
}
@keyframes walls {
  0%, 18% { stroke-dashoffset: 1; }
  43%, 100% { stroke-dashoffset: 0; }
}
@keyframes openings {
  0%, 43% { stroke-dashoffset: 1; }
  60%, 100% { stroke-dashoffset: 0; }
}
@keyframes roof {
  0%, 60% { stroke-dashoffset: 1; }
  79%, 100% { stroke-dashoffset: 0; }
}
@keyframes reset {
  0%, 90% { opacity: 1; }
  97%, 100% { opacity: 0; }
}
.motion-toggle {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.motion-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
.motion-toggle:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.play-icon, [aria-pressed='true'] .pause-icon { display: none; }
[aria-pressed='true'] .play-icon { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--ivory); color: var(--vermillon); }
@media (max-width: 480px) {
  main { padding-inline: 1.5rem; }
  .logo { width: 230px; max-width: 85%; }
  .house { width: min(100%, 330px); margin-top: 3rem; }
  .motion-toggle { right: 1rem; bottom: 1rem; }
}
@media (max-height: 600px) and (min-width: 700px) {
  main { padding-block: 2rem 3rem; }
  .logo { width: 200px; }
  .house { width: 260px; margin-block: 1.5rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .house path, .house .construction { animation: none !important; }
  .motion-toggle { display: none; }
}
