@font-face {
  font-family: "Bricolage Grotesque";
  src: url("./fonts/bricolage-grotesque.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("./fonts/literata-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #d9ee9f;
  --ink: #203d2f;
  --muted: #425b36;
  --line: #adc27c;
  --focus: #203d2f;
  --sans: "Bricolage Grotesque", sans-serif;
  --serif: "Literata", Georgia, serif;
}

* { box-sizing: border-box; }

html { scrollbar-color: var(--ink) var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--paper); }

button, a { -webkit-tap-highlight-color: transparent; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 6px;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  max-width: 1680px;
  padding: 38px 5.5vw 30px;
  margin-inline: auto;
}

.masthead, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  color: inherit;
  text-decoration: none;
  font-size: 37px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.wordmark-period { color: var(--muted); }

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1.36fr 1fr;
  align-items: center;
  gap: 12px;
  padding-block: 44px 54px;
}

.hero-copy { position: relative; z-index: 1; }

h1 {
  margin: 0;
  font-size: clamp(54px, 7.4vw, 96px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

h1 em { font-family: var(--serif); font-weight: 500; letter-spacing: -0.04em; }

.description { margin: 35px 0 0; font-size: 23px; line-height: 1.45; max-width: 34ch; }

.invitation { margin: 17px 0 0; font-size: 16px; line-height: 1.5; color: var(--muted); }

.type-study { width: 100%; max-width: 430px; justify-self: end; position: relative; }

.composition { position: relative; width: 100%; aspect-ratio: 1; }

.flow-line { position: absolute; width: 100%; height: 100%; overflow: visible; }
.flow-line path { stroke: var(--muted); stroke-width: 1.2px; stroke-linecap: round; stroke-linejoin: round; }

.study-word {
  position: absolute;
  display: block;
  font-family: var(--serif);
  font-size: clamp(56px, 6.9vw, 96px);
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.04em;
  transition: transform 750ms cubic-bezier(0.16, 1, 0.3, 1);
}

.word-one { left: 14%; top: 16%; transform: rotate(-14deg); }
.word-two { left: 37%; top: 40%; transform: rotate(8deg); }
.word-three { left: 17%; top: 65%; transform: rotate(-7deg); }
.composition-star { position: absolute; right: 7%; top: 64%; font-size: 90px; font-weight: 500; line-height: 1; }

.composition[data-arrangement="1"] .word-one { transform: translate(19%, 28%) rotate(7deg); }
.composition[data-arrangement="1"] .word-two { transform: translate(-41%, -9%) rotate(-13deg); }
.composition[data-arrangement="1"] .word-three { transform: translate(32%, -12%) rotate(4deg); }
.composition[data-arrangement="2"] .word-one { transform: translate(36%, 8%) rotate(-3deg); }
.composition[data-arrangement="2"] .word-two { transform: translate(-28%, 13%) rotate(0deg); }
.composition[data-arrangement="2"] .word-three { transform: translate(11%, -17%) rotate(11deg); }

.rearrange {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 20px auto 0;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 400 14px var(--sans);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  transition: color 150ms, text-decoration-color 150ms;
}

.rearrange[hidden] { display: none; }
.rearrange:hover { color: var(--ink); text-decoration-color: currentColor; }
.rearrange:active { transform: translateY(1px); }
.rearrange svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.footer { border-top: 1px solid var(--line); padding-top: 24px; font-size: 14px; color: var(--muted); }
.footer p { margin: 0; }

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

@media (min-width: 1440px) {
  .page { padding-inline: 7vw; }
  .hero { gap: 50px; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1.25fr 1fr; }
  h1 { font-size: clamp(48px, 7.1vw, 64px); }
  .description { font-size: 20px; }
  .study-word { font-size: clamp(52px, 7vw, 72px); }
  .composition-star { font-size: 72px; }
}

@media (max-width: 650px) {
  .page { padding: 28px 24px 24px; }
  .wordmark { font-size: 31px; }
  .status { font-size: 13px; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding-block: 70px 42px; }
  h1 { font-size: clamp(44px, 10.2vw, 66px); line-height: 1.09; }
  .description { margin-top: 26px; font-size: 20px; }
  .invitation { font-size: 14px; }
  .type-study { width: min(100%, 340px); justify-self: center; }
  .study-word { font-size: clamp(56px, 19vw, 78px); }
  .composition-star { font-size: 72px; }
  .composition[data-arrangement="1"] .word-one { transform: translate(19%, 0%) rotate(7deg); }
  .rearrange { margin-top: 2px; }
  .footer { align-items: flex-start; gap: 16px; padding-top: 20px; font-size: 12px; line-height: 1.5; }
  .footer p { max-width: 24ch; }
  .footer span { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
