:root {
  --forest: #0e3025;
  --forest-deep: #0a251c;
  --cream: #f4f1e8;
  --soft: #c9d3c8;
  --faint: #9fb2a7;
  --lime: #def46a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--forest);
  color: var(--cream);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p, h1 { margin: 0; }

.page {
  display: grid;
  grid-template-columns: minmax(min(380px, 100%), 44fr) 56fr;
  min-height: 100vh;
  min-height: 100svh;
}

/* Text panel */
.panel {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  padding: clamp(1.5rem, 5vw, 4.5rem);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(222, 244, 106, 0.07), transparent 60%),
    linear-gradient(180deg, var(--forest) 0%, var(--forest-deep) 100%);
}

.mark {
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
}
.mark circle { fill: none; stroke: rgba(244, 241, 232, 0.45); stroke-width: 1.5; }
.mark .leaf { fill: var(--lime); }
.mark .rib { fill: none; stroke: var(--forest); stroke-width: 1.6; stroke-linecap: round; }

.copy { min-width: 0; max-width: 34rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 0.45rem 0.9rem 0.45rem 0.75rem;
  border: 1px solid rgba(244, 241, 232, 0.22);
  border-radius: 999px;
  color: var(--soft);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dot {
  flex: none;
  position: relative;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--lime);
}
.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--lime);
  opacity: 0;
  animation: pulse 2.4s ease-out 2;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.55; }
  80%, 100% { transform: scale(3); opacity: 0; }
}

h1 {
  margin-top: 1.75rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(min(3.25rem, 7.5vw), 6.4vw, 6.25rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--cream);
  text-wrap: balance;
  overflow-wrap: break-word;
}

.what {
  margin-top: 1.1rem;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.9vw, 1.6rem);
  font-style: italic;
  color: var(--lime);
}

.note {
  max-width: 30rem;
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(244, 241, 232, 0.16);
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  color: var(--soft);
  text-wrap: pretty;
}

.foot {
  font-size: 0.8125rem;
  color: var(--faint);
}

/* Photo */
.photo {
  position: relative;
  overflow: hidden;
  background: #2f4a2a;
}
.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
}
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 37, 28, 0.35) 0%, rgba(10, 37, 28, 0) 18%);
  pointer-events: none;
}

/* Short desktop and laptop windows */
@media (min-width: 900px) and (max-height: 760px) {
  .panel { padding-block: 2rem; gap: 1.5rem; }
  h1 { margin-top: 1.25rem; font-size: clamp(min(3rem, 7vw), 5.2vw, 4.75rem); }
  .note { margin-top: 1.25rem; padding-top: 1.25rem; }
}

/* Phone and narrow tablet */
@media (max-width: 899px) {
  .page {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(210px, 38svh) auto;
  }
  .photo { order: -1; min-height: 210px; }
  .photo img { object-position: 58% 60%; }
  .photo::after {
    background: linear-gradient(180deg, rgba(10, 37, 28, 0) 60%, rgba(10, 37, 28, 0.45) 100%);
  }
  .panel {
    margin-top: -1.5rem;
    border-radius: 1.5rem 1.5rem 0 0;
    gap: 1.75rem;
    padding: 1.75rem min(1.5rem, 6.4vw) calc(1.5rem + env(safe-area-inset-bottom));
    padding-left: calc(min(1.5rem, 6.4vw) + env(safe-area-inset-left));
    padding-right: calc(min(1.5rem, 6.4vw) + env(safe-area-inset-right));
  }
  .panel { justify-content: flex-start; }
  .foot { margin-top: auto; }
  .mark { width: 2.25rem; height: 2.25rem; }
  h1 { margin-top: 1.25rem; font-size: clamp(min(2.6rem, 13vw), 11.5vw, 4rem); }
  .what { margin-top: 0.75rem; }
  .note { margin-top: 1.25rem; padding-top: 1.25rem; }
}

@media (min-width: 600px) and (max-width: 899px) {
  .page { grid-template-rows: minmax(260px, 46svh) auto; }
}

@media (max-width: 899px) and (max-height: 600px) {
  .page { grid-template-rows: minmax(min(150px, 28svh), 28svh) auto; }
  .photo { min-height: min(150px, 28svh); }
}

/* Phone turned sideways and other short screens: side by side again */
@media (min-width: 560px) and (max-height: 520px) and (orientation: landscape) {
  .page {
    grid-template-columns: minmax(320px, 54fr) 46fr;
    grid-template-rows: none;
  }
  .photo { order: 0; min-height: 0; }
  .photo img { object-position: 62% 50%; }
  .photo::after {
    background: linear-gradient(90deg, rgba(10, 37, 28, 0.35) 0%, rgba(10, 37, 28, 0) 18%);
  }
  .panel {
    margin-top: 0;
    border-radius: 0;
    justify-content: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  }
  .mark { display: none; }
  .status { padding-top: 0.35rem; padding-bottom: 0.35rem; }
  h1 { margin-top: 0.9rem; font-size: clamp(min(2.25rem, 6.5vw), 6.5vw, 3rem); }
  .what { margin-top: 0.5rem; font-size: 1.15rem; }
  .note { margin-top: 0.9rem; padding-top: 0.9rem; font-size: 0.95rem; }
  .foot { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dot::after { animation: none; opacity: 0; }
}

/* 404 page */
.back {
  display: inline-block;
  margin-top: 1.75rem;
  color: var(--lime);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.back:hover { color: var(--cream); }
.back:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
  border-radius: 2px;
}
