:root {
  --bg: #f7f7f8;
  --bg-chat: #ffffff;
  --ink: #0d0d0d;
  --muted: #8f8f8f;
  --line: rgba(0, 0, 0, 0.08);
  --bubble: #f4f4f4;
  --radius: 28px;
  --max: 720px;
  --font: "Inter", "Noto Sans JP", sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
textarea {
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* header */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
}

.brand {
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

body:has(.stage:not(.is-empty)) .brand {
  opacity: 1;
  pointer-events: auto;
}

.brand img {
  height: 28px;
  width: auto;
}

.nav-link {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--ink);
}

/* app shell */

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 72px 16px 0;
}

.stage.is-empty {
  justify-content: center;
  padding-bottom: 12vh;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero-logo {
  width: min(280px, 72vw);
  height: auto;
  margin: 0 auto;
}

.hero p {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}

.thread {
  display: none;
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 8px 0 24px;
}

.stage:not(.is-empty) .hero {
  display: none;
}

.stage:not(.is-empty) .thread {
  display: block;
  flex: 1;
}

.message {
  display: flex;
  gap: 14px;
  padding: 18px 4px;
  animation: rise 0.45s ease;
}

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

.avatar {
  width: 48px;
  height: auto;
  flex-shrink: 0;
  margin-top: 6px;
}

.avatar img {
  width: 48px;
  height: auto;
}

.bubble {
  max-width: 78%;
  background: var(--bubble);
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.reply {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 1.8;
}

.reply p + p {
  margin-top: 0.9em;
}

.reply a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.typing {
  display: flex;
  gap: 5px;
  padding: 10px 0;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c3c3c3;
  animation: blink 1.1s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.works {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.work {
  background: var(--bg-chat);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform 0.25s ease;
}

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

.work img {
  width: 100%;
  height: 148px;
  object-fit: cover;
  background: #ececec;
}

.work figcaption {
  padding: 10px 12px 12px;
}

.work strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.work span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.company-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-chat);
  overflow: hidden;
}

.company-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.company-card th,
.company-card td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.company-card tr:last-child th,
.company-card tr:last-child td {
  border-bottom: 0;
}

.company-card th {
  width: 7.5em;
  color: var(--muted);
  font-weight: 500;
}

.more {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

/* composer */

.dock {
  position: sticky;
  bottom: 0;
  padding: 0 16px 18px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.composer {
  width: min(var(--max), 100%);
  margin: 0 auto;
  background: var(--bg-chat);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 18px;
}

.composer textarea {
  flex: 1;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.5;
  padding: 10px 0;
  max-height: 160px;
  color: var(--ink);
}

.composer textarea::placeholder {
  color: #b0b0b0;
}

.send {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #d4d4d4;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.send.is-ready {
  background: var(--ink);
}

.send:disabled {
  cursor: default;
}

.hints {
  width: min(var(--max), 100%);
  margin: 14px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hint {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.hint:hover {
  background: #fff;
}

.fineprint {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 10px 16px 6px;
}

/* company page */

.page {
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 108px 0 80px;
}

.page h1 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.lede {
  margin: 12px 0 36px;
  color: var(--muted);
  font-size: 15px;
}

.page table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.page th,
.page td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.7;
  vertical-align: top;
}

.page tr:last-child th,
.page tr:last-child td {
  border-bottom: 0;
}

.page th {
  width: 8em;
  color: var(--muted);
  font-weight: 500;
  background: #fafafa;
}

.note {
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

/* lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
  cursor: zoom-out;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 92vh;
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .works {
    grid-template-columns: 1fr;
  }

  .work img {
    height: 180px;
  }

  .bubble {
    max-width: 88%;
  }

  .page {
    width: calc(100% - 28px);
    padding-top: 96px;
  }
}
