@font-face {
  font-family: Italiana;
  src: url('./italiana-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Manrope;
  src: url('./manrope-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #201d1a;
  --wood: #70543e;
  --muted: #756c64;
  --line: #ddd7d0;
  font-family: Manrope, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; }
::selection { background: #e8dfd5; color: var(--ink); }
[hidden] { display: none !important; }

.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 28px 56px 23px;
}

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.place, .site-status, .colophon, .replay {
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .035em;
  font-weight: 400;
}

.place { margin: 0; color: var(--muted); }
.place span { display: block; }
.place span + span { font-size: 10px; margin-top: 4px; }

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand__mark { width: 65px; height: 53px; }
.brand__name { margin: 0; font-weight: 400; }
.brand__name span { display: block; }
.brand__chalet { font: 400 9px/1.8 Manrope, sans-serif; letter-spacing: .28em; padding-left: 2px; }
.brand__demilune { font: 400 31px/1.12 Italiana, Georgia, serif; letter-spacing: -.025em; }

.site-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
}

.site-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border: 1px solid var(--wood);
  border-radius: 50%;
  background: linear-gradient(90deg, var(--wood) 50%, var(--paper) 50%);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 0 40px;
}

.portrait {
  position: relative;
  width: min(850px, 84vw, max(460px, calc((100svh - 530px) * 1.5)));
  margin: 0;
}

.portrait__drawing { display: block; width: 100%; height: auto; overflow: visible; }
.portrait__sketch { opacity: 0; }
.ink-stroke { stroke: var(--wood); stroke-dasharray: 1; stroke-dashoffset: 0; }
.ink-stroke--mountain { stroke: #a59789; }
.ink-stroke--garden { stroke: #806a54; }
.is-drawing .portrait__ink { animation: ink-settle 4.8s ease-in-out both; }
.is-drawing .portrait__sketch { animation: pencil-lifts 4.8s linear both; }
.is-drawing .ink-stroke {
  animation: ink-arrives var(--duration) cubic-bezier(.3, .1, .4, 1) var(--delay) both;
}

.portrait__caption {
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: 100%;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .065em;
}

.invitation { text-align: center; position: relative; padding: 39px 0 0; }
.invitation__phrase {
  margin: 0;
  font: 400 clamp(29px, 3.1vw, 45px)/1.18 Italiana, Georgia, serif;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.invitation__phrase span { display: block; }
.invitation__note {
  margin: 22px 0 0;
  font-size: 11px;
  line-height: 1.85;
  color: var(--muted);
}

.colophon {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 10px;
}

.colophon p { margin: 0; }
.colophon__signature { justify-self: end; text-align: right; }
.colophon__journal { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-underline-offset: 4px; }
.colophon__journal:hover { color: var(--wood); }
.colophon__journal:focus-visible { outline: 1px solid var(--wood); outline-offset: 3px; }
.colophon__line { width: 38px; height: 1px; background: var(--line); }
.colophon__mobile-place { display: none; }

.replay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px;
  margin: -12px 0 -12px -4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.replay svg { width: 14px; height: 14px; }
.replay:hover { color: var(--wood); }
.replay:focus-visible { outline: 1px solid var(--wood); outline-offset: 5px; }

@keyframes ink-arrives {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes ink-settle {
  0%, 34% { opacity: 0; }
  62% { opacity: .18; }
  84% { opacity: .75; }
  100% { opacity: 1; }
}

@keyframes pencil-lifts {
  0%, 55% { opacity: 1; }
  84% { opacity: .3; }
  100% { opacity: 0; }
}

@media (min-width: 1600px) {
  .page { padding: 36px 72px 28px; }
  .portrait { width: min(960px, max(460px, calc((100svh - 550px) * 1.5))); }
}

@media (max-width: 700px) {
  .page { padding: 24px 24px 22px; }
  .masthead { display: flex; justify-content: space-between; gap: 12px; }
  .place { display: none; }
  .brand { gap: 8px; }
  .brand__mark { width: 47px; height: 42px; }
  .brand__chalet { font-size: 8px; }
  .brand__demilune { font-size: 25px; }
  .site-status { font-size: 9px; gap: 7px; }
  .main { padding: 28px 0 42px; }
  .portrait { width: calc(100% + 36px); max-width: 600px; }
  .portrait__caption { font-size: 9px; bottom: -16px; }
  .invitation { padding-top: 48px; }
  .invitation__phrase { font-size: clamp(28px, 6.8vw, 40px); line-height: 1.22; }
  .invitation__note { margin-top: 22px; font-size: 10px; max-width: 260px; }
  .colophon { grid-template-columns: 1fr auto; gap: 18px; font-size: 9px; }
  .colophon__line, .colophon__desktop-place { display: none; }
  .colophon__mobile-place { display: block; }
  .replay { font-size: 9px; }
}

@media (max-width: 360px) {
  .page { padding-inline: 18px; }
  .brand__mark { width: 36px; }
  .brand__demilune { font-size: 23px; }
  .site-status { font-size: 8px; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .is-drawing .portrait__ink { animation: none; opacity: 1; }
  .is-drawing .portrait__sketch { animation: none; opacity: 0; }
  .is-drawing .ink-stroke { animation: none; stroke-dashoffset: 0; }
  .replay { display: none; }
}

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

/* Keep the invitation close to the drawing, without a second visual section. */
.main .newsletter--home {
  width: min(100%, 535px);
  margin: 25px auto 0;
  padding-top: 0;
  border-top: 0;
}
.newsletter--home .newsletter__intro { margin: 0 0 24px; max-width: none; text-align: center; font-size: 12px; }
.newsletter--home .newsletter__row { gap: 0; margin-bottom: 12px; }
.newsletter--home .newsletter__choice { font-size: 11px; line-height: 1.65; }
.newsletter--home .newsletter__privacy { margin-top: 10px; font-size: 10px; }
.newsletter--home .newsletter__status:empty { min-height: 0; margin: 0; }

@media (max-width: 700px) {
  .main { padding-top: 35px; }
  .main .newsletter--home { margin-top: 24px; }
  .newsletter--home .newsletter__intro { max-width: 30ch; margin: 0 auto 24px; }
  .newsletter--home .newsletter__row { gap: 8px; }
}
