/* Lvju · 旅居. A plaster wall with one window in it; the sky outside follows the visitor's clock. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-latin-ext.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Only the two characters 旅 and 居. */
@font-face {
  font-family: "Lvju Han";
  src: url("fonts/noto-serif-sc-lvju.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+65C5, U+5C45;
}

/* The sky is drawn from registered properties so it can change smoothly. */
@property --sky-top { syntax: "<color>"; inherits: true; initial-value: #C7D1D2; }
@property --sky-low { syntax: "<color>"; inherits: true; initial-value: #DCE3E2; }
@property --orb-x { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@property --orb-y { syntax: "<percentage>"; inherits: true; initial-value: 92%; }
@property --orb-a { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --orb-c { syntax: "<color>"; inherits: true; initial-value: #FFF4D6; }
@property --orb-glow { syntax: "<color>"; inherits: true; initial-value: rgba(255, 236, 190, 0); }
@property --stars { syntax: "<number>"; inherits: true; initial-value: 0; }

:root {
  --wall: #E4E7E2;
  --wall-2: #D9DED7;
  --reveal: #D3D9D1;
  --sill: #F1F3EF;
  --sill-edge: #C6CDC4;
  --pine: #23302B;
  --pine-2: #2F3F38;
  --ink: #1E2723;
  --muted: #56625C;
  --line: rgba(30, 39, 35, 0.16);
  --on-pine: #E9EDE8;
  --on-pine-muted: #AFBDB5;
  --error: #9B2C2C;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --han: "Lvju Han", "Noto Serif SC", "Songti SC", "SimSun", serif;

  --frame: 14px;
  --mullion: 10px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, dl, dd, figure { margin: 0; }

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 100;
  color: var(--ink);
  text-wrap: balance;
}

a { color: inherit; }

.han {
  font-family: var(--han);
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.04em;
}

.py { font-family: var(--sans); font-style: normal; }

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--pine);
  color: var(--on-pine);
  border-radius: 4px;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
}

/* ---------- top bar ---------- */

.bar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}

.brand-name {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-size: 1.5rem;
  line-height: 1;
}

.brand .han {
  font-size: 1rem;
  color: var(--muted);
}

.bar-go {
  font-size: 1rem;
  font-weight: 500;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.bar-go:hover { text-decoration-thickness: 2px; }

/* ---------- hero: text on the left, the window on the right ---------- */

.hero-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(40px, 7vw, 112px);
  padding-block: clamp(24px, 5vh, 64px) clamp(56px, 10vh, 112px);
}

.hero h1 {
  font-size: clamp(2.5rem, 1.35rem + 3.6vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  max-width: 11em;
}

.lede {
  margin-top: 24px;
  max-width: 32rem;
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--ink);
}

.hero .join { margin-top: 36px; max-width: 32rem; }

/* the opening in the wall */
.opening {
  justify-self: center;
  width: fit-content;
  display: grid;
  justify-items: center;
}

.window {
  position: relative;
  height: clamp(340px, 64svh, 620px);
  aspect-ratio: 4 / 5;
  background: var(--pine);
  box-shadow:
    0 0 0 18px var(--reveal),
    0 0 0 19px rgba(30, 39, 35, 0.07),
    inset 0 2px 0 rgba(255, 255, 255, 0.06);
}

.view {
  position: absolute;
  inset: var(--frame);
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-low) 80%);
  transition:
    --sky-top 1.6s cubic-bezier(.4, 0, .2, 1),
    --sky-low 1.6s cubic-bezier(.4, 0, .2, 1),
    --orb-x 1.6s cubic-bezier(.4, 0, .2, 1),
    --orb-y 1.6s cubic-bezier(.4, 0, .2, 1),
    --orb-a 1.6s ease,
    --orb-c 1.6s ease,
    --orb-glow 1.6s ease,
    --stars 1.6s ease;
}

/* Without JavaScript the window shows a plain daytime sky. */
html:not(.js) .view {
  --sky-top: #6FA6D2;
  --sky-low: #CFE3EE;
  --orb-x: 70%;
  --orb-y: 30%;
  --orb-a: 1;
}

.stars {
  position: absolute;
  inset: 0 0 30% 0;
  opacity: var(--stars);
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff 98%, transparent),
    radial-gradient(1px 1px at 27% 41%, #fff 98%, transparent),
    radial-gradient(1.2px 1.2px at 38% 12%, #fff 98%, transparent),
    radial-gradient(1px 1px at 52% 30%, #fff 98%, transparent),
    radial-gradient(1.6px 1.6px at 64% 9%, #fff 98%, transparent),
    radial-gradient(1px 1px at 71% 47%, #fff 98%, transparent),
    radial-gradient(1.3px 1.3px at 83% 24%, #fff 98%, transparent),
    radial-gradient(1px 1px at 91% 56%, #fff 98%, transparent),
    radial-gradient(1px 1px at 8% 60%, #fff 98%, transparent),
    radial-gradient(1.2px 1.2px at 45% 63%, #fff 98%, transparent);
}

.orb {
  position: absolute;
  left: var(--orb-x);
  top: var(--orb-y);
  width: clamp(24px, 9%, 56px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--orb-c);
  opacity: var(--orb-a);
  box-shadow: 0 0 36px 14px var(--orb-glow);
}

.land {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 34%;
}
.land .far { fill: color-mix(in oklab, var(--sky-low) 55%, var(--pine)); }
.land .near { fill: color-mix(in oklab, var(--sky-low) 28%, var(--pine)); }

.glass {
  position: absolute;
  inset: 0;
  background: linear-gradient(118deg,
    rgba(255, 255, 255, 0) 28%,
    rgba(255, 255, 255, 0.10) 34%,
    rgba(255, 255, 255, 0) 44%,
    rgba(255, 255, 255, 0) 58%,
    rgba(255, 255, 255, 0.06) 62%,
    rgba(255, 255, 255, 0) 70%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22), inset 0 6px 14px rgba(0, 0, 0, 0.18);
}

/* the cross of the frame, making four panes */
.bars {
  position: absolute;
  inset: var(--frame);
  background:
    linear-gradient(var(--pine), var(--pine)) center / var(--mullion) 100% no-repeat,
    linear-gradient(var(--pine), var(--pine)) center / 100% var(--mullion) no-repeat;
  pointer-events: none;
}

.sill {
  width: calc(100% + 72px);
  height: 16px;
  margin-top: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--sill) 0 56%, var(--sill-edge) 56% 100%);
  box-shadow: 0 12px 18px -12px rgba(30, 39, 35, 0.4);
}

.clock {
  margin-top: 18px;
  max-width: 26rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}
.js .when-nojs,
html:not(.js) .when-js { display: none; }

/* ---------- the form ---------- */

.row {
  display: flex;
  gap: 8px;
}

.field {
  flex: 1 1 auto;
  min-width: 0;
  height: 54px;
  padding: 0 16px;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--ink);
  background: #F4F6F2;
  border: 1.5px solid #9AA59E;
  border-radius: 4px;
}
.field::placeholder { color: #67726C; }
.field:focus-visible { border-color: var(--pine); outline-offset: 2px; }
.field[aria-invalid="true"] { border-color: var(--error); }

.btn {
  flex: none;
  height: 54px;
  padding: 0 22px;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--on-pine);
  background: var(--pine);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.btn:hover { background: var(--pine-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: progress; opacity: 0.75; }

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.fine {
  margin-top: 12px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.oops {
  margin-top: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--error);
}
.oops:empty { display: none; }

.nojs { display: none; margin-top: 8px; font-size: 0.9375rem; color: var(--error); }
html:not(.js) .nojs { display: block; }

.done-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.125rem;
}
.done-line b { font-weight: 600; }
.tick { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--pine); stroke-width: 1.6; }
.tick path { stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.again {
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.when-joined { display: none; }
.is-joined .when-open { display: none; }
.is-joined .when-joined { display: inline; }

/* ---------- the name ---------- */

.band { padding-block: clamp(72px, 11vw, 136px); }

#name { background: var(--wall-2); }

.band h2 {
  font-size: clamp(1.875rem, 1.35rem + 1.6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.name-in {
  display: grid;
  grid-template-columns: auto minmax(0, 34rem);
  grid-template-areas:
    "head head"
    "chars prose";
  column-gap: clamp(40px, 8vw, 128px);
  row-gap: 48px;
  align-items: start;
}
.name-in h2 { grid-area: head; }

.chars {
  grid-area: chars;
  display: flex;
  gap: clamp(28px, 4vw, 56px);
}

.char dt .han {
  display: block;
  font-size: clamp(4.5rem, 3rem + 5vw, 7.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.char dd {
  margin-top: 14px;
  max-width: 9.5rem;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--muted);
}
.char dd .py {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.prose { grid-area: prose; }
.prose p + p { margin-top: 1em; }

/* ---------- questions ---------- */

.qs-in {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 40rem);
  justify-content: space-between;
  gap: 40px;
}

.qs { border-top: 1px solid var(--line); }

.q { border-bottom: 1px solid var(--line); }

.q summary {
  position: relative;
  padding: 20px 40px 20px 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.q summary::-webkit-details-marker { display: none; }
.q summary::before,
.q summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 14px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.2s ease;
}
.q summary::after { transform: rotate(90deg); }
.q[open] summary::after { transform: rotate(0deg); }

.q p {
  padding-bottom: 22px;
  max-width: 36rem;
  color: var(--muted);
}

/* ---------- close: the frame colour, as if standing at the window at night ---------- */

.close {
  padding-block: clamp(80px, 12vw, 144px);
  background: var(--pine);
  color: var(--on-pine);
}
.close h2 {
  color: var(--on-pine);
  font-size: clamp(1.875rem, 1.35rem + 1.6vw, 2.5rem);
  line-height: 1.15;
  max-width: 18em;
}
.close .lede { color: var(--on-pine-muted); }
.close .join { margin-top: 36px; max-width: 32rem; }
.close .field {
  color: var(--on-pine);
  background: #2C3B35;
  border-color: #56685F;
}
.close .field::placeholder { color: #93A39A; }
.close .field:focus-visible { border-color: var(--on-pine); }
.close .btn { color: var(--pine); background: var(--wall); }
.close .btn:hover { background: #F2F4F0; }
.close .fine { color: var(--on-pine-muted); }
.close .oops { color: #F2B8B5; }
.close .nojs { color: #F2B8B5; }
.close .tick { stroke: var(--on-pine); }
.close :focus-visible { outline-color: var(--on-pine); }

.foot {
  background: var(--pine);
  color: var(--on-pine-muted);
  font-size: 0.9375rem;
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
  padding-block: 28px 36px;
  border-top: 1px solid rgba(233, 237, 232, 0.12);
}
.foot .brand-name { font-size: 1.125rem; color: var(--on-pine); }
.foot .han { color: var(--on-pine-muted); }
.foot a { text-underline-offset: 3px; }
.foot :focus-visible { outline-color: var(--on-pine); }

/* ---------- smaller screens: the window first, shorter ---------- */

@media (max-width: 860px) {
  .hero-in {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: 8px;
  }
  .hero .join { margin-top: 28px; }
  .opening { order: -1; width: 100%; }
  .window {
    width: calc(100% - 36px);
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: 36svh;
  }
  .clock { margin-top: 14px; }
  .sill { width: calc(100% + 8px); }
  .clock { max-width: 22rem; }

  .name-in {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "chars" "prose";
    row-gap: 36px;
  }
  .qs-in { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 460px) {
  .row { flex-direction: column; }
  .btn { width: 100%; }
  .lede { margin-top: 18px; font-size: 1.125rem; }
  .hero h1 { font-size: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .view { transition: none; }
  .q summary::before,
  .q summary::after { transition: none; }
  .btn:active { transform: none; }
}
