:root {
  color-scheme: dark;
  --canvas: #090909;
  --surface: #141414;
  --surface-raised: #191919;
  --line: #292929;
  --line-soft: #1d1d1d;
  --ink: #f5f5f5;
  --muted: #8b8b8b;
  --quiet: #8a8a8a;
  --blue: #0099ff;
  --blue-soft: rgba(0, 153, 255, 0.18);
  --radius: 16px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::selection,
textarea::selection {
  color: #fff;
  background: var(--blue);
}

button,
textarea {
  font: inherit;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.page-shell {
  width: min(100% - 48px, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 18px;
  height: 18px;
  display: inline-block;
  border: 1px solid var(--ink);
  border-radius: 5px;
  position: relative;
}

.brand-mark::after {
  width: 5px;
  height: 5px;
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  background: var(--ink);
}

.topbar-note {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: -0.01em;
}

main {
  flex: 1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: end;
  padding: clamp(72px, 11vw, 140px) 0 96px;
}

.hero-copy {
  padding-bottom: 12px;
}

.panel-index,
.panel-hint,
.site-footer,
.copy-button,
.input-footer > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 560px;
  margin-bottom: 28px;
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

h1 em {
  color: var(--muted);
  font-style: normal;
}

.hero-description {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.025em;
}

.tool-panel {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.panel-heading,
.section-heading {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading > div,
.section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.panel-index {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

h2 {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.panel-hint {
  color: var(--quiet);
  letter-spacing: 0.02em;
}

.generator-form {
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
}

textarea {
  width: 100%;
  min-height: 138px;
  display: block;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.55;
  letter-spacing: -0.045em;
}

textarea::placeholder {
  color: var(--quiet);
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.input-footer > span {
  color: var(--quiet);
  letter-spacing: 0.02em;
  text-transform: none;
}

.primary-button,
.copy-button {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.primary-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #0b0b0b;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.primary-button svg,
.copy-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.primary-button:hover {
  background: var(--blue);
  color: #fff;
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.form-message {
  min-height: 30px;
  margin: 0;
  padding: 12px 20px 0;
  color: var(--blue);
  font-size: 12px;
  line-height: 1.4;
}

.form-message.is-error {
  color: #ff7f91;
}

.result-section {
  padding-bottom: 76px;
}

.section-heading {
  border-bottom: 1px solid var(--line);
}

.copy-button {
  min-height: 44px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  letter-spacing: -0.01em;
  text-transform: none;
}

.copy-button:not(:disabled):hover {
  color: var(--ink);
}

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

.result-area {
  min-height: 224px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.empty-result {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--quiet);
}

.empty-result p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.03em;
}

.empty-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue);
}

.result-content {
  width: 100%;
  padding: 36px 0;
  animation: result-in 360ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.result-word {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(44px, 8vw, 96px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.08em;
}

.result-source {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: -0.025em;
}

.result-source strong {
  color: var(--ink);
  font-weight: 500;
}

.site-footer {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line-soft);
  color: var(--quiet);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 32px, 620px);
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 72px 0 72px;
  }

  .hero-copy {
    padding-bottom: 0;
  }

  h1 {
    font-size: clamp(48px, 13vw, 72px);
  }

  .desktop-break {
    display: none;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 28px, 480px);
  }

  .topbar {
    min-height: 64px;
  }

  .topbar-note {
    display: none;
  }

  .hero {
    gap: 36px;
    padding: 56px 0 56px;
  }

  h1 {
    margin-bottom: 22px;
    font-size: clamp(45px, 14vw, 62px);
  }

  .hero-description {
    font-size: 15px;
  }

  .panel-heading,
  .section-heading {
    min-height: 62px;
  }

  .panel-heading > div,
  .section-heading > div {
    gap: 12px;
  }

  .panel-hint {
    display: none;
  }

  .generator-form {
    padding: 16px;
  }

  textarea {
    min-height: 144px;
    font-size: 17px;
  }

  .input-footer {
    align-items: flex-end;
  }

  .primary-button {
    min-height: 44px;
    padding: 0 14px;
    font-size: 12px;
  }

  .primary-button svg {
    width: 16px;
    height: 16px;
  }

  .result-area {
    min-height: 190px;
  }

  .result-content {
    padding: 30px 0;
  }

  .result-word {
    font-size: clamp(42px, 15vw, 68px);
  }

  .site-footer {
    min-height: 70px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }
}

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