:root {
  color-scheme: light;
  --bg: #f5f4ed;
  --surface: #faf9f5;
  --surface-strong: #ffffff;
  --line: #e8e6dc;
  --line-soft: #f0eee6;
  --text: #141413;
  --muted: #5e5d59;
  --muted-light: #87867f;
  --accent: #c96442;
  --accent-soft: #e9c8b9;
  --focus: #3898ec;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 12% 8%, rgba(201, 100, 66, 0.18), transparent 28rem),
    radial-gradient(circle at 88% 16%, rgba(48, 48, 46, 0.09), transparent 24rem),
    var(--bg);
}

.page-shell {
  width: calc(100% - 32px);
  max-width: 980px;
  margin: 48px auto 40px;
}

.intro {
  position: relative;
  overflow: hidden;
  padding: 34px 36px 32px;
  margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(250, 249, 245, 0.96), rgba(255, 255, 255, 0.76));
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  box-shadow: rgba(20, 20, 19, 0.05) 0 18px 60px, rgba(209, 207, 197, 0.9) 0 0 0 1px;
}

.intro::after {
  content: '';
  position: absolute;
  right: -68px;
  top: -92px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(201, 100, 66, 0.24);
  border-radius: 48% 52% 46% 54%;
  transform: rotate(18deg);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.lede {
  position: relative;
  z-index: 1;
  max-width: 690px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.microcopy {
  position: relative;
  z-index: 1;
  display: inline-flex;
  max-width: 760px;
  margin: 18px 0 0;
  padding: 10px 14px;
  color: var(--text);
  background: rgba(232, 230, 220, 0.62);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.45;
}

.translator {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: rgba(20, 20, 19, 0.06) 0 22px 70px, rgba(209, 207, 197, 0.95) 0 0 0 1px;
}

.panel {
  min-height: 310px;
  display: flex;
  flex-direction: column;
}

.result-panel {
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(250, 249, 245, 0.82)),
    var(--surface);
}

label,
.result-label {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.input-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px 0 22px;
  border-bottom: 1px solid var(--line);
}

.input-head label {
  min-height: auto;
  padding: 0;
  border-bottom: 0;
}

.translate-button {
  appearance: none;
  border: 1px solid rgba(201, 100, 66, 0.28);
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  background: var(--accent);
  box-shadow: rgba(201, 100, 66, 0.22) 0 10px 26px;
  font: 700 13px/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
}

.translate-button:hover { filter: brightness(0.96); }
.translate-button:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.translate-button:disabled { cursor: wait; opacity: 0.72; }

textarea,
pre {
  flex: 1;
  width: 100%;
  min-height: 254px;
  margin: 0;
  padding: 24px 22px;
  border: 0;
  outline: 0;
  color: var(--text);
  font: 22px/1.58 var(--sans);
  white-space: pre-wrap;
  word-break: break-word;
}

textarea {
  resize: none;
  background: var(--surface-strong);
}

textarea::placeholder { color: var(--muted-light); }
textarea:focus { box-shadow: inset 0 0 0 2px var(--focus); }
pre { background: transparent; }
pre:empty::before {
  content: '出力 Kanji + English here。';
  color: var(--muted-light);
}

@media (max-width: 760px) {
  .page-shell {
    width: calc(100% - 24px);
    margin-top: 24px;
  }

  .intro {
    padding: 28px 24px 26px;
    border-radius: 22px;
  }

  .microcopy {
    border-radius: 18px;
  }

  .translator {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }

  .result-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
