/* ==========================================================
   Cyber Town — home page test build
   Monochrome + flamingo. See cybertown-design-spec.md
   ========================================================== */

:root {
  --ink: #111111;
  --ink-soft: #333333;
  --flamingo: #D36B93;
  --flamingo-glow: #EF89B4;
  --flamingo-deep: #B04A70;
  --card-border: rgba(255, 255, 255, 0.85);
  --mist: #EDEBEA;

  /* Final frost values, settled on screen 2026-07-04 */
  --card-alpha: 0.24;
  --card-blur: 4px;
  --card-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Lato", "Open Sans", sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--mist);
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

/* Home splash: the titled artwork, kept centred so the lettering stays in view */
body.home {
  background-position: center center;
}

/* ---------- Soft page transitions ---------- */

/* Modern browsers: a gentle cross-fade between pages, no JavaScript. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 1.25s;
  animation-timing-function: ease;
}

/* Fallback for browsers without view transitions: fade each page in on load. */
@supports not (view-transition-name: none) {
  @keyframes page-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  body {
    animation: page-fade-in 1.25s ease both;
  }
}

/* Respect people who ask for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
  body { animation: none; }
}

/* ---------- Nav ---------- */

.site-nav {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  padding: 28px 44px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav a:hover { color: var(--flamingo); }

/* ---------- Notebook dropdown (home nav) ---------- */

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { content: " \25BE"; }

.nav-dropdown[open] summary { color: var(--flamingo); }

.nav-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 16px);
  min-width: 260px;
  list-style: none;
  padding: 16px 20px;
  background-color: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  text-align: right;
}

.nav-dropdown-menu li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(17, 17, 17, 0.10);
}

.nav-dropdown-menu li:last-child { border-bottom: none; }

.nav-dropdown-menu a {
  color: var(--flamingo-deep);
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  line-height: 1.4;
}

.nav-dropdown-menu a:hover { color: var(--flamingo); }

/* ---------- Page title ---------- */

.page-title {
  position: absolute;
  top: 24px;
  left: 44px;
  z-index: 5;
  color: var(--ink);
  font-weight: 400;
  line-height: 0.78;
  width: min-content;
  text-align: center;
  font-family: "Just Me Again Down Here", cursive;
  font-size: clamp(96px, 9.2vw, 144px);
}

.title-word { display: block; }

/* Post/About pages: title is a line of text, not the stacked logo.
   max-width tracks the card's left edge so long titles wrap in the
   upper-left sky and never run under the card. */
.page-title--post {
  width: auto;
  max-width: calc(48vw - 300px);
  text-align: left;
  line-height: 0.9;
  font-size: clamp(34px, 3.4vw, 56px);
}

/* INK sits 50% larger, on a gentle rise (65deg from vertical) */
.title-ink {
  font-size: 1.5em;
  transform: rotate(-25deg);
  transform-origin: center;
  margin-top: 0.06em;
}

/* ---------- Right-hand composition: card + topic rail ---------- */

.page {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 28px;
  padding: 0 36px 80px 0;
  min-height: 100vh;
}

.card {
  width: 51vw;
  min-width: 500px;
  max-width: 800px;
  margin-top: 0;
  padding: 84px 48px 48px;
  background-color: rgba(255, 255, 255, var(--card-alpha));
  -webkit-backdrop-filter: blur(var(--card-blur));
  backdrop-filter: blur(var(--card-blur));
  border: 1px solid var(--card-border);
  border-top: none;
  border-radius: 0 0 3px 3px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.card h2 {
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--flamingo);
  text-shadow: 0 0 18px var(--flamingo-glow);
  margin-bottom: 20px;
}

.card p {
  max-width: 65ch;
  margin-bottom: 20px;
  color: var(--ink);
}

/* ---------- Right rail: recent posts + topics ---------- */

.rail {
  width: 165px;
  flex-shrink: 0;
  margin-top: 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.rail-heading {
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.rail-posts {
  list-style: none;
  margin-bottom: 44px;
}

.rail-posts li { margin-bottom: 16px; }

.rail-posts a {
  color: var(--flamingo-deep);
  text-decoration: none;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.45;
  display: inline-block;
}

.rail-posts a:hover { color: var(--flamingo); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  body { background-attachment: scroll; background-position: center; }

  /* Home splash: the title is baked into a wide image, so show the whole
     artwork on narrow screens instead of cropping the lettering off. */
  body.home {
    background-size: contain;
    background-position: center center;
    background-color: #cbc8c5;
  }

  .page-title {
    position: static;
    padding: 84px 24px 12px;
    width: auto;
    margin: 0 auto;
    font-size: 76px;
  }

  .page {
    flex-direction: column;
    align-items: stretch;
    padding: 0 20px 60px;
    gap: 20px;
  }

  .card {
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 36px 28px;
    border-top: 1px solid var(--card-border);
    border-radius: 3px;
  }

  .rail {
    width: 100%;
    margin-top: 0;
    align-items: flex-start;
    text-align: left;
  }

  .rail-posts { margin-bottom: 32px; }

  .site-nav { padding: 20px 24px; }
}
