/* Fallen Flags – shared styles for every page of this site.
   Linked as style.css?v=N : raise N in every page when this file changes,
   so visitors do not keep seeing old styles. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid #0d8f79; outline-offset: 3px; }

/* ───────────────────────── Front page ───────────────────────── */
.home {
  --pink: #f27481;
  --gray: #3b3b3b;
  --gold: #deab02;
  --teal: #0d8f79;
  --pale: #ffe75e;
  --ink: #2a1a1c;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vh, 40px) clamp(16px, 4vw, 64px);
  background-color: var(--pink);
  color: var(--ink);
  font-family: "Times New Roman", Times, Georgia, serif;
}
.hero {
  width: 100%;
  max-width: 1320px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, clamp(320px, 30vw, 440px));
  align-items: center;
  gap: clamp(24px, 5vw, 88px);
}
.box {
  position: relative;
  display: block;
  justify-self: center;
  width: min(100%, calc((100vh - 96px) * 677 / 600));
  max-width: 780px;
  aspect-ratio: 677 / 600;
}
/* the two pictures take turns: they swap every 3 seconds, with a 0.3 second cross-fade */
.box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 14px rgba(70, 14, 22, .4));
  animation: box-turn 6s ease-in-out infinite;
}
.box .second { opacity: 0; animation-name: box-turn-second; }
@keyframes box-turn {
  0%, 45% { opacity: 1; }
  50%, 95% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes box-turn-second {
  0%, 45% { opacity: 0; }
  50%, 95% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .box img { animation-timing-function: step-end; }
}
.panel { text-align: center; }
.home h1 {
  margin: 0;
  font-size: clamp(28px, 2.9vw, 44px);
  line-height: 1.05;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.rule {
  width: 72%;
  height: 0;
  margin: clamp(10px, 1.6vh, 16px) auto;
  border: 0;
  border-top: 3px double var(--gray);
}
.tag {
  margin: 0 auto;
  max-width: 34em;
  font-size: clamp(15px, 1.15vw, 17.5px);
  line-height: 1.45;
  font-weight: bold;
}
.links {
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 1.25vh, 12px);
  margin-top: clamp(14px, 2.4vh, 24px);
}
.links a {
  display: block;
  padding: clamp(8px, 1.35vh, 12px) 16px;
  border: 2px solid var(--gray);
  border-radius: 6px;
  background: var(--gray);
  color: var(--gold);
  font-size: clamp(16px, 1.45vw, 21px);
  font-weight: bold;
  letter-spacing: .05em;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(40, 10, 14, .4);
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.links a:hover { background: var(--teal); border-color: var(--teal); color: var(--pale); transform: translateY(-1px); }
.links a:active { transform: translateY(2px); box-shadow: none; }
.links a.play { font-size: clamp(18px, 1.7vw, 24px); }
.links a.unavailable {
  background: rgba(59, 59, 59, .12);
  border-style: dashed;
  color: var(--ink);
  box-shadow: none;
}
.links a.unavailable:hover { background: var(--teal); border-color: var(--teal); border-style: solid; color: var(--pale); }
.links .pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(7px, 1.25vh, 12px); }

@media (max-width: 860px), (orientation: portrait) and (max-width: 1000px) {
  .home { align-items: flex-start; }
  .hero { grid-template-columns: 1fr; gap: 12px; max-width: 520px; }
  .box { width: min(100%, 420px); }
}
@media (max-width: 420px) { .links .pair { grid-template-columns: 1fr; } }

/* ─────────────── Notebook page (designer's notes) ───────────────
   Same paper as Merchant Adventurer: white ruled sheet, Courier bold,
   one red margin line, one continuous sheet that reflows. */
.paper-page {
  --paper: #fff;
  --rule: #9fb4ee;
  --ink: #111;
  --link: #1433c9;
  --lh: 25px;
  --fs: 20px;
  --margin: 100px;
  --gap: 10px;
  --wide: 900px;
  padding: 20px 12px 40px;
  min-height: 100vh;
  color: var(--ink);
}
.paper {
  position: relative;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 40px 0;
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 12px 28px rgba(0, 0, 0, .22);
}
.paper::before {               /* red margin line */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--margin);
  width: 2px;
  background: rgba(255, 0, 0, .6);
}
.sheet {
  padding: 0 16px 0 calc(var(--margin) + var(--gap));
  font: bold var(--fs) / var(--lh) "Courier New", Courier, monospace;
  background-image: repeating-linear-gradient(to bottom,
    transparent 0, transparent calc(var(--lh) - 1px),
    var(--rule) calc(var(--lh) - 1px), var(--rule) var(--lh));
  overflow-wrap: break-word;
}
.sheet h1, .sheet h2, .sheet h3, .sheet p, .sheet nav {
  margin: 0;
  padding: 0;
  font: inherit;
}
.sheet h1 { display: inline; font-style: italic; }
.sheet a { color: var(--link); text-decoration: none; }
.sheet a:hover, .sheet a:focus-visible { text-decoration: underline; text-decoration-thickness: 2px; }
.sheet .gap { margin-top: var(--lh); }

/* the page's own original green and grey striped background (do not simplify it) */
.notes {
  background: repeating-linear-gradient(
		90deg,
		#27521B,
		#27521B,
		#27800D,
		#56800D,
		#727272,
		#515151,
		#515151,
		#515151,
		#515151,
		#727272,
		#56800D,
		#27800D,
		#27800D,
		#27800D,
		#27800D,
		#27800D,
		#56800D,
		#727272,
		#515151,
		#515151,
		#515151,
		#515151,
		#727272,
		#56800D,
		#27800D,
		#27521B,
		#27521B
	    ) no-repeat center center fixed;
}

@media (max-width: 760px) {
  .paper-page { --lh: 22px; --fs: 15px; --margin: 34px; --gap: 8px; padding: 8px 6px 24px; }
  .sheet { padding-right: 10px; }
}
@media print {
  .paper-page { background: none; padding: 0; }
  .paper { box-shadow: none; }
}
