@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

:root {
  --ink: #1e241f;
  --ink-soft: #667069;
  --paper: #f4f3ee;
  --panel: #fbfaf6;
  --line: #dfe2da;
  --line-strong: #c9cec4;
  --moss: #365a46;
  --moss-dark: #244432;
  --amber: #eeaa43;
  --amber-soft: #f7e6bf;
  --white: #fffef9;
  --shadow: 0 18px 50px rgba(41, 53, 44, 0.08);
  --sans: 'Manrope', 'Noto Sans JP', sans-serif;
  --mono: 'DM Mono', monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 8%, rgba(237, 201, 133, 0.16), transparent 25rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1400px, calc(100% - 64px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid rgba(201, 206, 196, 0.72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: end;
  gap: 3px;
  width: 22px;
  height: 24px;
}

.brand-mark i {
  display: block;
  width: 5px;
  border-radius: 4px 4px 1px 1px;
  background: var(--moss);
}

.brand-mark i:nth-child(1) { height: 12px; opacity: 0.55; }
.brand-mark i:nth-child(2) { height: 20px; opacity: 0.78; }
.brand-mark i:nth-child(3) { height: 16px; background: var(--amber); }

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.topbar-status,
.eyebrow,
.section-kicker,
.mini-kicker,
.result-state,
.hero-tags,
.visual-footnote,
.site-footer {
  font-family: var(--mono);
}

.topbar-status {
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #73a378;
  box-shadow: 0 0 0 4px rgba(115, 163, 120, 0.13);
  vertical-align: 1px;
}

main {
  padding: 74px 0 92px;
}

.hero {
  max-width: 820px;
  margin-bottom: 58px;
}

.eyebrow,
.section-kicker,
.mini-kicker {
  color: var(--moss);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 21px;
}

.eyebrow span {
  display: inline-block;
  width: 25px;
  height: 1px;
  background: var(--amber);
}

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

h1 {
  margin-bottom: 20px;
  font-size: clamp(44px, 6.5vw, 84px);
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 0.98;
}

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

.hero-copy {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.95;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 27px;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.hero-tags span {
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: rgba(255, 254, 249, 0.4);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(540px, 1.55fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 246, 0.88);
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 34px 34px 29px;
}

.section-kicker {
  margin-bottom: 13px;
  opacity: 0.84;
}

h2 {
  margin-bottom: 10px;
  font-size: 27px;
  letter-spacing: -0.055em;
  line-height: 1.15;
}

.panel-lead {
  margin-bottom: 33px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.field-group + .field-group {
  margin-top: 22px;
}

.field-group label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.field-group label small {
  color: #40453f;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.input-shell {
  display: flex;
  align-items: center;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--white);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.input-shell:focus-within {
  border-color: var(--moss);
  box-shadow: 0 0 0 4px rgba(54, 90, 70, 0.1);
  transform: translateY(-1px);
}

.input-shell.invalid {
  border-color: #c66f56;
  box-shadow: 0 0 0 4px rgba(198, 111, 86, 0.09);
}

.input-shell input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 15px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--mono);
  font-size: 16px;
}

.input-shell input::placeholder {
  color: #b2b8ae;
}

.input-shell > span {
  padding-right: 16px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
}

.quick-fill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 27px;
  color: var(--ink-soft);
  font-size: 10px;
}

.example-chip {
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--moss-dark);
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  transition: background 160ms ease, border-color 160ms ease;
}

.example-chip:hover,
.example-chip:focus-visible {
  border-color: var(--moss);
  background: rgba(54, 90, 70, 0.07);
  outline: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: 28px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 31px;
  min-width: 150px;
  padding: 13px 15px 13px 17px;
  border: 1px solid var(--moss-dark);
  border-radius: 4px;
  color: #fffdf5;
  background: var(--moss-dark);
  font-size: 12px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #306142;
  box-shadow: 0 7px 18px rgba(36, 68, 50, 0.18);
  outline: 0;
  transform: translateY(-1px);
}

.button-arrow {
  color: var(--amber);
  font-size: 18px;
  line-height: 0.8;
}

.text-button,
.process-toggle {
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
}

.text-button:hover,
.text-button:focus-visible,
.process-toggle:hover,
.process-toggle:focus-visible {
  color: var(--moss-dark);
  outline: 0;
}

.form-message {
  min-height: 17px;
  margin: 14px 0 0;
  color: #ad5f47;
  font-size: 11px;
  line-height: 1.55;
}

.form-message:empty {
  display: none;
}

.method-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 29px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--moss);
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: italic;
}

.method-note p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.result-panel {
  padding: 34px;
}

.result-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.result-heading-row h2 {
  margin-bottom: 0;
}

.result-state {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.result-state.ready {
  border-color: #b4c9b8;
  color: var(--moss);
  background: #f0f6ed;
}

.result-state.error {
  border-color: #e5b9a9;
  color: #ad5f47;
  background: #fff5ef;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.result-card {
  min-height: 126px;
  padding: 15px 15px 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
}

.result-card-primary {
  border-color: #b8c9ba;
  background: #f4f8f0;
}

.result-card-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.card-marker,
.legend-dot {
  display: inline-block;
  border-radius: 50%;
}

.card-marker {
  width: 6px;
  height: 6px;
  background: var(--amber);
}

.water-marker { background: #a4b6a9; }
.final-marker { background: var(--moss); }

.result-number {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 15px;
}

.result-number strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 500;
  letter-spacing: -0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-number span {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
}

.result-card p {
  margin: 7px 0 0;
  color: #8a9289;
  font-size: 10px;
}

.visual-card {
  margin-top: 18px;
  padding: 25px 26px 19px;
  border-radius: 5px;
  background: #edf0e8;
  overflow: hidden;
}

.visual-card-header,
.process-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.mini-kicker {
  margin-bottom: 8px;
  color: #859287;
  font-size: 9px;
}

.visual-card h3,
.process-card h3 {
  margin-bottom: 0;
  font-size: 16px;
  letter-spacing: -0.04em;
}

.visual-caption {
  color: #8a968c;
  font-size: 10px;
}

.beaker-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 5vw, 62px);
  min-height: 288px;
  padding: 31px 10px 18px;
}

.beaker-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 124px;
}

.beaker-wrap {
  position: relative;
  width: 124px;
  height: 188px;
  padding-top: 10px;
}

.beaker {
  --liquid-color: #edc16e;
  --liquid-deep: #bd8231;
  position: relative;
  width: 108px;
  height: 168px;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid #9ba89c;
  border-top: 0;
  border-radius: 0 0 25px 25px;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 -7px 0 rgba(139, 153, 141, 0.08);
}

.beaker::before {
  position: absolute;
  right: -3px;
  bottom: 11px;
  left: -3px;
  height: 1px;
  background: rgba(135, 148, 138, 0.23);
  content: '';
}

.beaker::after {
  position: absolute;
  right: 9px;
  bottom: 32px;
  width: 17px;
  height: 1px;
  background: rgba(135, 148, 138, 0.32);
  box-shadow: 0 -42px 0 rgba(135, 148, 138, 0.23), 0 -81px 0 rgba(135, 148, 138, 0.2);
  content: '';
}

.beaker-rim {
  position: absolute;
  top: 3px;
  left: 8px;
  z-index: 2;
  width: 108px;
  height: 19px;
  border: 2px solid #9ba89c;
  border-radius: 50%;
  background: rgba(245, 248, 240, 0.55);
}

.liquid {
  position: absolute;
  right: 2px;
  bottom: 2px;
  left: 2px;
  height: 0;
  border-radius: 0 0 20px 20px;
  background: linear-gradient(135deg, var(--liquid-color), var(--liquid-deep));
  box-shadow: 0 -5px 10px rgba(255, 255, 255, 0.23) inset;
  transition: height 650ms cubic-bezier(0.22, 1, 0.36, 1), background 400ms ease;
}

.liquid::before {
  position: absolute;
  top: -4px;
  right: -5%;
  width: 110%;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  content: '';
}

.liquid-shine {
  position: absolute;
  top: 28px;
  left: 14px;
  z-index: 1;
  width: 5px;
  height: 61px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  transform: rotate(5deg);
  pointer-events: none;
}

.beaker-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 13px;
  text-align: center;
}

.beaker-label strong {
  font-size: 11px;
}

.beaker-label span {
  margin-top: 5px;
  color: #7f8b81;
  font-family: var(--mono);
  font-size: 9px;
}

.mixing-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 35px;
  color: #8e9b90;
}

.mixing-line {
  width: 1px;
  height: 30px;
  background: #c3cbc1;
}

.mixing-plus {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 19px;
  line-height: 1;
}

.mixing-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.visual-footnote {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 15px;
  border-top: 1px solid rgba(156, 169, 156, 0.33);
  color: #7f8b81;
  font-size: 9px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  margin-left: 5px;
}

.original-dot { background: var(--amber); }
.water-dot { background: #a4b6a9; }

.visual-footnote-divider {
  width: 1px;
  height: 13px;
  margin: 0 5px;
  background: rgba(156, 169, 156, 0.45);
}

.process-card {
  margin-top: 18px;
  padding: 22px 25px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
}

.process-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.process-toggle span {
  color: var(--amber);
  font-size: 14px;
  transition: transform 200ms ease;
}

.process-toggle[aria-expanded='true'] span {
  transform: rotate(180deg);
}

.process-panel {
  margin-top: 21px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
}

.process-empty {
  margin: 0;
  color: #8a9289;
  font-size: 11px;
  line-height: 1.8;
}

.process-steps {
  display: grid;
  gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-step {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 11px;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  color: var(--moss);
  background: #edf2ea;
  font-family: var(--mono);
  font-size: 9px;
}

.process-step p {
  margin: 2px 0 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.process-step code,
.formula-strip {
  color: #7e8a80;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
  white-space: normal;
}

.formula-strip {
  margin-top: 18px;
  padding: 13px 14px;
  border-left: 2px solid var(--amber);
  color: var(--moss-dark);
  background: #f6f2e5;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 19px 0 25px;
  border-top: 1px solid rgba(201, 206, 196, 0.72);
  color: #98a198;
  font-size: 9px;
  letter-spacing: 0.08em;
}

@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: minmax(280px, 0.8fr) minmax(460px, 1.2fr);
  }

  .input-panel,
  .result-panel {
    padding: 28px;
  }

  .visual-card {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (max-width: 800px) {
  .app-shell {
    width: min(100% - 36px, 650px);
  }

  main {
    padding: 54px 0 68px;
  }

  .hero {
    margin-bottom: 40px;
  }

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

  .input-panel,
  .result-panel {
    padding: 25px;
  }
}

@media (max-width: 500px) {
  .app-shell {
    width: min(100% - 24px, 420px);
  }

  .topbar {
    min-height: 70px;
  }

  .topbar-status {
    font-size: 8px;
  }

  main {
    padding-top: 42px;
  }

  h1 {
    font-size: clamp(41px, 13vw, 59px);
  }

  .hero-copy {
    font-size: 13px;
  }

  .hero-copy br {
    display: none;
  }

  .input-panel,
  .result-panel {
    padding: 21px 18px;
  }

  .field-group label {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .result-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .result-card {
    min-height: 0;
    padding: 13px 14px;
  }

  .result-number {
    margin-top: 9px;
  }

  .result-card p {
    display: none;
  }

  .result-card-label {
    justify-content: space-between;
  }

  .result-card-label::after {
    color: #8a9289;
    content: 'g';
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 400;
  }

  .result-number span {
    display: none;
  }

  .result-number strong {
    font-size: 24px;
  }

  .visual-card {
    padding: 21px 13px 16px;
  }

  .visual-caption {
    display: none;
  }

  .beaker-stage {
    gap: 4px;
    padding-right: 0;
    padding-left: 0;
  }

  .beaker-column {
    min-width: 111px;
    transform: scale(0.9);
  }

  .mixing-indicator {
    width: 30px;
  }

  .visual-footnote {
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.7;
  }

  .visual-footnote-divider {
    margin-right: 0;
  }

  .process-card {
    padding: 19px 16px;
  }

  .site-footer {
    font-size: 8px;
  }
}

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