:root {
  color-scheme: light;
  --ink: #17251f;
  --muted: #66746e;
  --line: #dfe5df;
  --canvas: #f2f5f0;
  --surface: #ffffff;
  --forest: #12352d;
  --forest-soft: #1b493d;
  --mint: #b9f067;
  --mint-deep: #8fce3f;
  --coral: #ee6c56;
  --blue: #4c7ee8;
  --danger: #b43a32;
  --shadow: 0 24px 70px rgb(35 61 48 / 10%);
  font-family:
    Inter, Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 3%, rgb(185 240 103 / 19%), transparent 27rem),
    radial-gradient(circle at 5% 28%, rgb(76 126 232 / 8%), transparent 25rem),
    var(--canvas);
}

button,
select,
input {
  font: inherit;
}

button,
select {
  color: inherit;
}

button {
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--forest);
  border-radius: 0.6rem;
  transform: translateY(-150%);
}

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

.site-header,
.page-shell,
.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 46px;
  height: 46px;
  overflow: hidden;
  color: white;
  background: var(--forest);
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgb(18 53 45 / 20%);
}

.brand-mark::after {
  position: absolute;
  inset: 5px 50% 5px auto;
  width: 1px;
  content: "";
  background: rgb(255 255 255 / 20%);
}

.brand-mark span {
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.brand-mark span:last-child {
  color: var(--mint);
}

.brand > span:last-child {
  display: grid;
  gap: 0.12rem;
}

.brand strong {
  font-size: 1.02rem;
  letter-spacing: -0.03em;
}

.brand small {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  color: #52615b;
  background: rgb(255 255 255 / 65%);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #98a39e;
  border-radius: 50%;
}

.connection-status[data-tone="working"] .status-dot {
  background: #e0a23d;
  box-shadow: 0 0 0 5px rgb(224 162 61 / 14%);
  animation: status-pulse 1.4s ease-in-out infinite;
}

.connection-status[data-tone="live"] .status-dot {
  background: #58bf69;
  box-shadow: 0 0 0 5px rgb(88 191 105 / 15%);
}

.connection-status[data-tone="error"] .status-dot {
  background: var(--danger);
}

.page-shell {
  padding: 2rem 0 3.5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(390px, 0.8fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  min-height: 560px;
}

.eyebrow,
.section-kicker,
.card-heading p {
  margin: 0;
  color: #718078;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 700px;
  margin: 1rem 0 1.25rem;
  font-size: clamp(2.75rem, 6.4vw, 5.6rem);
  line-height: 1.05;
  letter-spacing: -0.07em;
}

.hero-copy h1 span {
  color: var(--forest-soft);
}

.hero-description {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  line-height: 1.75;
  word-break: keep-all;
}

.language-route {
  display: flex;
  align-items: center;
  max-width: 620px;
  margin-top: 2.5rem;
}

.language-card {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  padding: 1rem;
  background: rgb(255 255 255 / 72%);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgb(32 59 47 / 6%);
  backdrop-filter: blur(10px);
}

.language-card > span:last-child {
  display: grid;
  min-width: 0;
}

.language-code {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  color: white;
  border-radius: 13px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.source-language .language-code {
  background: var(--coral);
}

.target-language .language-code {
  background: var(--blue);
}

.language-card small {
  margin-bottom: 0.18rem;
  color: #7b8882;
  font-size: 0.66rem;
}

.language-card strong {
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-card > span:last-child > span {
  color: var(--muted);
  font-size: 0.72rem;
}

.route-arrow {
  display: flex;
  flex: 0 0 70px;
  align-items: center;
  justify-content: center;
  color: var(--forest);
}

.route-arrow b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--mint);
  border: 4px solid var(--canvas);
  border-radius: 50%;
  font-size: 1rem;
}

.interpreter-card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  color: white;
  background:
    radial-gradient(circle at 85% 15%, rgb(185 240 103 / 16%), transparent 12rem),
    linear-gradient(150deg, #173c33, #0d2822);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 30px;
  box-shadow: 0 32px 80px rgb(17 53 44 / 22%);
}

.interpreter-card::after {
  position: absolute;
  inset: auto -80px -110px auto;
  width: 230px;
  height: 230px;
  content: "";
  border: 1px solid rgb(185 240 103 / 16%);
  border-radius: 50%;
}

.card-heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card-heading p {
  color: var(--mint);
}

.card-heading h2,
.section-heading h2 {
  margin: 0.25rem 0 0;
  font-size: 1.22rem;
  letter-spacing: -0.04em;
}

.card-heading time {
  color: #b8c9c3;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.audio-visual {
  position: relative;
  display: grid;
  min-height: 180px;
  place-items: center;
  margin: 1rem 0 0.2rem;
}

.mic-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  background: var(--mint);
  border: 8px solid rgb(185 240 103 / 12%);
  border-radius: 50%;
  background-clip: padding-box;
  box-shadow: 0 0 0 1px rgb(185 240 103 / 28%);
  transform: translate(-50%, -50%);
}

.mic-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 24px;
  border: 3px solid var(--forest);
  border-radius: 9px;
}

.mic-icon::before {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 28px;
  height: 15px;
  content: "";
  border: 3px solid var(--forest);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  transform: translateX(-50%);
}

.mic-icon::after {
  position: absolute;
  bottom: -11px;
  left: 50%;
  width: 3px;
  height: 9px;
  content: "";
  background: var(--forest);
  transform: translateX(-50%);
}

.waveform {
  display: flex;
  width: 100%;
  height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  opacity: 0.7;
}

.waveform span {
  width: 4px;
  height: 100%;
  background: linear-gradient(to top, rgb(185 240 103 / 12%), var(--mint));
  border-radius: 999px;
  transform: scaleY(0.08);
  transition: transform 80ms linear;
  transform-origin: center;
}

body[data-phase="live"] .mic-orb {
  animation: mic-pulse 2s ease-out infinite;
}

.listening-message {
  min-height: 2.8em;
  margin: 0 0 1rem;
  color: #bdccc7;
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

.primary-actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0 1.2rem;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.button:not(:disabled):hover {
  transform: translateY(-2px);
}

.button:focus-visible,
.text-button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgb(185 240 103 / 45%);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.button-primary {
  color: var(--forest);
  background: var(--mint);
}

.button-primary:not(:disabled):hover {
  background: #c8f988;
}

.button-stop {
  color: white;
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 14%);
}

.button-icon {
  display: inline-block;
  width: 11px;
  height: 11px;
}

.start-icon {
  background: currentcolor;
  border-radius: 50%;
}

.stop-icon {
  background: currentcolor;
  border-radius: 2px;
}

.headphone-note {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 0.9rem;
  padding: 0.8rem;
  color: #b6c7c1;
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 13px;
}

.headphone-note > span {
  color: var(--mint);
  font-size: 0.65rem;
  line-height: 1.6;
}

.headphone-note p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.55;
}

.headphone-note strong {
  color: white;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 1rem;
  margin-top: 4rem;
}

.transcript-section,
.settings-card {
  padding: 1.5rem;
  background: rgb(255 255 255 / 80%);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.section-kicker {
  color: #809087;
}

.text-actions {
  display: flex;
  gap: 0.35rem;
}

.text-button {
  padding: 0.55rem 0.7rem;
  color: #5f6f67;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 750;
}

.text-button:hover {
  color: var(--forest);
  background: #eff4ef;
}

.transcript-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.transcript-panel {
  min-width: 0;
  min-height: 245px;
  padding: 1.15rem;
  border: 1px solid #e5eae6;
  border-radius: 18px;
}

.source-panel {
  background: linear-gradient(145deg, #fff, #fff8f6);
}

.target-panel {
  background: linear-gradient(145deg, #fff, #f5f8ff);
}

.transcript-panel header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.panel-language-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.source-panel .panel-language-dot {
  background: var(--coral);
  box-shadow: 0 0 0 5px rgb(238 108 86 / 11%);
}

.target-panel .panel-language-dot {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgb(76 126 232 / 11%);
}

.transcript-panel small {
  color: #87938d;
  font-size: 0.65rem;
}

.transcript-panel h3 {
  margin: 0;
  font-size: 0.86rem;
}

.transcript-text {
  max-height: 190px;
  margin: 1.25rem 0 0;
  overflow: auto;
  color: #28372f;
  font-size: 1rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.transcript-text:empty::before {
  color: #9ca7a1;
  content: attr(data-placeholder);
  font-size: 0.85rem;
}

.settings-card {
  box-shadow: 0 18px 55px rgb(35 61 48 / 7%);
}

.settings-heading {
  margin-bottom: 1.2rem;
}

.field {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.field > span {
  display: flex;
  justify-content: space-between;
  color: #52635b;
  font-size: 0.76rem;
  font-weight: 750;
}

.field select {
  width: 100%;
  height: 44px;
  padding: 0 2.2rem 0 0.8rem;
  background: #f7f9f6;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 0.8rem;
}

.field select:disabled {
  opacity: 0.6;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.shield-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 23px;
  height: 23px;
  color: var(--forest);
  background: #e3f4df;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 900;
}

.privacy-note p {
  margin: 0;
  color: #77847e;
  font-size: 0.7rem;
  line-height: 1.55;
}

.error-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  color: #7f2c27;
  background: #fff0ed;
  border: 1px solid #f3c4bd;
  border-radius: 14px;
}

.error-banner[hidden] {
  display: none;
}

.error-banner > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 23px;
  height: 23px;
  color: white;
  background: var(--danger);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
}

.error-banner p {
  flex: 1;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.error-banner button {
  padding: 0.2rem 0.45rem;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: 1.25rem;
}

.usage-note {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  color: #4f6258;
  background: rgb(255 255 255 / 48%);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.usage-note > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--forest);
  background: var(--mint);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  font-weight: 800;
}

.usage-note h2 {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
}

.usage-note p {
  margin: 0;
  color: #738078;
  font-size: 0.75rem;
  line-height: 1.55;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 2rem;
  color: #89958f;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
}

.site-footer p {
  margin: 0;
}

@keyframes status-pulse {
  50% {
    opacity: 0.5;
  }
}

@keyframes mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgb(185 240 103 / 28%), 0 0 0 0 rgb(185 240 103 / 18%);
  }
  50% {
    box-shadow: 0 0 0 1px rgb(185 240 103 / 28%), 0 0 0 18px transparent;
  }
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-copy {
    max-width: 760px;
  }

  .interpreter-card {
    width: min(100%, 620px);
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .settings-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 1rem;
  }

  .settings-heading,
  .privacy-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .site-header,
  .page-shell,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 74px;
  }

  .brand small,
  .connection-status span:last-child {
    display: none;
  }

  .connection-status {
    padding: 0.7rem;
  }

  .page-shell {
    padding-top: 1rem;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy h1 {
    font-size: clamp(2.6rem, 14vw, 4rem);
  }

  .language-route {
    align-items: stretch;
  }

  .language-card {
    align-items: flex-start;
    padding: 0.85rem;
  }

  .language-code {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .language-card small,
  .language-card > span:last-child > span {
    display: none;
  }

  .route-arrow {
    flex-basis: 44px;
  }

  .route-arrow b {
    width: 30px;
    height: 30px;
  }

  .interpreter-card,
  .transcript-section,
  .settings-card {
    padding: 1.1rem;
    border-radius: 22px;
  }

  .workspace {
    margin-top: 2.5rem;
  }

  .transcript-grid,
  .settings-card {
    grid-template-columns: 1fr;
  }

  .settings-heading,
  .privacy-note {
    grid-column: auto;
  }

  .transcript-panel {
    min-height: 190px;
  }

  .section-heading {
    align-items: center;
  }

  .section-heading .text-actions {
    display: grid;
  }

  .site-footer {
    display: grid;
  }
}

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