/* Star Seed ~ the lace layout: the art runs down the left, a bordered frame to its right */

:root {
  --ink: #141218;
  --sea: #2c7a76;   /* Michiru's hair, deepened so it reads as text */
  --soft: #6a6670;
  --gold: #b48a2c;  /* Haruka's earring */
  --paper: #ffffff; /* matches the scan's white exactly */
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Verdana, Tahoma, Geneva, sans-serif;
  font-size: 11px;
  overflow: hidden;
}

#stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  height: 100vh;
}

/* the whole picture, top to bottom of the window */
#art {
  display: block;
  height: 100vh;
  width: auto;
  margin-left: clamp(16px, 5vw, 96px);
}

#side {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  height: 100vh;
  padding: clamp(14px, 4vh, 40px) clamp(16px, 4vw, 64px) clamp(14px, 3.5vh, 34px) clamp(8px, 1.5vw, 24px);
}
#side > * { width: 100%; max-width: 600px; }

#sign { text-align: center; }
#sign h1 {
  margin: 0;
  font-family: "Pinyon Script", "Snell Roundhand", cursive;
  font-weight: 400;
  font-size: clamp(40px, 8vh, 76px);
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
}
#sign .sub {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(14px, 2vh, 18px);
  letter-spacing: 1px;
  color: var(--sea);
}

/* menu links as old-school buttons, drawn like the frame: ink double rule on white */
#menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 8px;
  margin: clamp(10px, 2vh, 18px) 0 clamp(14px, 2.4vh, 22px);
  line-height: 1;
}
#menu a {
  padding: 7px 12px 6px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}
#menu a:hover { color: var(--sea); border-color: var(--sea); outline-color: var(--sea); }
#menu a:active,
#menu a[aria-current="page"] { color: #fff; background: var(--ink); border-color: var(--ink); outline-color: var(--ink); }
#menu a:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }

/* the frame: a thin ink double rule, like the border of an artbook plate */
#panel {
  flex: 1 1 auto;
  min-height: 0;
  padding: 5px;
  border: 1px solid var(--ink);
}
#panel iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--ink);
  background: var(--paper);
}

/* sparkle trail (shared with frame.css) */
.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  font-size: 11px;
  color: var(--gold);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.95);
  animation: twinkle 0.8s ease-out forwards;
}
@keyframes twinkle {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(14px) scale(0.4); }
}

/* phones, and windows too narrow for the art plus a frame beside it:
   the two of them on top, then the title, menu, and frame below */
@media (max-width: 899px), (max-aspect-ratio: 11/10) {
  body { overflow: auto; }
  #stage { display: block; height: auto; }
  #art {
    margin-left: 0;
    width: 100%;
    height: min(78vh, 133vw);
    object-fit: cover;
    object-position: 50% 22%;
  }
  #side { height: auto; padding: 14px 16px 18px; }
  /* the title sits between thin double black rules that run edge to edge */
  #side { padding-top: 0; }
  #side > #sign {
    align-self: stretch;
    width: auto;
    max-width: none;
    margin: 0 -16px;
    padding: 10px 16px 12px;
    border-top: 3px double var(--ink);
    border-bottom: 3px double var(--ink);
  }
  #sign h1 { font-size: 52px; }
  #sign .sub { font-size: 15px; }

  #panel { flex: none; }
  #panel iframe { height: 72vh; }
}

/* desktop: the whole layout sits centered on the page inside a thin ink double rule,
   drawn like the menu buttons and the frame */
@media (min-width: 900px) and (min-aspect-ratio: 11/10) {
  body {
    display: grid;
    place-items: center;
    padding: clamp(18px, 3.5vh, 40px) clamp(18px, 3vw, 48px);
  }
  #stage {
    width: min(100%, 1320px);
    height: 100%;
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    border: 1px solid var(--ink);
    outline: 1px solid var(--ink);
    outline-offset: 4px;
  }
  #art { height: 100%; margin-left: 0; }
  /* the art meets the border on the top, left and bottom; only the frame side gets padding */
  #side { height: 100%; padding: clamp(16px, 3.5vh, 36px) clamp(20px, 3vw, 48px) clamp(14px, 3vh, 30px); }
}

@media (prefers-reduced-motion: reduce) { .sparkle { display: none; } }

/* under the frame: my own adopted sprite, and the scent */
#under {
  flex: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}
#under a { display: block; line-height: 0; }
#under img { display: block; image-rendering: pixelated; }
#under a:focus-visible { outline: 1px solid var(--sea); outline-offset: 3px; }
#under .scent {
  margin: 0 0 2px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--soft);
}
#under .scent b { font-weight: 600; color: var(--sea); }
