:root {
  --ink: #1c1c1c;
  --paper: #f9f8f6;
  --muted: #6b7280;
  --accent: #816d70;
  --line: rgba(28, 28, 28, .10);
  --line-strong: rgba(28, 28, 28, .40);
  --serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: rgba(129, 109, 112, .22); }

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

.masthead {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 48px;
}
.masthead::after {
  content: "";
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 0;
  height: 1px;
  background: var(--line);
  transform: scaleX(0);
  transform-origin: left;
  animation: hairlineX .9s var(--ease) .05s both;
}
.brand {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .01em;
  animation: fadeIn .8s var(--ease) both;
}
.brand span { color: var(--muted); margin: 0 6px; }
.mast-right {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  animation: trackIn 1.1s var(--ease) .1s both;
}


.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 430px);
  gap: 96px;
  align-items: start;
  padding: 96px 48px 96px;
  flex: 1 1 auto;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 26px;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  animation: fadeIn .8s var(--ease) .1s both;
}

.kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--line-strong);
  flex: 0 0 auto;
  transform: scaleX(0);
  transform-origin: left;
  animation: hairlineX .8s var(--ease) .16s both;
}

h1 {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: clamp(38px, 4.6vw, 56px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -.012em;
}

.standfirst {
  margin: 0;
  max-width: 34em;
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
  animation: fadeUp .8s var(--ease) .34s both;
}

.quote {
  position: relative;
  margin: 56px 0 0;
  padding: 2px 0 2px 24px;
  max-width: 34em;
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
  line-height: 1.7;
  color: var(--ink);
  animation: fadeUp .9s var(--ease) .5s both;
}
.quote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line-strong);
  transform: scaleY(0);
  transform-origin: top;
  animation: hairlineY .9s var(--ease) .5s both;
}
.quote p { margin: 0; }
.panel {
  position: relative;
  padding-top: 34px;
}
.panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--line-strong);
  transform: scaleX(0);
  transform-origin: left;
  animation: hairlineX 1s var(--ease) .1s both;
}
.view { display: none; }
.view.on { display: block; }

.field { margin-bottom: 26px; }

.field label {
  display: block;
  margin-bottom: 9px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .3s var(--ease);
}

.field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  caret-color: var(--accent);
  outline: none;
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .4s var(--ease);
  -webkit-appearance: none;
}

.field input::placeholder { color: rgba(107, 114, 128, .75); }

.field input:hover { border-color: rgba(28, 28, 28, .28); }

.field input:focus {
  border-color: var(--line-strong);
  background: rgba(28, 28, 28, .02);
  box-shadow: inset 0 -1px 0 var(--ink);
}
.field:focus-within label { color: var(--ink); }

.field input.bad { border-color: var(--accent); }

.hint {
  margin: 9px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}

.row { display: flex; align-items: flex-end; gap: 18px; }
.row .field { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.row .btn-link { margin-bottom: 15px; }

.control { position: relative; }
.control input { padding-right: 44px; }

.peek {
  position: absolute;
  right: 6px;
  bottom: 11px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(28, 28, 28, .35);
  cursor: pointer;
  transition: color .3s var(--ease);
}

.peek svg { width: 17px; height: 17px; }
.peek .i-open,
.peek .i-closed {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.peek .i-closed { opacity: 0; transform: scale(.9); }
.peek.on .i-open { opacity: 0; transform: scale(.9); }
.peek.on .i-closed { opacity: 1; transform: scale(1); }
.peek:hover { color: var(--ink); }
.peek.on { color: var(--accent); }

.btn-link {
  position: relative;
  appearance: none;
  border: 0;
  background: none;
  padding: 0 0 3px;
  font: inherit;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: color .3s var(--ease);
}

.btn-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease);
}

.btn-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.btn-link:disabled {
  color: rgba(28, 28, 28, .35);
  cursor: default;
}

.btn-link:disabled::after { display: none; }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  margin-top: 6px;
  padding: 0 28px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease);
}

.btn-primary:hover:not(:disabled) {
  background: var(--paper);
  color: var(--ink);
}

.btn-primary:active:not(:disabled) { opacity: .88; }

.btn-primary:disabled {
  background: transparent;
  border-color: var(--line);
  color: rgba(28, 28, 28, .35);
  cursor: default;
}

.spinner {
  display: none;
  width: 14px;
  height: 14px;
  margin-left: 10px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  animation: spin .7s linear infinite;
}

.btn-primary.is-loading .spinner { display: inline-block; }
.btn-primary.is-loading .btn-text { opacity: .55; }

@keyframes spin { to { transform: rotate(360deg); } }

.result {
  position: relative;
  margin-top: 22px;
  padding: 20px 0 4px 18px;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  line-height: 1.75;
  color: var(--ink);
  word-break: break-word;
  animation: noteIn .5s var(--ease) both;
}
.result::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: currentColor;
  transform: scaleY(0);
  transform-origin: top;
  animation: hairlineY .5s var(--ease) both;
}
.result:empty { display: none; }

.result.ok { color: var(--ink); }

.result.err {
  color: var(--accent);
}

.result code {
  font-family: var(--serif);
  font-style: normal;
  font-size: 15px;
  letter-spacing: .02em;
  padding: 0 2px;
  border-bottom: 1px solid var(--line-strong);
}

.alt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 32px 0 0;
}

.alt .btn-link { margin-right: 20px; }

.foot {
  padding: 26px 48px 40px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: .04em;
  line-height: 1.9;
  color: var(--muted);
}

.foot p { margin: 0; }

.btn-primary:focus-visible,
.btn-link:focus-visible,
.peek:focus-visible,
.field input:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
    padding: 56px 24px 64px;
  }
  .masthead { padding: 20px 24px; }
  .masthead::after { left: 24px; right: 24px; }
  h1 { font-size: clamp(32px, 8vw, 40px); }
  .quote { margin-top: 34px; }
  .foot { padding: 22px 24px 32px; }
}

@media (max-width: 480px) {
  .row { flex-wrap: wrap; gap: 12px; }
  .row .btn-link { margin-bottom: 0; }
  .btn-primary { letter-spacing: .1em; }
}

.reveal { overflow: hidden; margin-bottom: 22px; padding-bottom: .06em; }
.reveal h1 { margin: 0; animation: rise 1s var(--ease) .18s both; }
.reveal.swap h1 { animation: riseSwap .55s var(--ease) both; }
.view.on > *:not(.result) { animation: fadeUp .7s var(--ease) both; }
.view.on > :nth-child(1) { animation-delay: .34s; }
.view.on > :nth-child(2) { animation-delay: .40s; }
.view.on > :nth-child(3) { animation-delay: .46s; }
.view.on > :nth-child(4) { animation-delay: .52s; }
.view.on > :nth-child(5) { animation-delay: .58s; }
.alt { animation: fadeIn .8s var(--ease) .6s both; }
.foot { animation: fadeIn 1s var(--ease) .55s both; }
.btn-primary { transition: background .3s var(--ease), color .3s var(--ease), transform .14s var(--ease); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
@keyframes hairlineX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes hairlineY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes rise { from { transform: translateY(108%); } to { transform: translateY(0); } }
@keyframes riseSwap { from { transform: translateY(105%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes noteIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes trackIn { from { opacity: 0; letter-spacing: .46em; } to { opacity: 1; letter-spacing: .2em; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
}
