/* robolab.io — THOCK design system */

/* ---------- fonts (self-hosted, latin subset) ---------- */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/JetBrainsMono-400.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/JetBrainsMono-700.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/SpaceGrotesk-500.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/SpaceGrotesk-700.woff2) format('woff2'); }

:root {
  --bg: #17171a;
  --bg2: #1d1d21;
  --plate: #121215;
  --cream: #ece4d3;
  --cream-hi: #f6f0e2;
  --cream-lo: #d4c9b2;
  --ink: #232326;
  --green: #00d26a;
  --dim: #8a8a92;
  --sans: 'Space Grotesk', "Helvetica Neue", -apple-system, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, "SF Mono", Menlo, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* The 3D switchboard is transform-scaled on mobile but its layout box is
   still 700px wide — clip horizontal overflow so the page can't pan. */
html, body { max-width: 100%; overflow-x: hidden; }
body {
  background:
    radial-gradient(1200px 640px at 50% -12%, rgba(236,228,211,.085), transparent 62%),
    radial-gradient(1000px 560px at 88% 112%, rgba(0,210,106,.06), transparent 60%),
    radial-gradient(800px 500px at -8% 70%, rgba(236,228,211,.03), transparent 55%),
    var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}
/* solder-point dot matrix */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, rgba(236,228,211,.05) 1px, transparent 1.5px);
  background-size: 28px 28px;
  mask-image: radial-gradient(1200px 900px at 50% 20%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(1200px 900px at 50% 20%, black, transparent 80%);
}
/* film grain */
body::after {
  content: ""; position: fixed; inset: -50%; pointer-events: none; z-index: 100;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .045;
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); }
  40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-2%); } 80% { transform: translate(3%,3%); }
}
.mono { font-family: var(--mono); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }
::selection { background: var(--green); color: var(--ink); }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 28px 0 0;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--cream); }
.brand img { width: 46px; height: 46px; }
.brand .t { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand .s { font-size: 11px; color: var(--dim); letter-spacing: .18em; text-transform: uppercase; }
.header-right { display: flex; align-items: center; gap: 10px; }
.back-key {
  font-family: var(--mono);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 16px; height: 40px;
  background: linear-gradient(180deg, var(--cream-hi) 0%, var(--cream) 55%, var(--cream-lo) 100%);
  color: var(--ink); border-radius: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-decoration: none; user-select: none;
  box-shadow: 0 4px 0 #a89c84, 0 6px 2px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .05s ease, box-shadow .05s ease;
}
.back-key:active { transform: translateY(3px); box-shadow: 0 1px 0 #a89c84, 0 2px 1px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.7); }

/* ---------- 3D switch board (the landing page) ---------- */
.tester-zone {
  min-height: calc(100vh - 130px);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
/* the machine, featured large and faint behind the floating board */
.machine-ghost {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%);
  width: min(1250px, 140vh, 98vw); height: auto;
  opacity: .05;
  pointer-events: none; user-select: none;
  animation:
    ghostIn 4s ease-out .4s both,
    ghostKen 30s ease-in-out .4s infinite alternate;
}
@keyframes ghostIn {
  from { opacity: 0; }
  to   { opacity: .05; }
}
@keyframes ghostKen {
  from { transform: translate(-50%, -52%) scale(1) rotate(-.7deg); }
  to   { transform: translate(-48.5%, -53.5%) scale(1.09) rotate(.7deg); }
}
.tester-wrap {
  display: flex; justify-content: center;
  perspective: 1500px; perspective-origin: 50% 26%;
  padding: 40px 0 90px;
}
.tester {
  position: relative; width: 700px; height: 300px;
  transform-style: preserve-3d;
  transform: rotateX(12deg) rotateZ(-2deg) translateZ(-20px);
  animation:
    testerIn 2.6s cubic-bezier(.16, 1, .3, 1) both,
    testerFloat 10s ease-in-out 2.6s infinite alternate;
}
@keyframes testerIn {
  from { transform: rotateX(50deg) rotateZ(-24deg) translateZ(-140px); }
  to   { transform: rotateX(12deg) rotateZ(-2deg) translateZ(-20px); }
}
@keyframes testerFloat {
  from { transform: rotateX(12deg) rotateZ(-2deg) translateZ(-20px); }
  to   { transform: rotateX(16deg) rotateZ(1.5deg) translateZ(-36px); }
}
.tester, .tester * { transform-style: preserve-3d; }
.tester .face { position: absolute; backface-visibility: hidden; }

.base-top {
  inset: 0; border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.02) 55%), #1e1f24;
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 0 40px rgba(0,0,0,.55);
  transform: translateZ(16px);
}
.base-south { left: 10px; right: 10px; bottom: 0; height: 16px; transform-origin: bottom; transform: rotateX(-90deg); background: #101114; border-radius: 0 0 6px 6px; }
.base-east  { top: 10px; bottom: 10px; right: 0; width: 16px; transform-origin: right; transform: rotateY(90deg); background: #0b0c0f; }
.base-west  { top: 10px; bottom: 10px; left: 0; width: 16px; transform-origin: left; transform: rotateY(-90deg); background: #17181c; }
.base-shadow {
  inset: -14px -22px -30px 6px; border-radius: 30px;
  background: rgba(0,0,0,.55); filter: blur(18px);
  transform: translateZ(-6px);
}
.engrave {
  position: absolute; width: 64px; text-align: center;
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: rgba(236,228,211,.55); text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0,0,0,.7);
  white-space: nowrap;
  transition: color .15s ease;
}
.engrave.sel { color: var(--green); }
.base-brand { position: absolute; left: 20px; bottom: 12px; font-family: var(--mono); font-size: 9px; letter-spacing: .2em; color: rgba(236,228,211,.22); text-transform: uppercase; }

.sw { position: absolute; width: 64px; height: 64px; transform: translateZ(16px); cursor: pointer; touch-action: manipulation; }
.hs-top { inset: 0; border-radius: 7px; background: #2a2a30; transform: translateZ(18px); box-shadow: inset 0 0 10px rgba(0,0,0,.6); }
.hs-south { left: 2px; right: 2px; bottom: 0; height: 18px; transform-origin: bottom; transform: rotateX(-90deg); background: #1b1b1f; }
.hs-east { top: 2px; bottom: 2px; right: 0; width: 18px; transform-origin: right; transform: rotateY(90deg); background: #131316; }
.stem {
  left: 22px; top: 22px; width: 20px; height: 20px; border-radius: 4px;
  background: var(--sw); transform: translateZ(30px);
  box-shadow: 0 0 16px var(--sw), inset 0 -2px 4px rgba(0,0,0,.4);
}
.cap {
  position: absolute; left: 3px; top: 3px; width: 58px; height: 58px;
  transform: translateZ(28px);
  transition: transform .06s ease;
}
.sw:hover .cap { transform: translateZ(33px); }
.sw.pressed .cap { transform: translateZ(21px); }
/* cel-shaded caps: flat stepped faces + ink outlines */
.cap .face { border: 1px solid var(--cap-line); }
.cap-top {
  inset: 0; border-radius: 9px;
  background:
    radial-gradient(80% 70% at 35% 30%, rgba(255,255,255,.28), transparent 60%),
    var(--cap-hi);
  transform: translateZ(20px);
  display: flex; align-items: center; justify-content: center;
  color: var(--cap-ink);
}
.cap-top svg { width: 25px; height: 25px; }
.cap-south { left: 1px; right: 1px; bottom: 0; height: 20px; transform-origin: bottom; transform: rotateX(-90deg); background: var(--cap-side); border-radius: 0 0 7px 7px; }
.cap-east { top: 1px; bottom: 1px; right: 0; width: 20px; transform-origin: right; transform: rotateY(90deg); background: var(--cap-side); border-radius: 0 7px 7px 0; }
.cap-north { left: 1px; right: 1px; top: 0; height: 20px; transform-origin: top; transform: rotateX(90deg); background: var(--cap-mid); }
.cap-west { top: 1px; bottom: 1px; left: 0; width: 20px; transform-origin: left; transform: rotateY(-90deg); background: var(--cap-lo); }
.sw.cream { --cap-hi: #f2ebdb; --cap-mid: #ddd2b9; --cap-lo: #c4b799; --cap-side: #a89a7c; --cap-ink: #232326; --cap-line: rgba(46,40,28,.45); }
.sw.green { --cap-hi: #0bd873; --cap-mid: #00b95c; --cap-lo: #00994c; --cap-side: #00813f; --cap-ink: #04130b; --cap-line: rgba(0,60,30,.55); }
.sw.dark  { --cap-hi: #45454d; --cap-mid: #36363d; --cap-lo: #2a2a30; --cap-side: #222227; --cap-ink: #ece4d3; --cap-line: rgba(0,0,0,.6); }
.sw.blurple { --cap-hi: #6a76f6; --cap-mid: #5865f2; --cap-lo: #4450cf; --cap-side: #3842ae; --cap-ink: #eef0ff; --cap-line: rgba(24,28,92,.6); }
.sw.gold  { --cap-hi: #f0cd58; --cap-mid: #ddb83e; --cap-lo: #ba9730; --cap-side: #997c26; --cap-ink: #2b2410; --cap-line: rgba(96,74,12,.55); }

/* ---------- panels (revealed by the board) ---------- */
.panels { padding-bottom: 60px; }
.panel { display: none; scroll-margin-top: 40px; }
.panel.active { display: block; animation: panelIn .45s cubic-bezier(.16, 1, .3, 1); }
@keyframes panelIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.panel-card {
  background: var(--plate);
  border-radius: 18px;
  padding: 40px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.04);
}
.panel-card h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.panel-card p { color: var(--dim); font-size: 15px; line-height: 1.7; max-width: 560px; font-family: "Helvetica Neue", -apple-system, sans-serif; }
.panel-card p + p { margin-top: 10px; }

.key-cta {
  font-family: var(--mono);
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 26px; padding: 0 24px; height: 50px;
  background: linear-gradient(180deg, #2ee88c 0%, var(--green) 55%, #00a854 100%);
  color: #04130b; border-radius: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-decoration: none; user-select: none; border: none; cursor: pointer;
  box-shadow: 0 5px 0 #007a3e, 0 7px 2px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .05s ease, box-shadow .05s ease;
}
.key-cta:active { transform: translateY(4px); box-shadow: 0 1px 0 #007a3e, 0 2px 1px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.4); }

.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 26px; }
.lab-card {
  display: block; padding: 20px; border-radius: 12px;
  background: var(--bg2); border: 1px solid #26262b;
  text-decoration: none; color: var(--cream);
  transition: border-color .12s ease, transform .12s ease;
}
.lab-card:hover { border-color: var(--green); transform: translateY(-2px); }
.lab-card b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.lab-card span { display: block; margin-top: 6px; color: var(--dim); font-size: 12.5px; line-height: 1.5; font-family: "Helvetica Neue", -apple-system, sans-serif; }

.app-showcase { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 26px; }
.app-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 14px;
  background: var(--bg2); border: 1px solid #26262b;
  text-decoration: none; color: var(--cream);
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.app-card:hover { border-color: var(--green); transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.app-card-shot { position: relative; aspect-ratio: 1200 / 630; overflow: hidden; background: #101014; border-bottom: 1px solid #26262b; }
.app-card-shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.app-card:hover .app-card-shot img { transform: scale(1.03); }
.app-card-shot.contain img { object-fit: contain; padding: 8%; }
.app-card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; }
.app-card-title { display: flex; align-items: center; gap: 10px; }
.app-card-title img { width: 28px; height: 28px; border-radius: 7px; }
.app-card-title b { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.app-card p { margin: 0; color: var(--dim); font-size: 13px; line-height: 1.55; font-family: "Helvetica Neue", -apple-system, sans-serif; }
.app-card-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.app-chip { padding: 3px 9px; border-radius: 999px; border: 1px solid #2c2c31; color: var(--dim); font-size: 10.5px; letter-spacing: .06em; }
.app-card-meta .go { margin-left: auto; color: var(--green); font-size: 12px; letter-spacing: .04em; }

.notify-row { display: flex; gap: 12px; margin-top: 26px; max-width: 460px; }
.notify-row input {
  flex: 1; min-width: 0; height: 50px; padding: 0 16px;
  background: var(--bg2); border: 1px solid #2c2c31; border-radius: 10px;
  color: var(--cream); font-family: var(--mono); font-size: 13px;
  outline: none;
}
.notify-row input:focus { border-color: var(--green); }
.notify-row .key-cta { margin-top: 0; }

/* ---------- plate / post list ---------- */
.plate-section { padding-bottom: 20px; }
.plate-label {
  display: flex; align-items: center; gap: 14px;
  color: var(--dim); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  margin-bottom: 22px; font-family: var(--mono);
}
.plate-label::after { content: ""; flex: 1; height: 1px; background: #2c2c31; }
.plate {
  background: var(--plate);
  border-radius: 18px;
  padding: 18px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.04);
  position: relative;
}
.screw { position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a4a52, #222226);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.8); }
.screw::after { content: ""; position: absolute; left: 1px; right: 1px; top: 4px; height: 1.6px; background: #0e0e10; transform: rotate(38deg); }
.screw.tl{top:8px;left:8px} .screw.tr{top:8px;right:8px} .screw.bl{bottom:8px;left:8px} .screw.br{bottom:8px;right:8px}

.switch-row {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 20px; align-items: center;
  padding: 20px 18px; border-radius: 12px;
  text-decoration: none; color: var(--cream);
  transition: background .12s ease, transform .06s ease;
  cursor: pointer;
}
.switch-row + .switch-row { border-top: 1px solid #1e1e23; }
.switch-row:hover { background: var(--bg2); }
.switch-row:active { transform: translateY(2px); }
.switch-row .date { color: var(--dim); font-size: 12px; letter-spacing: .04em; font-family: var(--mono); }
.switch-row .title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.switch-row .excerpt { color: var(--dim); font-size: 13.5px; margin-top: 5px; line-height: 1.5; font-weight: 400; font-family: "Helvetica Neue", -apple-system, sans-serif; }
.stem-ind {
  width: 26px; height: 26px; border-radius: 6px;
  background: #26262b; position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.7);
}
.stem-ind::after {
  content: ""; position: absolute; inset: 7px;
  background: var(--green);
  clip-path: polygon(40% 0, 60% 0, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%);
  opacity: .25; transition: opacity .12s ease;
}
.switch-row:hover .stem-ind::after { opacity: 1; }

/* ---------- article (post pages) ---------- */
.article { max-width: 720px; margin: 0 auto; padding: 64px 0 40px; }
.article .post-date { color: var(--dim); font-size: 12px; letter-spacing: .12em; font-family: var(--mono); text-transform: uppercase; }
.article h1 {
  margin-top: 14px;
  font-size: clamp(30px, 5.4vw, 52px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.05;
}
.article h1::after {
  content: ""; display: block; width: 56px; height: 5px; border-radius: 3px;
  background: var(--green); margin-top: 22px;
}
.post-content { margin-top: 38px; font-family: "Helvetica Neue", -apple-system, sans-serif; }
.post-content p { font-size: 17px; line-height: 1.75; color: #d6cfc0; margin: 0 0 22px; }
.post-content h2 { font-family: var(--sans); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 40px 0 14px; }
.post-content h3 { font-family: var(--sans); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 34px 0 12px; }
.post-content a { color: var(--green); text-decoration: underline; text-decoration-color: rgba(0,210,106,.4); text-underline-offset: 3px; }
.post-content a:hover { text-decoration-color: var(--green); }
.post-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 8px 0 22px; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.post-content ul, .post-content ol { margin: 0 0 22px 24px; font-size: 17px; line-height: 1.75; color: #d6cfc0; }
.post-content blockquote { border-left: 3px solid var(--green); padding-left: 18px; margin: 0 0 22px; color: var(--dim); }
.post-content pre, .post-content code { font-family: var(--mono); font-size: 14px; }
.post-content pre { background: var(--plate); border-radius: 10px; padding: 16px; overflow-x: auto; margin: 0 0 22px; }
.post-content code { background: rgba(255,255,255,.06); border-radius: 4px; padding: 2px 6px; }
.post-content pre code { background: none; padding: 0; }
.post-nav { max-width: 720px; margin: 0 auto; padding-bottom: 30px; }

.ad-container { max-width: 720px; margin: 0 auto; padding: 10px 0 30px; }

/* ---------- footer ---------- */
.site-footer {
  padding: 40px 0 60px; text-align: center;
  color: #55555c; font-size: 11px; letter-spacing: .12em;
  font-family: var(--mono); text-transform: uppercase;
}
.site-footer .robo { display: inline-grid; grid-template-columns: repeat(7, 8px); gap: 1px; margin-bottom: 16px; }
.site-footer .robo i { height: 8px; background: #2e2e33; }
.site-footer .robo i.g { background: var(--green); }
.site-footer .robo i.e { background: transparent; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  .brand img { width: 42px; height: 42px; }
  .tester-zone { min-height: calc(100vh - 110px); }
  .tester-wrap { padding: 0 0 30px; }
  .tester {
    transform: rotateX(12deg) rotateZ(-2deg) translateZ(-20px) scale3d(.5,.5,.5);
    animation-name: testerInMobile, testerFloatMobile;
  }
  @keyframes testerInMobile {
    from { transform: rotateX(50deg) rotateZ(-24deg) translateZ(-140px) scale3d(.5,.5,.5); }
    to   { transform: rotateX(12deg) rotateZ(-2deg) translateZ(-20px) scale3d(.5,.5,.5); }
  }
  @keyframes testerFloatMobile {
    from { transform: rotateX(12deg) rotateZ(-2deg) translateZ(-20px) scale3d(.5,.5,.5); }
    to   { transform: rotateX(16deg) rotateZ(1.5deg) translateZ(-36px) scale3d(.5,.5,.5); }
  }
  .panel-card { padding: 26px 20px; }
  .notify-row { flex-direction: column; }
  .switch-row { grid-template-columns: 1fr; gap: 6px; padding: 18px 14px; }
  .switch-row .date { order: -1; }
  .stem-ind { display: none; }
  .article { padding-top: 40px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::after { animation: none; }
  .tester { animation: none; }
  .panel.active { animation: none; }
  .machine-ghost { animation: none; }
}
