/* 柯西的线团 — 第三版视觉稿。配色与字体为提案，不锁死。 */

:root {
  --ink: #07080B;
  --ink-edge: #050506;
  --ink-warm: #1A140E;
  --parchment: #E8E4DB;
  --muted: #A39E94;
  --faint: #6F6B63;
  --thread-shadow: #8A6A42;
  --thread-mid: #C4A574;
  --thread-highlight: #E8D3A8;
  --serif: "Noto Serif CJK SC", "Noto Serif SC", "Noto Serif", serif;
  --sans: "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  --ease-weight: cubic-bezier(0.55, 0.04, 0.2, 1);
  --type-o: 1;
  --type-y: 0px;
  --sx: 1;
  --sy: 1;
}

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

html, body {
  background: var(--ink);
  color: var(--parchment);
  height: 100%;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ---------- Stage: centered warm hollow, edge vignette, grain ---------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    /* Warm hollow centered on the tangle (design: 720, 400 → 50% 44.4%). */
    radial-gradient(ellipse 68% 72% at 50% 44.4%,
      #1C1510 0%,
      rgba(26, 20, 14, 0.70) 26%,
      rgba(16, 13, 10, 0.26) 50%,
      transparent 70%),
    radial-gradient(ellipse 125% 118% at 50% 44%,
      #08090C 0%,
      var(--ink) 42%,
      var(--ink-edge) 100%);
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.088;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-repeat: repeat;
  background-size: 120px 120px;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(3, 3, 4, 0.72) 0%,
      transparent 16%,
      transparent 84%,
      rgba(3, 3, 4, 0.80) 100%),
    linear-gradient(90deg,
      rgba(3, 3, 4, 0.42) 0%,
      transparent 18%,
      transparent 82%,
      rgba(3, 3, 4, 0.42) 100%),
    radial-gradient(ellipse 78% 70% at 50% 44%,
      transparent 46%,
      rgba(3, 3, 4, 0.38) 78%,
      rgba(2, 2, 3, 0.68) 100%);
}

/* Local dusk behind the lower-left type pocket — not a full-height left slab. */
.type-veil {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  left: 0;
  top: calc(430px * var(--sy));
  width: calc(560px * var(--sx));
  height: calc(500px * var(--sy));
  background: radial-gradient(ellipse 78% 70% at 28% 42%,
    rgba(5, 5, 6, 0.86) 0%,
    rgba(7, 8, 11, 0.62) 38%,
    rgba(7, 8, 11, 0.22) 66%,
    transparent 82%);
}

/* ---------- Type in the field ---------- */

.type-pocket,
.entries {
  position: absolute;
  z-index: 2;
  opacity: var(--type-o);
  will-change: opacity, transform;
}

.type-pocket {
  left: calc(92px * var(--sx));
  top: calc(548px * var(--sy));
  width: calc(430px * var(--sx));
  transform: translateY(var(--type-y));
  pointer-events: none;
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: calc(64px * var(--sx));
  line-height: 1.12;
  letter-spacing: 0.04em;
  color: var(--parchment);
  margin-bottom: calc(20px * var(--sy));
}

.lede {
  font-size: calc(15px * var(--sx));
  line-height: 1.9;
  color: var(--muted);
  max-width: 28em;
}

.lede + .lede {
  margin-top: 0.85em;
}

/* ---------- Entry terminals (not a list, not a top nav) ---------- */

.entries {
  inset: 0;
  pointer-events: none;
}

.entry {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: calc(3px * var(--sy));
  pointer-events: auto;
  cursor: pointer;
  padding: calc(8px * var(--sy)) calc(10px * var(--sx));
  color: var(--parchment);
  transition: color 0.6s var(--ease-weight);
}

.entry--east {
  align-items: flex-start;
  text-align: left;
  transform: translate(0, -50%) translateY(var(--type-y));
}

.entry--west {
  align-items: flex-end;
  text-align: right;
  transform: translate(-100%, -50%) translateY(var(--type-y));
}

.entry--north {
  align-items: center;
  text-align: center;
  transform: translate(-50%, -100%) translateY(var(--type-y));
}

.entry--south {
  align-items: center;
  text-align: center;
  transform: translate(-50%, 0) translateY(var(--type-y));
}

.entry--interest .name {
  font-size: calc(16px * var(--sx));
  letter-spacing: 0.06em;
  color: var(--muted);
}

.entry .name {
  font-family: var(--serif);
  font-size: calc(20px * var(--sx));
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: var(--parchment);
  transition: color 0.6s var(--ease-weight);
}

.entry .hint {
  font-family: var(--sans);
  font-size: calc(12px * var(--sx));
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: var(--faint);
  transition: color 0.6s var(--ease-weight);
}

.entry:hover .name,
.entry.is-hover .name {
  color: var(--thread-highlight);
}

.entry:hover .hint,
.entry.is-hover .hint {
  color: var(--thread-mid);
}

.entry:focus {
  outline: none;
}

.entry:focus-visible .name {
  color: var(--thread-highlight);
}

@media (prefers-reduced-motion: reduce) {
  .type-pocket,
  .entries,
  .entry--east,
  .entry--west,
  .entry--north,
  .entry--south {
    transition: none;
  }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .type-pocket { width: min(430px, calc(100% - 48px)); }
}

/* ---------- Inner pages: same world, type along the thread ---------- */

.home-name {
  position: absolute;
  z-index: 4;
  font-family: var(--serif);
  font-weight: 400;
  font-size: calc(18px * var(--sx));
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--muted);
  text-decoration: none;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  padding: calc(8px * var(--sy)) calc(4px * var(--sx));
  transition: color 0.6s var(--ease-weight);
}
.home-name.is-shown {
  pointer-events: auto;
  opacity: var(--arrive, 1);
  visibility: visible;
}
.home-name:hover,
.home-name:focus-visible {
  color: var(--thread-highlight);
  outline: none;
}

.thread-back {
  position: absolute;
  z-index: 3;
  border: 0;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  cursor: pointer;
  padding: 0;
}
.thread-back.is-shown {
  pointer-events: auto;
  opacity: 0;
}

.pages {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.page {
  position: absolute;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
}
.page.is-active {
  visibility: visible;
}

.page-title,
.slot {
  position: absolute;
  --arrive: 0;
  --along-x: 0px;
  --along-y: 0px;
  opacity: var(--arrive);
  transform: translate(var(--along-x), var(--along-y));
  pointer-events: none;
}

.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: calc(36px * var(--sx));
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: var(--parchment);
  margin: 0;
  white-space: nowrap;
}
.page-title--west { transform: translate(-100%, -50%) translate(var(--along-x), var(--along-y)); }
.page-title--east { transform: translate(0, -50%) translate(var(--along-x), var(--along-y)); }
.page-title--north { transform: translate(-50%, -100%) translate(var(--along-x), var(--along-y)); }
.page-title--south { transform: translate(-50%, 0) translate(var(--along-x), var(--along-y)); }

.page--open .page-title { font-size: calc(40px * var(--sx)); }
.page--works .page-title,
.page--read .page-title,
.page--contact .page-title { font-size: calc(34px * var(--sx)); }
.page--ride .page-title,
.page--moto .page-title,
.page--travel .page-title,
.page--reading .page-title,
.page--fitness .page-title,
.page--island .page-title {
  font-size: calc(28px * var(--sx));
  color: var(--parchment);
}

/* Reserved places held by threads — not grey template boxes. */
.slot--intro,
.slot--stage {
  pointer-events: none;
  /* empty typographic field, no border, no fill */
}
.slot--work {
  pointer-events: auto;
  cursor: default;
  /* a reserved spatial quiet, held by a thread tip */
}
.slot--line {
  pointer-events: none;
  /* empty reading measure along the silk */
  border-bottom: 0;
}
.slot--contact {
  pointer-events: none;
}

.contact-line {
  font-family: var(--sans);
  font-size: calc(16px * var(--sx));
  letter-spacing: 0.08em;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}

body[data-view="page"] .type-veil {
  opacity: 0;
}
body[data-view="travel"] .type-veil,
body[data-view="page"] .type-pocket {
  /* pocket leaves with the camera; veil stays a home-stage dusk */
}

@media (prefers-reduced-motion: reduce) {
  .page-title,
  .slot,
  .home-name {
    transition: none;
  }
}

/* Reserved typographic places: soft ink blush, no card boxes, no invented copy. */
.slot--intro,
.slot--stage,
.slot--work,
.slot--line {
  overflow: visible;
}
.slot--intro::before,
.slot--stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 40% 32% 45% 28%;
  background: radial-gradient(ellipse at 30% 20%, rgba(184, 154, 110, 0.07), rgba(120, 90, 58, 0.03) 42%, transparent 74%);
}
.slot--work::before {
  content: "";
  position: absolute;
  left: 0;
  right: 6%;
  top: 0;
  bottom: 8%;
  pointer-events: none;
  border-radius: 34% 42% 30% 38%;
  background: radial-gradient(ellipse at 42% 68%, rgba(196, 165, 116, 0.24), rgba(160, 124, 80, 0.13) 36%, rgba(90, 66, 40, 0.055) 66%, transparent 86%);
}
.page--works .slot--work:nth-of-type(1)::before { border-radius: 36% 28% 40% 32%; }
.page--works .slot--work:nth-of-type(2)::before { border-radius: 28% 40% 32% 44%; }
.page--works .slot--work:nth-of-type(3)::before { border-radius: 42% 30% 34% 28%; }
.page--works .slot--work:nth-of-type(4)::before { border-radius: 30% 38% 28% 40%; }
.page--works .slot--work:nth-of-type(5)::before { border-radius: 40% 28% 36% 32%; }
.page--works .slot--work:nth-of-type(6)::before { border-radius: 32% 44% 28% 38%; }
.slot--line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 8%;
  top: 18%;
  height: 1.05em;
  pointer-events: none;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(198, 168, 120, 0.07), rgba(198, 168, 120, 0.04) 68%, transparent);
}


/* ---------- Filled typographic content (same world, no cards) ---------- */

.slot--intro {
  pointer-events: none;
  padding: calc(36px * var(--sy)) calc(8px * var(--sx)) 0 0;
}

.slot--intro .copy,
.reading-field .copy {
  font-family: var(--sans);
  font-size: calc(15px * var(--sx));
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0 0 1.15em;
  max-width: 36em;
}

.slot--intro .copy:last-child,
.reading-field .copy:last-child {
  margin-bottom: 0;
}

.slot--work {
  padding: calc(16px * var(--sy)) calc(18px * var(--sx)) calc(36px * var(--sy)) calc(8px * var(--sx));
}

.slot--work.is-filled {
  cursor: default;
}

.work-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: calc(18px * var(--sx));
  letter-spacing: 0.06em;
  line-height: 1.35;
  color: var(--parchment);
  margin: 0 0 0.45em;
}

.work-body {
  font-family: var(--sans);
  font-size: calc(13px * var(--sx));
  line-height: 1.75;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0;
}

.work-link,
.work-note {
  display: inline-block;
  margin: 0.65em 0 0;
  font-family: var(--sans);
  font-size: calc(12px * var(--sx));
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: var(--muted);
}

.work-link {
  color: var(--parchment);
  text-decoration: underline;
  text-underline-offset: 0.28em;
  text-decoration-thickness: 1px;
  pointer-events: auto;
}

.work-link:hover,
.work-link:focus-visible {
  color: var(--parchment);
  opacity: 0.82;
}

.work-note {
  margin-top: 0.55em;
}

.slot--line {
  display: flex;
  align-items: flex-end;
  padding: 0 calc(8px * var(--sx)) calc(6px * var(--sy)) 0;
}

.slot--line.is-filled {
  pointer-events: auto;
}

.article-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: calc(18px * var(--sx));
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--parchment);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  transition: color 0.6s var(--ease-weight);
}

.article-name:hover,
.article-name:focus-visible,
.article-name.is-current {
  color: var(--thread-highlight);
  outline: none;
}

.reading-field {
  position: absolute;
  --arrive: 0;
  --along-x: 0px;
  --along-y: 0px;
  opacity: var(--arrive);
  transform: translate(var(--along-x), var(--along-y));
  pointer-events: none;
  overflow: hidden;
}

.reading-field.is-open {
  pointer-events: auto;
  overflow-y: auto;
}

.reading-field .article-heading {
  font-family: var(--serif);
  font-weight: 400;
  font-size: calc(28px * var(--sx));
  letter-spacing: 0.08em;
  line-height: 1.25;
  color: var(--parchment);
  margin: 0 0 0.9em;
}

.slot--contact {
  pointer-events: none;
  padding: calc(8px * var(--sy)) 0 0 0;
}

.contact-line {
  font-family: var(--sans);
  font-size: calc(16px * var(--sx));
  letter-spacing: 0.08em;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}

.contact-mail {
  display: inline-block;
  pointer-events: auto;
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 400;
  font-size: calc(20px * var(--sx));
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--parchment);
  margin-top: 0.55em;
  transition: color 0.6s var(--ease-weight);
}

.contact-mail:hover,
.contact-mail:focus-visible {
  color: var(--thread-highlight);
  outline: none;
}

/* Quiet scrollbar for the article column; does not look like a panel. */
.reading-field.is-open::-webkit-scrollbar {
  width: 4px;
}
.reading-field.is-open::-webkit-scrollbar-thumb {
  background: rgba(196, 165, 116, 0.28);
  border-radius: 4px;
}
.reading-field.is-open::-webkit-scrollbar-track {
  background: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .article-name,
  .contact-mail,
  .reading-field {
    transition: none;
  }
}
