:root {
  color-scheme: dark;
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: #080808;
  color: #f2eee5;
  font-synthesis: none;
  --focus-row: 0;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; overflow: hidden; }
body { min-height: 100svh; background: #080808; }
button, a { font: inherit; }
button { color: inherit; }

.stage {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 48%, rgba(164,118,54,.14), transparent 36%),
    linear-gradient(135deg, #11100e 0%, #080808 48%, #050505 100%);
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .17;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.17'/%3E%3C/svg%3E");
}

#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.brand-center {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 51%;
  width: min(620px, 72vw);
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity .52s ease, filter .52s ease;
}

.brand-center h1,
.field-trigger span,
.field-menu-button {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  font-weight: 700;
}

.brand-center h1 {
  margin: 0;
  font-size: clamp(72px, 7vw, 112px);
  line-height: .95;
  letter-spacing: -.07em;
  text-shadow: 0 10px 40px rgba(0,0,0,.56);
}

.brand-center p {
  margin: 20px auto 0;
  color: rgba(242,238,229,.78);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .01em;
  text-shadow: 0 4px 18px rgba(0,0,0,.92);
}

.origin-fields {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  perspective: 900px;
  transition: opacity .5s ease;
}

.field-trigger {
  position: absolute;
  border: 0;
  padding: 10px 16px;
  background: transparent;
  color: rgba(255,255,255,.58);
  cursor: pointer;
  pointer-events: auto;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
  transition: color .25s ease, opacity .28s ease, filter .28s ease;
}

.field-trigger span {
  display: block;
  font-size: clamp(58px, 5.5vw, 92px);
  line-height: .9;
  letter-spacing: -.08em;
  text-shadow: 0 9px 28px rgba(0,0,0,.58);
}

.field-trigger:hover,
.field-trigger:focus-visible {
  color: #fff;
  filter: drop-shadow(0 0 22px rgba(225,194,137,.34));
  outline: none;
}

.field-trigger.is-selected {
  color: #fff;
  filter: drop-shadow(0 0 30px rgba(240,214,166,.52));
}

.field-trigger.is-dimmed {
  opacity: 0;
  filter: blur(8px);
}

.field-thought { left: 27%; top: 42%; }
.field-design { left: 61%; top: 26%; }
.field-martial { left: 46%; top: 65%; }

.focus-panel {
  position: absolute;
  z-index: 6;
  top: clamp(52px, 8vh, 92px);
  left: clamp(40px, 5.5vw, 96px);
  width: min(650px, 46vw);
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 30px;
  padding: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-30px);
  transition: opacity .48s ease, transform .68s cubic-bezier(.2,.75,.2,1);
}

.focus-controls { align-self: start; }

.focus-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 36px;
}

.field-menu-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(255,255,255,.31);
  font-size: clamp(52px, 4.7vw, 80px);
  line-height: .9;
  letter-spacing: -.08em;
  cursor: pointer;
  transition: color .25s ease, transform .25s ease;
}

.field-menu-button:hover,
.field-menu-button:focus-visible {
  color: rgba(255,255,255,.72);
  transform: translateX(5px);
  outline: none;
}

.field-menu-button.is-active { color: #fff; }

.origin-reset {
  margin-top: 34px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 10px 15px;
  background: rgba(8,8,8,.22);
  color: rgba(255,255,255,.68);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.origin-reset:hover,
.origin-reset:focus-visible {
  color: #fff;
  border-color: rgba(255,255,255,.5);
  background: rgba(8,8,8,.48);
  outline: none;
}

.focus-copy {
  position: relative;
  align-self: start;
  margin-top: calc(var(--focus-row) * 112px + 4px);
  min-height: 210px;
  padding: 4px 0 0 32px;
  transition: margin-top .55s cubic-bezier(.2,.75,.2,1);
}

.focus-line {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: rgba(255,255,255,.92);
  transform-origin: top;
}

.focus-label {
  margin: 0;
  color: #b9a680;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
}

.focus-description {
  margin: 24px 0 0;
  max-width: 23em;
  color: rgba(255,255,255,.78);
  font-size: 20px;
  line-height: 1.7;
}

.focus-copy a {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-top: 30px;
  padding-bottom: 6px;
  color: #efe7d7;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(239,231,215,.45);
}

.status {
  position: absolute;
  z-index: 4;
  right: clamp(20px, 3vw, 44px);
  bottom: 22px;
  margin: 0;
  color: rgba(255,255,255,.28);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.is-transitioning .brand-center {
  opacity: .45;
  filter: blur(1px);
}

body.is-focused .brand-center,
body.is-focused .origin-fields {
  opacity: 0;
  pointer-events: none;
}

body.is-focused .focus-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

@media (max-width: 980px) {
  .field-thought { left: 23%; }
  .field-design { left: 65%; }
  .focus-panel {
    width: min(60vw, 620px);
    grid-template-columns: 160px minmax(0, 1fr);
  }
  .focus-copy { margin-top: calc(var(--focus-row) * 101px + 4px); }
}

@media (max-width: 760px) {
  .brand-center { top: 42%; width: calc(100vw - 40px); }
  .brand-center h1 { font-size: clamp(58px, 18vw, 82px); }
  .brand-center p { font-size: 16px; max-width: 22em; }

  .origin-fields {
    display: flex;
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 64px;
    height: auto;
    justify-content: space-between;
    gap: 8px;
    perspective: none;
  }
  .field-trigger { position: static; flex: 1; padding: 8px 4px; text-align: center; }
  .field-trigger span { font-size: clamp(36px, 12vw, 52px); }

  .focus-panel {
    top: auto;
    left: 14px;
    right: 14px;
    bottom: 18px;
    width: auto;
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 18px;
  }
  .focus-menu { gap: 25px; }
  .field-menu-button { font-size: 40px; }
  .origin-reset { margin-top: 24px; padding: 8px 11px; font-size: 12px; }
  .focus-copy { margin-top: calc(var(--focus-row) * 61px + 4px); padding-left: 20px; min-height: 180px; }
  .focus-description { font-size: 16px; }
  .focus-copy a { font-size: 14px; }
  .status { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
