:root {
  --bg: #ffffff;
  --bg-soft: #f2f8fc;
  --text: #0f1b2d;
  --muted: #5d6b80;
  --line: #e2eaf3;
  --blue: #0a6cff;      /* logo body */
  --blue-deep: #0050c8;
  --sky: #8cd1f0;       /* logo outline */
  --cap-side: #d7e3f1;
  --cap-side-2: #bccde2;
  --plate: #e8f0fa;
  --sans: "Be Vietnam Pro", -apple-system, "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 85% 20%, #e6f1ff 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

/* header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: 22px var(--gutter);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.brand img { border-radius: 8px; }
.top__gh { font-size: .95rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.top__gh:hover { color: var(--blue); }

/* hero */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: clamp(24px, 5vw, 64px) var(--gutter);
}
h1 {
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.035em;
  margin: 0 0 18px;
}
h1 span { color: var(--blue); white-space: nowrap; }
.tags { color: var(--muted); font-size: 1.05rem; margin: 0 0 32px; }

.dl {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 18px 34px;
  background: var(--blue);
  color: #fff;
  font-size: 1.15rem; font-weight: 700;
  text-decoration: none;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 12px 28px -10px rgba(10, 108, 255, .55);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.dl:hover { background: var(--blue-deep); transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(10, 108, 255, .65); }
.dl:active { transform: translateY(0); }
.req { font-size: .85rem; color: var(--muted); margin: 14px 0 28px; }

.brew {
  display: flex; align-items: center; gap: 12px;
  max-width: 100%;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit; color: var(--text);
  cursor: pointer; text-align: left;
  transition: border-color .15s ease;
}
.brew:hover { border-color: var(--blue); }
.brew__tag { font-size: .72rem; font-weight: 600; color: var(--blue); background: #fff; border: 1px solid var(--line); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.brew code { font: 500 .8rem/1.4 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brew__copy { font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.brew.is-copied .brew__copy { color: var(--blue); }

/* keyboard scene */
.scene { display: grid; justify-items: center; perspective: 1400px; }
.field {
  position: relative; z-index: 2;
  width: min(100%, 420px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 22px 14px;
  box-shadow: 0 24px 50px -24px rgba(15, 50, 100, .25);
  margin-bottom: -28px;
}
.field__line {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  min-height: 1.25em;
  margin: 0 0 6px;
  white-space: nowrap;
}
.field__line > span::after {
  content: ""; display: inline-block;
  width: 3px; height: .9em; margin-left: 3px; vertical-align: -.1em;
  background: var(--blue); border-radius: 2px;
  animation: blink 1s steps(1) infinite;
}
.field__line .hl { color: var(--blue); }
@keyframes blink { 50% { opacity: 0; } }
.field__keys { margin: 0; font: 500 .8rem/1 var(--mono); color: var(--muted); }
.field__keys b { color: var(--text); letter-spacing: .05em; }

.stage { width: 100%; height: 280px; display: grid; place-items: center; transform-style: preserve-3d; }
.deck {
  --rx: 56deg; --rz: -20deg;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateZ(var(--rz));
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.plate {
  position: absolute; inset: -20px -24px;
  background: var(--plate);
  border: 1px solid #d5e2f2;
  border-radius: 16px;
  box-shadow: 0 50px 60px -30px rgba(15, 50, 100, .35);
  transform: translateZ(-1px);
}
.caps { position: relative; display: flex; gap: 8px; transform-style: preserve-3d; }
.cap {
  --s: clamp(38px, 5vw, 56px);
  --d: 16px;
  position: relative;
  width: var(--s); height: var(--s);
  transform-style: preserve-3d;
  transition: transform .09s ease-out;
}
.cap > i { position: absolute; display: block; }
.cap .t {
  inset: 0;
  transform: translateZ(var(--d));
  background: linear-gradient(160deg, #fff, #f2f6fb);
  border-radius: 8px;
  display: grid; place-items: center;
  font: 600 calc(var(--s) * .36)/1 var(--sans); font-style: normal;
  color: var(--text);
}
.cap .f { left: 0; top: 100%; width: 100%; height: var(--d); transform-origin: top; transform: rotateX(90deg); background: var(--cap-side-2); }
.cap .b { left: 0; bottom: 100%; width: 100%; height: var(--d); transform-origin: bottom; transform: rotateX(-90deg); background: var(--cap-side); }
.cap .r { left: 100%; top: 0; width: var(--d); height: 100%; transform-origin: left; transform: rotateY(-90deg); background: var(--cap-side); }
.cap .l { right: 100%; top: 0; width: var(--d); height: 100%; transform-origin: right; transform: rotateY(90deg); background: var(--cap-side-2); }
.cap.is-down { transform: translateZ(-10px); }
.cap.is-tone .t { color: #fff; background: var(--blue); }
.cap.is-tone .f, .cap.is-tone .l { background: var(--blue-deep); }
.cap.is-tone .b, .cap.is-tone .r { background: #2f80ff; }

/* points */
.points {
  list-style: none;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%; max-width: 1180px;
  margin: 0 auto;
  padding: 8px var(--gutter) 40px;
}
.points li { border-top: 2px solid var(--sky); padding-top: 14px; }
.points b { display: block; font-weight: 700; }
.points span { color: var(--muted); font-size: .95rem; }

.foot { border-top: 1px solid var(--line); padding: 20px var(--gutter); text-align: center; font-size: .85rem; color: var(--muted); }
.foot p { margin: 0; }
.foot a { text-decoration: none; color: var(--blue); }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .hero__copy { display: flex; flex-direction: column; align-items: center; min-width: 0; }
  .brew { width: 100%; }
  h1 { font-size: clamp(1.9rem, 8vw, 3rem); }
  .scene { order: -1; }
  .stage { height: 170px; }
  .hero { gap: 8px; padding-top: 8px; }
  .points { grid-template-columns: 1fr; text-align: center; }
}
@media (max-width: 520px) {
  .deck { scale: .8; }
  .brew__tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
