@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/caveat-latin-ext.woff2') format('woff2');
  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-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/caveat-latin.woff2') format('woff2');
  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;
}

:root,
:root[data-theme='light'] {
  --paper: #f2eee8;
  --paper-sheet: #fffdf7;
  --ink: #2a2723;
  --paper-rule: rgb(42 39 35 / 7%);
  --paper-margin: rgb(193 95 60 / 30%);
  --paper-shadow: rgb(60 48 32 / 12%);
  --primary: #da7757;
  --primary-foreground: #fffdf7;
  --muted-foreground: #6f6759;
  --border: rgb(42 39 35 / 14%);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --paper: #1c1a17;
  --paper-sheet: #23201c;
  --ink: #ece5d9;
  --paper-rule: rgb(236 229 217 / 7%);
  --paper-margin: rgb(216 130 92 / 32%);
  --paper-shadow: rgb(0 0 0 / 40%);
  --primary: #da7757;
  --muted-foreground: #a69c8c;
  --border: rgb(236 229 217 / 13%);
  color-scheme: dark;
}

:root {
  --rule-height: 2rem;
  --font-hand: 'Caveat', cursive;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia,
    'Times New Roman', serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--ink);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--rule-height) - 1px),
    var(--paper-rule) calc(var(--rule-height) - 1px),
    var(--paper-rule) var(--rule-height)
  );
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

main {
  position: relative;
  width: 100%;
  max-width: 34rem;
  padding: 2.75rem 2.5rem 2rem;
  background-color: var(--paper-sheet);
  border: 1px solid var(--border);
  border-radius: 22px 8px 26px 9px / 9px 24px 8px 22px;
  box-shadow: 0 18px 40px -24px var(--paper-shadow);
  text-align: center;
}

main::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 2rem;
  width: 1px;
  background-color: var(--paper-margin);
}

.paper-wordmark {
  font-family: var(--font-hand);
  font-size: clamp(3.1rem, 12.5vw, 3.9rem);
  font-weight: 700;
  line-height: 1;
  margin: 0;
}

.paper-wordmark::after {
  content: '.';
  color: var(--primary);
}

h2 {
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  font-weight: 600;
  margin: 1.5rem 0 0;
}

p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted-foreground);
  margin: 0.85rem auto 0;
  max-width: 26rem;
}

.rule {
  width: 3.5rem;
  height: 2px;
  margin: 1.75rem auto 0;
  border: 0;
  background-color: var(--primary);
  opacity: 0.65;
}

.controls {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.group {
  display: flex;
  gap: 0.4rem;
}

.group button {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.group button:hover {
  color: var(--ink);
}

.group button[aria-pressed='true'] {
  color: var(--primary-foreground);
  background-color: var(--primary);
  border-color: var(--primary);
  cursor: default;
}

.group.theme button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 999px;
}

.group.theme svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

footer {
  margin-top: 1.75rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

footer a {
  color: inherit;
}

@media (max-width: 30rem) {
  main {
    padding: 2.25rem 1.5rem 1.75rem;
  }
  main::before {
    left: 1rem;
  }
}
