/* Home page: the hero with the CE-AI demo, and the transfer mock-up.
   Loaded after site.css. */

/* ---------- Hero layout ----------
   Desktop: text on the left, the calculator on the right, sized to the
   window's height so all of it is in view. Phones: the headline, then the
   calculator, then everything else. */
.hero-home { padding: 0; }
.hero-home > .hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 64px;
  grid-template-areas: "head device" "body device";
  grid-template-rows: auto 1fr;
  align-items: start;
  padding-top: 12px; padding-bottom: 40px;
}
.hero-head { grid-area: head; align-self: end; padding-top: 4vh; }
.hero-body { grid-area: body; }
.hero-device { grid-area: device; display: flex; flex-direction: column; align-items: center; padding-bottom: 8px; }
.hero-home h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); max-width: 13em; margin-bottom: .4em; }
.hero-home .lead { margin-bottom: 0; }
.hero-home .ctas { margin: 24px 0; }
@media (max-width: 900px) {
  .hero-home > .hero-grid { grid-template-columns: 1fr; grid-template-areas: "head" "device" "body"; grid-template-rows: none; padding-top: 28px; }
  .hero-head { padding-top: 0; }
  .hero-home h1 { font-size: clamp(1.8rem, 7.4vw, 2.6rem); margin-bottom: .6em; }
  .hero-body { margin-top: 28px; }
}

/* ---------- Demo instructions and controls ---------- */
.demo-panel { border: 1px solid var(--ink-line); border-radius: 8px; padding: 18px 20px; margin-bottom: 18px; max-width: 560px; }
.demo-panel h2 { font-size: 1.05rem; margin-bottom: 4px; color: #fff; }
.demo-panel p { color: #c4cad2; font-size: .95rem; margin-bottom: 8px; }
.demo-panel ul { margin: 0 0 14px; padding-left: 1.1em; color: #c4cad2; font-size: .95rem; }
.demo-panel li { margin: 5px 0; }
.demo-panel kbd { background: #1a2029; border-color: #3a414c; color: #fff; }
.demo-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.demo-controls .btn { color: #fff; border-color: #4a525e; }
.demo-controls .btn.attention { border-color: var(--accent); color: #fff; background: rgba(35, 180, 126, .15); }
.demo-hint { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--accent); background: #161b22; color: #d6dbe1; font-size: .92rem; }
.demo-status { margin: 10px 0 0; font-size: .92rem; color: #c4cad2; min-height: 1.4em; }
.demo-status:empty { display: none; }

/* ---------- The calculator ----------
   Modelled on the graphing calculator CE-AI is built into (no maker names
   or logos): body, screen and every key are placed at positions measured
   from a photo of it, in em, where 1em is 1/24 of the body's width. The
   body is 24em x 56.2em; its width follows the window height on desktop,
   so the whole calculator fits on screen. Flat, matte colours throughout. */
.demo-device {
  /* The body is 56.2em tall and 24em wide, so its height is 2.342 x its
     width. --h is the window height left under the header (61px) and the
     hero's top padding (12px), less a 16px margin at the bottom. */
  --h: calc(100vh - 90px);
  width: min(372px, 92vw, calc(var(--h) / 2.342));
  min-width: 220px;
  container-type: inline-size;
}
@supports (height: 100svh) { .demo-device { --h: calc(100svh - 90px); } }
@media (max-width: 900px) { .demo-device { width: min(372px, calc(100vw - 40px)); } }
.demo-device { position: relative; z-index: 3; }

/* The worksheet the camera photographs: beside the calculator on desktop
   (tucked under its edge), above it on phones. */
.hero-device.has-paper { flex-direction: row; align-items: flex-start; }
.demo-paper { flex: 0 0 auto; position: relative; z-index: 1; margin: 2.2em -36px 0 0; border-radius: 2px; background: #fdfcf7; box-shadow: 0 12px 30px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .35); }
@media (max-width: 900px) {
  .hero-device.has-paper { flex-direction: column; align-items: center; }
  .demo-paper { margin: 0 0 18px; }
}
.demo-device noscript img { display: block; margin: 0 auto; width: 100%; height: auto; }

.calc {
  --blue: #6ec3f0;      /* 2nd functions */
  --green: #a3d24f;     /* ALPHA letters */
  font-size: 15px;
  position: relative; width: 24em; height: 56.2em; margin: 0 auto;
  border-radius: 3.3em;
  background: #171718;
  /* the rounded edge of the case catches a little light */
  box-shadow: inset 0 0 0 .07em #3e3e40, inset .45em 0 .6em -.3em rgba(255,255,255,.1), inset -.45em 0 .6em -.3em rgba(255,255,255,.06), 0 1em 2.2em rgba(0,0,0,.3);
  color: #f2f2f2; font-family: var(--font);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@supports (width: 1cqw) { .calc { font-size: calc(100cqw / 24); } }
.calc { cursor: grab; }
.calc.dragging { cursor: grabbing; }
.calc.camera-on { touch-action: none; }   /* touch drags the calculator while the camera is on */
.calc:focus { outline: none; }
.calc:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.calc-top { position: absolute; left: 0; right: 0; top: 1.2em; text-align: center; line-height: 1; }
.calc-brand { font-weight: 800; font-size: .95em; letter-spacing: .01em; color: #f4f4f4; }
.calc-maker { position: absolute; left: 0; right: 0; top: 87.8em;   /* 54.45em of the calculator */ text-align: center; line-height: 1; font-weight: 700; font-size: .62em; letter-spacing: .14em; text-transform: uppercase; color: #c9cacc; }

/* Screen: a black glass panel around a 4:3 colour LCD */
.bezel { position: absolute; left: 1.35em; top: 3.1em; width: 21.18em; height: 15.44em; border-radius: 1.4em 1.4em 1.6em 1.6em; background: #0f0f10; }
.lcd {
  position: absolute; left: 1.92em; top: 1.18em; width: 17.52em; height: 13.13em;
  display: flex; flex-direction: column; overflow: hidden; background: #fbfbfb; color: #111;
}
.lcd-status {
  flex: 0 0 3.28em; display: flex; align-items: center; justify-content: space-between; gap: .4em;   /* 1.64em of the calculator */
  padding: 0 .7em; border-bottom: .05em solid #c9ccd1; background: #eef0f3;
  font: 700 .5em/1 var(--font); letter-spacing: .02em; color: #35383d; white-space: nowrap;
}
.lcd-modes { overflow: hidden; }
.lcd-battery { flex: 0 0 auto; width: 1.25em; height: 2.1em; border-radius: .2em; background: #4cbb3a; box-shadow: 0 0 0 .14em #2f6f26 inset; }
.lcd-home {
  flex: 1 1 auto; display: grid; grid-template-rows: repeat(10, 1fr); align-items: center;
  padding: 0 .3em;
  font: 500 1.08em/1 var(--mono); font-variant-ligatures: none; letter-spacing: 0;
  white-space: pre;
}
.lcd-row { overflow: hidden; }
.lcd-gfx { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; background: #000; }
.lcd-gfx[hidden] { display: none; }
.bezel-led { display: none; }

/* Keys: matte, at the measured columns and rows. Each key carries its 2nd
   function (blue, left) and ALPHA letter (green, right) printed above it. */
.keys { position: absolute; inset: 0; }
.key {
  position: absolute; display: grid; place-items: center; width: 2.6em; height: 1.86em;
  padding: 0; border: 0; border-radius: .38em;
  font: inherit; font-size: 1em; line-height: 1; color: #fff; cursor: pointer;
  background: #2b2b2d; box-shadow: 0 .09em 0 #0a0a0a;
}
.c1 { left: 2.65em; } .c2 { left: 6.65em; } .c3 { left: 10.7em; } .c4 { left: 14.7em; } .c5 { left: 18.76em; }
.r0 { top: 21.35em; } .r1 { top: 24.73em; } .r2 { top: 27.89em; } .r3 { top: 30.93em; } .r4 { top: 33.97em; }
.r5 { top: 37.24em; } .r6 { top: 40.39em; } .r7 { top: 43.55em; } .r8 { top: 46.65em; } .r9 { top: 49.8em; }
.n6 { top: 40.39em; } .n7 { top: 43.94em; } .n8 { top: 47.55em; } .n9 { top: 51.15em; }
.key-label { font-size: .62em; font-weight: 700; pointer-events: none; }
.key-print {
  position: absolute; left: 50%; bottom: calc(100% + .34em); transform: translateX(-50%);
  display: flex; justify-content: space-between; gap: .45em; min-width: 4.64em;   /* the key's 2.6em */
  font-size: .56em; font-weight: 600; line-height: 1;
  white-space: nowrap; pointer-events: none;
}
.key-print.single { justify-content: center; }
.key-second-label { color: var(--blue); }
.key-letter { color: var(--green); }
.key:hover { filter: brightness(1.15); }
.key.down, .key:active { transform: translateY(.07em); box-shadow: 0 .02em 0 #0a0a0a; }

/* Function row: short light keys */
.key-fn { height: 1.41em; border-radius: .32em; color: #1b1b1d; background: #dfe0e2; box-shadow: 0 .09em 0 #6b6c70; }
.key-fn .key-label { font-size: .5em; }
.key-fn .key-print { bottom: calc(100% + .36em); }

/* 2nd and ALPHA */
.key.key-second { color: #fff; background: #77c0e8; box-shadow: 0 .09em 0 #2d6d93; }
.key.key-alpha { color: #fff; background: #9ec83f; box-shadow: 0 .09em 0 #4f6e17; }

/* Digits: tall light keys; operators and enter: light keys */
.key-num, .key-op, .key-enter { color: #151515; background: #d4d5d8; box-shadow: 0 .09em 0 #6f7175; }
.key-num { height: 2.2em; border-radius: .42em; }
.key-num .key-label { font-size: 1.3em; }
.key-op .key-label { font-size: 1.25em; }
.key-enter .key-label { font-size: .68em; }
.key-num.down, .key-num:active, .key-op.down, .key-op:active, .key-enter.down, .key-enter:active, .key-fn.down, .key-fn:active { box-shadow: 0 .02em 0 #6f7175; }

/* Arrow pad: four light keys in a ring around a dark hub */
.dpad {
  position: absolute; left: 15.35em; top: 24.53em; width: 5.3em; height: 5.3em; border-radius: 50%;
  background:
    linear-gradient(45deg, transparent calc(50% - .2em), #171718 calc(50% - .2em), #171718 calc(50% + .2em), transparent calc(50% + .2em)),
    linear-gradient(-45deg, transparent calc(50% - .2em), #171718 calc(50% - .2em), #171718 calc(50% + .2em), transparent calc(50% + .2em)),
    #dfe0e1;
  box-shadow: 0 .09em 0 #0a0a0a;
}
.arrow { position: absolute; padding: 0; border: 0; font: inherit; font-size: 1em; background: transparent; cursor: pointer; display: grid; place-items: center; }
.arrow::before { content: ""; width: 0; height: 0; border-style: solid; }
.arrow-up, .arrow-down { left: 1.35em; width: 2.6em; height: 1.5em; }
.arrow-left, .arrow-right { top: 1.35em; width: 1.5em; height: 2.6em; }
.arrow-up { top: 0; border-radius: 2.65em 2.65em 0 0 / 1.5em 1.5em 0 0; }
.arrow-down { bottom: 0; border-radius: 0 0 2.65em 2.65em / 0 0 1.5em 1.5em; }
.arrow-left { left: 0; border-radius: 1.5em 0 0 1.5em / 2.65em 0 0 2.65em; }
.arrow-right { right: 0; border-radius: 0 1.5em 1.5em 0 / 0 2.65em 2.65em 0; }
.arrow-up::before { border-width: 0 .3em .32em; border-color: transparent transparent #4a4b4e; }
.arrow-down::before { border-width: .32em .3em 0; border-color: #4a4b4e transparent transparent; }
.arrow-left::before { border-width: .3em .32em .3em 0; border-color: transparent #4a4b4e transparent transparent; }
.arrow-right::before { border-width: .3em 0 .3em .32em; border-color: transparent transparent transparent #4a4b4e; }
.arrow:hover { background: rgba(0, 0, 0, .05); }
.arrow.down, .arrow:active { background: rgba(0, 0, 0, .12); }
.dpad-hub { position: absolute; left: 1.48em; top: 1.48em; width: 2.34em; height: 2.34em; border-radius: 50%; background: #171718; pointer-events: none; }

/* ---------- Transfer band and its mock-up ---------- */
.mini-steps { margin: 20px 0 26px; padding-left: 1.3em; display: grid; gap: 10px; color: #c4cad2; }
.mini-steps li::marker { color: #4cd19d; font-weight: 700; }
.mini-steps li b { color: #fff; }

.mock { border: 1px solid #2d3440; border-radius: 8px; overflow: hidden; background: #161b22; font-size: .88rem; }
.mock-bar { padding: 8px 12px; border-bottom: 1px solid #2d3440; background: #1c212b; }
.mock-url { display: block; padding: 4px 10px; border-radius: 4px; background: #0d1117; color: #9aa3ae; font-size: .82rem; }
.mock-body { padding: 16px; display: grid; gap: 10px; }
.mock-code { color: #9aa3ae; }
.mock-code b { color: #fff; font-family: var(--mono); }
.mock-drop { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px dashed #4a525e; border-radius: 6px; color: #c4cad2; }
.mock-drop svg { width: 20px; height: 20px; fill: none; stroke: #4cd19d; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mock-row { display: grid; grid-template-columns: 1.4fr .8fr .7fr .9fr; gap: 8px; padding: 8px 4px; border-top: 1px solid #262c36; color: #9aa3ae; }
.mock-row b { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.mock-row em { font-style: normal; color: #8cc8ff; }
@media (max-width: 520px) { .mock-row { grid-template-columns: 1.3fr .9fr .9fr; } .mock-row span:nth-of-type(2) { display: none; } }
