/* Same system as story.css, videos.css and contact.css: centered column, Fraunces headings, serif body, light and dark themes. */
:root {
  --bg: #f6f4f1;
  --fg: #1d1b19;
  --muted: #5e5852;
  --line: #d9d3cb;
  --accent: #8f2d2d;
  --panel: #2b2723;
  --display: "Fraunces", Georgia, serif;
  --body: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161412;
    --fg: #ece7e1;
    --muted: #a39b92;
    --line: #38332e;
    --accent: #e08a84;
    --panel: #0f0d0c;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #161412;
  --fg: #ece7e1;
  --muted: #a39b92;
  --line: #38332e;
  --accent: #e08a84;
  --panel: #0f0d0c;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.65;
}

.page {
  max-width: 64rem;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  text-align: center;
}

.page > * { min-width: 0; max-width: 100%; }

h1, h2 {
  margin: 0;
  font-family: var(--display);
  line-height: 1.15;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }

a { color: var(--fg); }
a:focus-visible,
button:focus-visible,
.scroller:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}

#qrcode { display: flex; justify-content: center; }
#qrcode img,
#qrcode canvas { max-width: 100%; }

/* Link to the stories page (was a bordered h2) */
.story-link {
  display: block;
  width: min(100%, 36rem);
  padding: 0.8rem 1rem;
  border: 2px solid var(--fg);
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  font-weight: 600;
  text-decoration: none;
}

.story-link:hover { color: var(--accent); border-color: var(--accent); }

/* "My picture!" (the old marquees, now CSS animations) */
.picture {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.picture img { max-width: 100%; height: auto; }

.slide-right {
  position: relative;
  width: 100%;
  height: 2.4rem;
  overflow: hidden;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  font-weight: 600;
}

.slide-right span {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  transform: translateX(-100%);
  animation: slide-right 8s linear infinite;
}

@keyframes slide-right {
  from { left: 0;    transform: translateX(-100%); }
  to   { left: 100%; transform: translateX(0); }
}

.drop {
  position: relative;
  width: 100%;
  height: 16rem;
  overflow: hidden;
}

.drop img {
  position: absolute;
  top: 0;
  left: 50%;
  max-height: 100%;
  width: auto;
  transform: translate(-50%, -100%);
  animation: drop 6s linear infinite;
}

@keyframes drop {
  from { transform: translate(-50%, -100%); }
  to   { transform: translate(-50%, 16rem); }
}

/* Image buttons */
.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
}

.buttons img { display: block; max-width: 100%; height: auto; }

.cv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.cv-btn {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.cv-btn[aria-pressed="true"] img { opacity: 0.7; }

/* Was: .myDIV:hover + .hide { display:block; color:red } */
.cv-hint {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.cv:hover .cv-hint,
.cv:focus-within .cv-hint { opacity: 1; }

/* Footer popup (was .popup / .popuptext) */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.popup-toggle {
  padding: 0.4rem 0.9rem;
  border: 0;
  background: none;
  color: var(--accent);
  font-family: var(--display);
  font-size: 1.1rem;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.popup-toggle:hover { text-decoration: underline; }

.popup-text {
  margin: 0;
  padding: 0.6rem 1.2rem;
  background: var(--panel);
  color: #fff;
  border-radius: 6px;
  animation: fade-in 1s;
}

.popup-text[hidden] { display: none; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Real estate listing */
.listing {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.listing h2 { color: var(--accent); }

.scroller {
  display: flex;
  gap: 10px;
  padding: 10px;
  overflow-x: auto;
  background: var(--panel);
}

.scroller img {
  flex: none;
  height: 325px;
  width: auto;
  max-width: none;
}

@media (prefers-reduced-motion: reduce) {
  .slide-right span,
  .drop img,
  .popup-text { animation: none; }

  .slide-right { height: auto; }
  .slide-right span { position: static; transform: none; white-space: normal; }
  .drop { height: auto; }
  .drop img { position: static; transform: none; }
  .cv-hint { transition: none; }
}

@media print {
  .noprint { display: none; }
}
