:root {
  --bg: #0B0B0C;
  --panel: #111111;
  --panel-soft: #161616;
  --text: #E8E1D6;
  --sub: #9A9188;
  --muted: #6F6860;
  --ember: #C46A32;
  --ember-dark: #7A351C;
  --ember-light: #F1B36A;
  --line: rgba(232, 225, 214, 0.14);
  --input: rgba(255, 255, 255, 0.035);
  --shadow: rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 45%, rgba(44, 37, 31, 0.19) 0%, rgba(18, 16, 15, 0.11) 26%, rgba(11, 11, 12, 0) 58%),
    radial-gradient(ellipse at 50% 108%, rgba(122, 53, 28, 0.055) 0%, rgba(11, 11, 12, 0) 44%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.38) 0%, rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0) 82%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(180deg, rgba(22, 22, 22, 0.58) 0%, rgba(11, 11, 12, 0.86) 64%, rgba(7, 7, 8, 1) 100%),
    var(--bg);
  font-family: "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1.9;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(232, 225, 214, 0.018), transparent 34%),
    linear-gradient(245deg, rgba(122, 53, 28, 0.035), transparent 38%);
  opacity: 0.75;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(232, 225, 214, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 225, 214, 0.01) 1px, transparent 1px);
  background-position: 18px 32px, -24px 8px;
  background-size: 148px 148px, 214px 214px;
  mask-image:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.18) 64%, transparent 88%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 76%);
}

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

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

::selection {
  color: #0B0B0C;
  background: var(--ember-light);
}

.night-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-160%);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  color: var(--text);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 22px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid rgba(232, 225, 214, 0.055);
  background: rgba(11, 11, 12, 0.78);
  backdrop-filter: blur(12px);
}

.brand {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 2.2vw, 28px);
  color: var(--sub);
  font-size: 0.82rem;
  white-space: nowrap;
}

.site-nav a {
  border-bottom: 1px solid transparent;
  transition: color 220ms ease, border-color 220ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-color: rgba(196, 106, 50, 0.48);
}

.site-main {
  min-height: calc(100vh - 158px);
}

.top-hero,
.tool-page,
.space-page,
.about-page {
  display: grid;
  align-items: center;
  min-height: 72vh;
  padding: clamp(64px, 10vw, 130px) clamp(20px, 5vw, 72px);
}

.top-hero {
  min-height: 76vh;
}

.top-hero__inner,
.section-inner {
  width: min(100%, 920px);
  margin: 0 auto;
}

.top-hero__inner {
  text-align: center;
}

.section-inner--narrow {
  width: min(100%, 720px);
}

.section-inner--tool {
  width: min(100%, 700px);
}

.section-inner--text {
  width: min(100%, 760px);
}

.quiet-label {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  line-height: 1.6;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  color: var(--text);
  font-size: clamp(2.35rem, 8vw, 5.9rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.05;
}

.tool-page h1,
.space-page h1,
.about-page h1 {
  font-size: clamp(2rem, 5.6vw, 4.2rem);
  letter-spacing: 0;
  line-height: 1.35;
}

h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
}

.lead-copy {
  max-width: 520px;
  margin: 0 auto 34px;
  color: var(--sub);
  font-size: clamp(1.05rem, 2.6vw, 1.38rem);
}

.page-copy {
  margin-bottom: 34px;
  color: var(--sub);
  font-size: clamp(1rem, 2vw, 1.12rem);
}

.primary-link,
.quiet-form button,
.form-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(196, 106, 50, 0.46);
  border-radius: 3px;
  background: rgba(196, 106, 50, 0.08);
  color: var(--text);
  box-shadow: 0 0 0 0 rgba(241, 179, 106, 0);
  transition: border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

.primary-link:hover,
.primary-link:focus-visible,
.quiet-form button:hover,
.quiet-form button:focus-visible,
.form-row button:hover,
.form-row button:focus-visible {
  border-color: rgba(241, 179, 106, 0.66);
  background: rgba(196, 106, 50, 0.13);
  box-shadow: 0 0 24px rgba(196, 106, 50, 0.08);
}

.quiet-form button:disabled,
.form-row button:disabled {
  opacity: 0.54;
}

.text-link {
  display: inline-flex;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(196, 106, 50, 0.32);
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--text);
}

.quiet-section {
  padding: clamp(48px, 7.4vw, 86px) clamp(20px, 5vw, 72px);
  border-top: 1px solid rgba(232, 225, 214, 0.07);
}

.daily-ember {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--text);
  font-size: clamp(1.3rem, 4vw, 2.25rem);
  line-height: 1.75;
  white-space: pre-line;
}

.note-trace-section {
  padding: clamp(54px, 8vw, 96px) clamp(20px, 5vw, 72px) clamp(64px, 9vw, 112px);
  border-top: 1px solid rgba(232, 225, 214, 0.06);
}

.note-trace-title {
  margin: 0 0 28px;
  color: var(--sub);
  font-size: clamp(1rem, 1.9vw, 1.16rem);
  font-weight: 400;
  line-height: 1.8;
}

.note-trace-list {
  display: grid;
  gap: 18px;
  max-width: 430px;
  margin: 0 0 34px;
  padding: 0;
  list-style: none;
}

.note-trace-list li {
  position: relative;
  padding-left: 28px;
  color: var(--muted);
  font-size: clamp(0.9rem, 1.8vw, 0.98rem);
  line-height: 1.8;
}

.note-trace-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.93em;
  width: 12px;
  height: 1px;
  background: rgba(196, 106, 50, 0.34);
}

.note-trace-list a,
.note-trace-link {
  color: inherit;
  border-bottom: 1px solid rgba(196, 106, 50, 0.24);
  transition: color 220ms ease, border-color 220ms ease;
}

.note-trace-list a:hover,
.note-trace-list a:focus-visible,
.note-trace-link:hover,
.note-trace-link:focus-visible {
  color: var(--sub);
  border-color: rgba(241, 179, 106, 0.38);
}

.note-trace-link {
  display: inline-flex;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.ember-visual {
  position: relative;
  width: 154px;
  height: 72px;
  margin: 0 0 34px;
}

.ember-visual::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 14%;
  bottom: 10px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(196, 106, 50, 0.18), rgba(122, 53, 28, 0.07) 48%, transparent 74%);
  filter: blur(9px);
  opacity: 0.66;
  animation: emberHaze 12s ease-in-out infinite;
}

.ember-visual--center {
  margin-right: auto;
  margin-left: auto;
}

.ember-visual--small {
  width: 118px;
  height: 54px;
  margin-bottom: 24px;
}

.coal {
  position: absolute;
  bottom: 16px;
  display: block;
  height: 8px;
  border-radius: 58% 44% 63% 39% / 54% 64% 38% 48%;
  background:
    radial-gradient(circle at 68% 44%, rgba(241, 179, 106, 0.38), transparent 31%),
    linear-gradient(90deg, rgba(92, 38, 22, 0.7), rgba(196, 106, 50, 0.78), rgba(122, 53, 28, 0.62));
  box-shadow:
    0 0 14px rgba(196, 106, 50, 0.23),
    0 0 34px rgba(196, 106, 50, 0.075),
    0 0 58px rgba(122, 53, 28, 0.045);
  opacity: 0.72;
  filter: blur(0.14px);
  transform: translateX(0) rotate(var(--coal-rotate, 0deg));
  animation: emberBreath 9.6s ease-in-out infinite;
}

.coal::before,
.coal::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}

.coal::before {
  left: 17%;
  top: -4px;
  width: 22%;
  height: 7px;
  background: rgba(196, 106, 50, 0.38);
  box-shadow:
    24px 2px 10px rgba(241, 179, 106, 0.2),
    43px -1px 13px rgba(122, 53, 28, 0.2);
  filter: blur(3px);
}

.coal::after {
  inset: 2px 14%;
  background: rgba(241, 179, 106, 0.28);
  filter: blur(3px);
  opacity: 0.75;
}

.coal-a {
  left: 20px;
  width: 88px;
  height: 9px;
  --coal-rotate: -2.5deg;
  --coal-drift: 1.7px;
  animation-duration: 10.8s;
}

.coal-b {
  right: 20px;
  width: 61px;
  height: 7px;
  --coal-rotate: 3.6deg;
  --coal-drift: -1.2px;
  animation-delay: -3.1s;
  animation-duration: 8.9s;
  border-radius: 42% 61% 48% 56% / 46% 42% 60% 52%;
}

.coal-c {
  left: 54px;
  bottom: 26px;
  width: 44px;
  height: 6px;
  --coal-rotate: 1.2deg;
  --coal-drift: 0.9px;
  animation-delay: -5.4s;
  animation-duration: 12.4s;
  opacity: 0.48;
  border-radius: 64% 38% 42% 58% / 58% 44% 60% 36%;
}

.ember-visual.is-waiting .coal {
  animation-duration: 3.4s;
  box-shadow:
    0 0 18px rgba(196, 106, 50, 0.38),
    0 0 46px rgba(196, 106, 50, 0.11);
}

@keyframes emberBreath {
  0%,
  100% {
    opacity: 0.42;
    filter: brightness(0.82);
    transform: translateX(calc(var(--coal-drift, 1px) * -0.4)) rotate(var(--coal-rotate, 0deg));
  }

  37% {
    opacity: 0.62;
    filter: brightness(0.94);
    transform: translateX(var(--coal-drift, 1px)) rotate(var(--coal-rotate, 0deg));
  }

  53% {
    opacity: 0.78;
    filter: brightness(1.03);
    transform: translateX(calc(var(--coal-drift, 1px) * 0.35)) rotate(var(--coal-rotate, 0deg));
  }

  71% {
    opacity: 0.52;
    filter: brightness(0.92);
    transform: translateX(calc(var(--coal-drift, 1px) * -0.15)) rotate(var(--coal-rotate, 0deg));
  }
}

@keyframes emberHaze {
  0%,
  100% {
    opacity: 0.42;
    transform: scaleX(0.92);
  }

  46% {
    opacity: 0.68;
    transform: scaleX(1.04);
  }
}

.quiet-form {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.quiet-form textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  background: var(--input);
  color: var(--text);
  line-height: 1.8;
  transition: border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}

.quiet-form textarea::placeholder {
  color: rgba(154, 145, 136, 0.54);
}

.quiet-form textarea:focus {
  border-color: rgba(196, 106, 50, 0.62);
  background: rgba(255, 255, 255, 0.048);
  box-shadow: 0 0 0 3px rgba(196, 106, 50, 0.08);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 44px;
}

.form-row--space {
  margin-top: 52px;
}

.silence-note {
  min-height: 1.8em;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.response-space,
.question-space {
  margin-top: 38px;
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: clamp(1.22rem, 3vw, 1.9rem);
  line-height: 1.85;
  white-space: pre-line;
}

.response-space--night {
  font-size: clamp(1.05rem, 2.5vw, 1.55rem);
}

.question-space {
  min-height: 230px;
  display: flex;
  align-items: center;
  margin-top: 0;
  padding: 0 0 30px;
  border-top: 0;
}

.question-space p {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.6rem, 5.5vw, 3.35rem);
  line-height: 1.72;
}

.about-page {
  align-items: start;
}

.about-page section {
  padding: 34px 0;
  border-top: 1px solid rgba(232, 225, 214, 0.1);
}

.about-page p {
  max-width: 620px;
  margin-bottom: 18px;
  color: var(--sub);
}

.about-note {
  padding-bottom: 0;
}

.about-note__year {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 32px clamp(18px, 4vw, 52px);
  border-top: 1px solid rgba(232, 225, 214, 0.07);
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid rgba(241, 179, 106, 0.62);
  outline-offset: 4px;
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    padding: 18px 18px 16px;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.78rem;
  }

  .top-hero,
  .tool-page,
  .space-page,
  .about-page {
    min-height: auto;
    padding: 58px 20px 72px;
  }

  h1 {
    font-size: clamp(2.2rem, 15vw, 4.2rem);
  }

  .tool-page h1,
  .space-page h1,
  .about-page h1 {
    font-size: clamp(1.95rem, 10vw, 3rem);
  }

  .form-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .quiet-form button,
  .form-row button,
  .primary-link {
    width: 100%;
  }

  .question-space {
    min-height: 210px;
    padding-bottom: 26px;
  }

  .note-trace-section {
    padding-top: 52px;
    padding-bottom: 68px;
  }

  .note-trace-list {
    gap: 20px;
    margin-bottom: 38px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 28px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
