/* DM Sans - Normal */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
  src: url(../fonts/dm-sans-normal-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;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
  src: url(../fonts/dm-sans-normal-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;
}
/* DM Sans - Italic */
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url(../fonts/dm-sans-italic-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;
}
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url(../fonts/dm-sans-italic-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;
}
/* EB Garamond - Normal */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(../fonts/eb-garamond-normal-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;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(../fonts/eb-garamond-normal-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;
}
/* EB Garamond - Italic */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url(../fonts/eb-garamond-italic-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;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url(../fonts/eb-garamond-italic-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;
}
/* Playfair Display - Normal */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(../fonts/playfair-display-normal-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;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(../fonts/playfair-display-normal-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;
}
/* Playfair Display - Italic */
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/playfair-display-italic-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;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/playfair-display-italic-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;
}

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

:root {
  --bg: #f5f0e8;
  --text: #1a1a18;
  --muted: #6b655a;
  --accent: #b8a88a;
  --divider: #d4cbbf;
}

html {
  min-height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  min-height: 100vh; /* fallback */
  padding: 2rem;
  padding: env(safe-area-inset-top, 2rem) env(safe-area-inset-right, 2rem) env(safe-area-inset-bottom, 2rem) env(safe-area-inset-left, 2rem);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.poster {
  max-width: 540px;
  width: 100%;
  padding: 3.5rem 3rem;
  position: relative;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  body {
    padding: 1.25rem;
    align-items: flex-start;
    padding-top: 2.5rem;
  }
  .poster {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 360px) {
  body {
    padding: 0.75rem;
    padding-top: 1.5rem;
  }
  .poster {
    padding: 1.5rem 1.25rem;
  }
}

/* subtle paper-like inner border */
.poster::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--divider);
  pointer-events: none;
}

.word {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: clamp(3.5rem, 10vw, 5.5rem);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.15em;
}

.syllable-dot {
  color: var(--accent);
  font-weight: 400;
  margin: 0 0.04em;
}

.phonetic {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-bottom: 0.3em;
}

.word-class {
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--muted);
  margin-bottom: 1.8em;
}

.divider {
  width: 2.5rem;
  height: 1.5px;
  background: var(--accent);
  margin-bottom: 1.8em;
}

.definition {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  line-height: 1.65;
  color: var(--text);
  max-width: 440px;
  transition: opacity 0.3s ease;
}

.origin {
  margin-top: 2.5em;
  padding-top: 1.5em;
  border-top: 1px solid var(--divider);
}

.origin-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 0.5em;
}

.origin-text {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.5;
}

.origin-text em {
  font-style: italic;
}

.origin-text .see-also {
  font-style: italic;
}

/* subtle entrance animation */
.poster > * {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeIn 0.6s ease forwards;
}

.poster > *:nth-child(1) { animation-delay: 0.1s; }
.poster > *:nth-child(2) { animation-delay: 0.2s; }
.poster > *:nth-child(3) { animation-delay: 0.3s; }
.poster > *:nth-child(4) { animation-delay: 0.4s; }
.poster > *:nth-child(5) { animation-delay: 0.5s; }
.poster > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* print-friendly */
@media print {
  body { background: white; }
  .poster::before { border-color: #ccc; }
  .poster > * { opacity: 1; transform: none; animation: none; }
}
