:root {
  color-scheme: dark;
  --obsidian: #080a09;
  --obsidian-soft: #111512;
  --ivory: #f0e5d1;
  --ivory-muted: #b8ae9f;
  --stone: #817b73;
  --jade: #2b654f;
  --jade-deep: #173d31;
  --jade-line: rgba(95, 171, 135, 0.5);
  --brass: #c9a76f;
  --brass-line: rgba(201, 167, 111, 0.42);
  --sans: "Yu Gothic UI", "Hiragino Sans", "BIZ UDPGothic", system-ui, sans-serif;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--obsidian);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--obsidian);
  color: var(--ivory);
  font-family: var(--sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  min-height: 44px;
  padding: 12px 16px;
  transform: translateY(-160%);
  border: 1px solid var(--brass);
  background: var(--obsidian);
  color: var(--ivory);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 4px;
}

.site-shell {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  background-color: var(--obsidian);
  background-image:
    linear-gradient(rgba(3, 5, 4, 0.16), rgba(3, 5, 4, 0.42)),
    url("./assets/obsidian-field.png");
  background-position: center;
  background-size: cover;
}

.site-shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 72% 47%, rgba(35, 99, 73, 0.11), transparent 31%),
    linear-gradient(90deg, rgba(3, 5, 4, 0.08), rgba(3, 5, 4, 0.38));
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 84px;
  padding: env(safe-area-inset-top) clamp(24px, 4vw, 64px) 0;
  border-bottom: 1px solid rgba(201, 167, 111, 0.16);
}

.wordmark {
  width: max-content;
  color: #e8cfaa;
  font-family: var(--serif);
  font-size: clamp(30px, 2.8vw, 42px);
  letter-spacing: -0.035em;
  line-height: 1;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 48px);
  color: #d5c2a4;
  font-family: var(--serif);
  font-size: 15px;
}

.desktop-nav a,
.mobile-nav-link {
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.desktop-nav a::after,
.mobile-nav-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 7px;
  left: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: right;
  background: var(--brass);
  transition: transform 180ms ease;
}

.desktop-nav a:hover::after,
.desktop-nav a:focus-visible::after,
.mobile-nav-link:hover::after,
.mobile-nav-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.mobile-nav-link {
  display: none;
  color: #d5c2a4;
  font-family: var(--serif);
  font-size: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(460px, 1.08fr);
  align-items: center;
  min-height: calc(100svh - 128px);
  padding: clamp(54px, 6vh, 84px) clamp(28px, 5vw, 76px) clamp(76px, 9vh, 112px);
  gap: clamp(44px, 6vw, 96px);
}

.hero-copy {
  align-self: center;
  max-width: 650px;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: clamp(58px, 5.6vw, 84px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.16;
  text-wrap: balance;
}

.hero-description {
  margin: clamp(30px, 4vh, 48px) 0 0;
  color: #d5cbbb;
  font-family: var(--serif);
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.85;
}

.keep-phrase {
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(32px, 4.5vh, 50px);
}

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 54px;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.action:hover {
  transform: translateY(-2px);
}

.action-primary {
  gap: 12px;
  background: linear-gradient(135deg, #2f6b54, #1d4b3b);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.09), 0 14px 36px rgba(0, 0, 0, 0.22);
  color: #fff8e9;
}

.action-secondary {
  border-color: rgba(201, 167, 111, 0.76);
  background: rgba(8, 10, 9, 0.28);
  color: #eadcc5;
}

.action-secondary:hover {
  border-color: var(--brass);
  background: rgba(201, 167, 111, 0.08);
}

.action-mark {
  color: #e8f5ec;
  font-size: 17px;
}

.record-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: clamp(34px, 5vh, 56px) 0 0;
  color: rgba(184, 174, 159, 0.7);
  font-size: 12px;
  line-height: 1.6;
}

.record-line > span {
  width: 42px;
  height: 1px;
  flex: 0 0 auto;
  background: var(--brass-line);
}

.conversation {
  width: min(100%, 660px);
  justify-self: end;
  scroll-margin-top: 90px;
  outline: none;
}

.conversation:focus-visible {
  outline: 1px solid rgba(201, 167, 111, 0.6);
  outline-offset: 14px;
}

.conversation-date {
  width: max-content;
  margin: 0 auto 34px;
  padding: 7px 18px;
  border: 1px solid rgba(201, 167, 111, 0.2);
  border-radius: 999px;
  color: #cfc2ae;
  font-family: var(--serif);
  font-size: 12px;
}

.message {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.message + .message {
  margin-top: 26px;
}

.resonance-core {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid rgba(136, 199, 166, 0.2);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 28px rgba(55, 128, 94, 0.12);
  animation: core-breathe 4.8s ease-in-out infinite;
}

.resonance-core-small {
  width: 40px;
  height: 40px;
}

.message-ai h2,
.message-ai p {
  margin: 0;
  color: #eee3d2;
  font-family: var(--serif);
  font-size: clamp(16px, 1.25vw, 19px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.85;
}

.message-ai h2 {
  padding-top: 8px;
}

.message time {
  display: block;
  margin-top: 8px;
  color: rgba(184, 174, 159, 0.58);
  font-size: 12px;
}

.message-user {
  justify-content: flex-end;
}

.message-user p {
  max-width: 76%;
  margin: 0;
  padding: 16px 20px;
  border: 1px solid rgba(107, 180, 145, 0.4);
  border-radius: 15px 15px 4px 15px;
  background: rgba(31, 90, 69, 0.78);
  color: #f6ecdc;
  font-family: var(--serif);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.55;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}

.conversation-actions {
  display: grid;
  gap: 12px;
  margin: 30px 0 0 56px;
}

.conversation-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 18px;
  border: 1px solid var(--jade-line);
  border-radius: 11px;
  background: rgba(6, 9, 7, 0.48);
  color: #a9d4bb;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.conversation-actions button:hover,
.conversation-actions button:focus-visible {
  border-color: rgba(125, 202, 165, 0.78);
  background: rgba(33, 82, 63, 0.32);
  color: #d9eadf;
}

.interaction-status {
  min-height: 20px;
  margin: 12px 0 0 56px;
  color: rgba(184, 174, 159, 0.7);
  font-size: 12px;
  line-height: 1.6;
}

.is-ready .message-entry-one,
.is-ready .message-entry-two,
.is-ready .message-entry-three,
.is-ready .conversation-actions {
  animation: message-arrive 600ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
}

.is-ready .message-entry-two {
  animation-delay: 100ms;
}

.is-ready .message-entry-three {
  animation-delay: 180ms;
}

.is-ready .conversation-actions {
  animation-delay: 260ms;
}

@keyframes message-arrive {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes core-breathe {
  0%,
  100% {
    opacity: 0.82;
    transform: scale(0.97);
    filter: brightness(0.88);
  }
  50% {
    opacity: 1;
    transform: scale(1.035);
    filter: brightness(1.08);
  }
}

@media (max-width: 980px) {
  .site-header {
    min-height: 68px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-nav-link {
    display: inline-flex;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    padding: 48px 20px 94px;
    gap: 64px;
  }

  .hero-copy,
  .conversation {
    width: 100%;
    max-width: 680px;
    justify-self: center;
  }

  .conversation {
    padding-top: 32px;
    border-top: 1px solid rgba(201, 167, 111, 0.17);
  }

}

@media (max-width: 560px) {
  .site-shell {
    background-position: 48% center;
  }

  .site-shell::before {
    background: rgba(2, 4, 3, 0.32);
  }

  .wordmark {
    font-size: 30px;
  }

  .hero {
    padding-top: 38px;
    gap: 54px;
  }

  .hero h1 {
    font-size: clamp(46px, 14.6vw, 60px);
    line-height: 1.14;
  }

  .hero-description {
    margin-top: 24px;
    font-size: 16px;
    line-height: 1.8;
  }

  .desktop-break {
    display: none;
  }

  .hero-actions {
    display: grid;
    margin-top: 30px;
  }

  .action {
    width: 100%;
    min-width: 0;
    min-height: 50px;
  }

  .record-line {
    margin-top: 26px;
  }

  .conversation-date {
    margin-bottom: 26px;
  }

  .message {
    gap: 12px;
  }

  .message-ai h2,
  .message-ai p {
    font-size: 15px;
    line-height: 1.8;
  }

  .message-user p {
    max-width: 88%;
    font-size: 15px;
  }

  .conversation-actions,
  .interaction-status {
    margin-left: 0;
  }

  .conversation-actions button {
    min-height: 50px;
    font-size: 14px;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .resonance-core {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
