/* ── Reset & Base ───────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --body-bg: #252525;
  --calc-bg: #333;
  --calc-edge: #1c1c1c;

  --lcd-bg: #8fa87a;
  --lcd-shade: #6e8a5a;
  --lcd-text: #141e0c;
  --lcd-dim: #3a5028;

  --key-bg: #4a4a4a;
  --key-hi: #585858;
  --key-shadow: #1a1a1a;

  --key-tvm-bg: #404040;
  --key-mem-bg: #3d4f5a;
  --key-op-bg: #3a3a3a;
  --key-eq-bg: #5a3e14;
  --key-func-bg: #2a4050;
  --key-nav-bg: #383838;
  --key-2nd-bg: #7a6010;
  --key-2nd-act: #c8a030;
  --key-clr-bg: #3a3030;
  --key-num-bg: #484848;
  --key-math-bg: #424242;

  --sec-color: #f5c400;
  --pri-color: #f0f0f0;

  --ws-bg: #1e2e3a;
  --ws-border: #2d4556;

  --accent: #4ac0a0;
  --danger: #e05050;
}

html {
  scroll-behavior: smooth;
}

body {
  height: 100%;
  background: var(--body-bg);
  font-family: 'Space Grotesk', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ── App Shell ──────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(30, 30, 30, 0.8);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  height: 70px;
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo {
  height: 32px;
  width: auto;
  border-radius: 6px;
}

.footer-logo {
  height: 36px;
  width: auto;
  border-radius: 8px;
}

.logo span {
  color: var(--sec-color);
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--sec-color);
}

.nav-cta {
  background: var(--sec-color);
  color: #000;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.nav-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* ── Hero Area ──────────────────────────────────────── */
.hero-area {
  padding: 4rem 1rem;
  display: flex;
  justify-content: center;
  background: radial-gradient(circle at center, #333 0%, #252525 100%);
}

/* ── Page Content ───────────────────────────────────── */
.section-block {
  padding: 8rem 1.5rem;
}

.alt-bg {
  background: #1e1e1e;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header h1,
.section-header h2,
.section-block h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  text-align: center;
  background: linear-gradient(135deg, #fff 0%, #888 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-main-cta {
  text-align: center;
  margin-bottom: 4rem;
  padding: 3rem 2rem;
  background: radial-gradient(circle at center, rgba(255, 182, 0, 0.03), transparent 70%);
  border-radius: 40px;
}

.intro-main-cta h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  color: #fff !important;
  margin-bottom: 1.8rem;
  line-height: 1.2;
  letter-spacing: -1px;
  -webkit-text-fill-color: initial !important;
  background: none !important;
}

.cta-button-main {
  display: inline-block;
  background: var(--sec-color);
  color: #000;
  padding: 1rem 3rem;
  border-radius: 100px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 20px rgba(255, 182, 0, 0.15);
}

.cta-button-main:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 40px rgba(255, 182, 0, 0.3);
  background: #fff;
}

.section-subtitle {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem;
  color: #71717a;
  font-size: 1.1rem;
  line-height: 1.6;
}

.grid-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
  align-items: center;
}

.text-content {
  padding-left: 8rem;
}

.text-content p {
  font-size: 1.15rem;
  color: #a1a1aa;
  line-height: 1.8;
}

/* ── Features Section ──────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 2rem;
}

.feature-card {
  position: relative;
  background: linear-gradient(145deg, #2a2a2a, #222);
  padding: 3rem 2rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-12px);
  border-color: rgba(255, 182, 0, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.feature-icon-wrapper {
  width: 80px;
  height: 80px;
  background: rgba(255, 182, 0, 0.15);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  transition: all 0.4s ease;
  color: var(--sec-color);
}

.feature-icon-wrapper svg {
  filter: drop-shadow(0 0 8px rgba(255, 182, 0, 0.4));
}

.feature-card:hover .feature-icon-wrapper {
  transform: scale(1.1) rotate(5deg);
  background: var(--sec-color);
  color: #000;
  box-shadow: 0 0 25px rgba(255, 182, 0, 0.3);
}

.feature-card h3 {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.feature-card p {
  color: #a1a1aa;
  font-size: 1rem;
  line-height: 1.6;
}

/* ── Split Layout (Stand Out Section) ─────────────── */
.split-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 5rem;
  align-items: center;
  margin-top: 3rem;
}

.split-visual {
  max-width: 420px;
  justify-self: center;
}

.split-visual img {
  width: 100%;
  border-radius: 30px;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5);
}

.split-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.standout-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.item-icon {
  width: 54px;
  height: 54px;
  background: var(--sec-color);
  color: #000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 10px 20px rgba(255, 182, 0, 0.2);
}

.item-text h3 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.item-text p {
  color: #a1a1aa;
  font-size: 1rem;
  line-height: 1.6;
}

/* ── Guide Section ────────────────────────────────── */
.guide-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.guide-step-card {
  background: #252525;
  border-radius: 20px;
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color 0.3s ease;
}

.guide-step-card:hover {
  border-color: var(--sec-color);
}

.step-badge {
  width: 80px;
  height: 80px;
  background: #333;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--sec-color);
  border: 2px solid rgba(255, 182, 0, 0.2);
}

.step-info h4 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.step-info p {
  color: #a1a1aa;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* ── Advanced Grid ────────────────────────────────── */
.advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.adv-card {
  background: linear-gradient(145deg, #2a2a2a, #242424);
  padding: 2.5rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.adv-card:hover {
  transform: translateY(-8px);
  border-color: var(--sec-color);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.adv-icon {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  display: block;
  color: var(--sec-color);
}

.adv-icon svg {
  filter: drop-shadow(0 0 10px rgba(255, 182, 0, 0.5));
}

.adv-card h3 {
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.adv-card p {
  color: #a1a1aa;
  font-size: 1rem;
  line-height: 1.6;
}

.adv-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle at bottom right, rgba(255, 182, 0, 0.1), transparent);
  pointer-events: none;
}

/* ── Testimonials Section ─────────────────────────── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

.testimonial-card {
  background: #262626;
  padding: 3rem 2.5rem;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  position: relative;
}

.testimonial-card:hover {
  transform: translateY(-12px);
  background: #2d2d2d;
  border-color: rgba(255, 182, 0, 0.4);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 182, 0, 0.05);
}

.stars {
  color: var(--sec-color);
  font-size: 1.1rem;
  letter-spacing: 3px;
  filter: drop-shadow(0 0 5px rgba(255, 182, 0, 0.3));
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.user-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 182, 0, 0.2);
}

.user-info strong {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  display: block;
}

.user-info span {
  color: #888;
  font-size: 0.9rem;
  display: block;
  font-weight: 500;
}

.testimonial-card p {
  color: #d4d4d8;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.8;
  position: relative;
}


/* ── CTA Section ─────────────────────────────────── */
.cta-section {
  padding-bottom: 10rem;
}

.cta-banner {
  background: linear-gradient(135deg, #2a2a2a 0%, #151515 100%);
  border-radius: 40px;
  padding: 6rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.cta-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 150%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(255, 182, 0, 0.04), transparent 70%);
  pointer-events: none;
}

.cta-content h2 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  color: #fff;
  font-weight: 900;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, var(--sec-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cta-content p {
  color: #a1a1aa;
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 3rem;
  line-height: 1.7;
}

.cta-button {
  display: inline-block;
  background: var(--sec-color);
  color: #000;
  padding: 1.4rem 4rem;
  border-radius: 100px;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 15px 30px rgba(255, 182, 0, 0.2);
}

.cta-button:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 25px 50px rgba(255, 182, 0, 0.4);
  background: #fff;
}

/* ── Footer ─────────────────────────────────────────── */
.site-footer {
  background: #1a1a1a;
  padding: 4rem 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand p {
  color: #6b7280;
  margin-top: 1rem;
}

.footer-links strong,
.footer-legal strong {
  color: #fff;
  margin-bottom: 1.5rem;
  display: block;
}

.footer-links ul,
.footer-legal ul {
  list-style: none;
}

.footer-links li,
.footer-legal li {
  margin-bottom: 0.75rem;
}

.footer-links a,
.footer-legal a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-legal a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #4b5563;
  font-size: 0.9rem;
}

/* ── Content Media ──────────────────────────────────── */
.content-image {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  max-width: 450px;
  margin: 0 auto;
}

.content-image img {
  width: 100%;
  display: block;
}

.image-caption {
  background: #222;
  color: #6b7280;
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
}

@media (max-width: 900px) {

  .grid-layout,
  .features-grid,
  .guide-steps,
  .content-columns,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}

.calculator {
  width: min(420px, 100%);
  background: linear-gradient(175deg, #3d3d3d, #2a2a2a);
  border: 2px solid var(--calc-edge);
  border-radius: 18px;
  padding: 14px 14px 18px;
  box-shadow:
    0 4px 0 1px #111,
    0 30px 60px rgba(0, 0, 0, .65),
    inset 0 1px 0 rgba(255, 255, 255, .07);
}

@media (max-width: 480px) {
  .calculator {
    border-radius: 0;
    border: none;
    min-height: 100vh;
    padding: 10px 10px 14px;
  }
}

/* ── LCD Display ────────────────────────────────────── */
.display {
  background: linear-gradient(180deg, #9db889 0%, #7e9e6a 100%);
  border: 3px solid var(--lcd-shade);
  border-radius: 8px;
  padding: 10px 14px 12px;
  margin-bottom: 12px;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, .3),
    0 1px 0 rgba(255, 255, 255, .08);
  position: relative;
}

.display-status {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--lcd-dim);
  font-weight: 700;
  text-transform: uppercase;
  min-height: 14px;
  margin-bottom: 4px;
}

.display-expr {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--lcd-dim);
  text-align: right;
  min-height: 14px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-screen {
  display: block;
  width: 100%;
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(2rem, 9vw, 2.6rem);
  font-weight: 400;
  text-align: right;
  color: var(--lcd-text);
  letter-spacing: 0.06em;
  line-height: 1.1;
  word-break: break-all;
}

/* ── Worksheets ─────────────────────────────────────── */
.worksheet {
  background: var(--ws-bg);
  border: 1px solid var(--ws-border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 11px;
  animation: slideDown 180ms ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ws-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ws-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--sec-color);
  text-transform: uppercase;
}

.ws-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

.ws-close:hover {
  color: #fff;
}

.ws-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 9px;
}

.ws-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ws-field--full {
  grid-column: 1 / -1;
}

.ws-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #a8c0cc;
  letter-spacing: 0.03em;
}

.ws-hint {
  font-size: 0.65rem;
  font-weight: 400;
  color: #607080;
  margin-left: 4px;
}

.ws-field input,
.cf-row input {
  background: rgba(0, 0, 0, .35);
  border: 1px solid #2d4556;
  border-radius: 5px;
  color: #e8f4f0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  padding: 5px 8px;
  width: 100%;
  -moz-appearance: textfield;
}

.ws-field input::-webkit-outer-spin-button,
.ws-field input::-webkit-inner-spin-button,
.cf-row input::-webkit-outer-spin-button,
.cf-row input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.ws-field input:focus,
.cf-row input:focus {
  outline: 2px solid rgba(74, 192, 160, .4);
  border-color: transparent;
}

.ws-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.ws-btn {
  background: linear-gradient(180deg, #1e4060, #142d44);
  border: 1px solid #2d5070;
  border-radius: 6px;
  color: #c8e8f8;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 7px 4px;
  cursor: pointer;
  text-align: center;
  transition: filter 100ms;
}

.ws-btn:hover {
  filter: brightness(1.15);
}

.ws-btn:active {
  filter: brightness(0.9);
}

.ws-btn--wide {
  grid-column: span 2;
}

.ws-btn--green {
  background: linear-gradient(180deg, #1a5040, #0e3028);
  border-color: #2a7060;
  color: #88e8c8;
}

.ws-btn--add {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(180deg, #2a3840, #1a2830);
  border-color: #3a5060;
  color: #88aabb;
  font-size: 0.78rem;
}

.ws-note {
  font-size: 0.66rem;
  color: #506070;
  margin-top: 7px;
  line-height: 1.4;
}

/* CF panel */
.cf-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.cf-cpt-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cf-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
}

.cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 5px;
  align-items: center;
}

.cf-row-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #7090a0;
  white-space: nowrap;
}

.cf-row-freq {
  display: flex;
  align-items: center;
  gap: 3px;
}

.cf-row-freq label {
  font-size: 0.65rem;
  color: #506070;
}

.cf-row-freq input {
  width: 44px !important;
}

.cf-remove {
  background: none;
  border: none;
  color: #604040;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.cf-remove:hover {
  color: var(--danger);
}

/* ── Register Overlay ───────────────────────────────── */
.register-overlay {
  background: linear-gradient(175deg, #1a2f3f, #111e28);
  border: 1px solid #2a4050;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 11px;
  animation: slideDown 150ms ease;
}

.reg-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--sec-color);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.reg-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.reg-btn {
  background: linear-gradient(180deg, #243444, #18262e);
  border: 1px solid #2d4050;
  border-radius: 6px;
  color: #c8e0ec;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  padding: 6px 2px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.reg-btn:hover {
  border-color: var(--accent);
  color: #fff;
}

.reg-btn-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.reg-btn-val {
  font-size: 0.6rem;
  color: #7090a0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 48px;
}

.reg-cancel {
  width: 100%;
  background: none;
  border: 1px solid #2a3540;
  border-radius: 5px;
  color: #607080;
  font-size: 0.75rem;
  padding: 5px;
  cursor: pointer;
}

.reg-cancel:hover {
  color: #aaa;
  border-color: #404f60;
}

/* ── Keypad ─────────────────────────────────────────── */
.keypad {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.krow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.krow-last {
  grid-template-columns: repeat(4, 1fr);
}

/* ── Key base ───────────────────────────────────────── */
.key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 2px 6px;
  height: 54px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 3px 0 var(--key-shadow);
  transition: transform 80ms ease, filter 80ms ease;
  background: linear-gradient(180deg, var(--key-hi) 0%, var(--key-bg) 100%);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.key:hover {
  filter: brightness(1.12);
}

.key:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--key-shadow);
  filter: brightness(0.9);
}

/* secondary label */
.ks {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--sec-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  position: absolute;
  top: 6px;
  white-space: nowrap;
  pointer-events: none;
}

/* primary label */
.kp {
  font-size: 15px;
  font-weight: 700;
  color: var(--pri-color);
  line-height: 1;
  pointer-events: none;
  font-family: 'Space Grotesk', sans-serif;
}

/* ── Key type variants ──────────────────────────────── */
.key-nav {
  --key-bg: var(--key-nav-bg);
  --key-hi: #484848;
}

.key-tvm {
  --key-bg: var(--key-tvm-bg);
  --key-hi: #505050;
}

.key-math {
  --key-bg: var(--key-math-bg);
  --key-hi: #525252;
}

.key-op {
  --key-bg: var(--key-op-bg);
  --key-hi: #484848;
}

.key-num {
  --key-bg: var(--key-num-bg);
  --key-hi: #585858;
}

.key-func {
  --key-bg: var(--key-func-bg);
  --key-hi: #345060;
  border: 1px solid #2d5070;
}

.key-mem {
  --key-bg: var(--key-mem-bg);
  --key-hi: #4d6070;
}

.key-eq {
  --key-bg: var(--key-eq-bg);
  --key-hi: #6a4a18;
}

.key-clr {
  --key-bg: var(--key-clr-bg);
  --key-hi: #4a3838;
}

/* 2ND key */
.key-2nd {
  --key-bg: var(--key-2nd-bg);
  --key-hi: #907020;
}

.key-2nd .kp {
  color: #fff8e0;
  font-size: 16px;
}

.key-2nd.active {
  --key-bg: var(--key-2nd-act);
  --key-hi: #d8b040;
  box-shadow: 0 3px 0 #5a4000, 0 0 10px rgba(200, 160, 48, .5);
}

.key-2nd.active .kp {
  color: #fff;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 380px) {
  .key {
    height: 48px;
  }

  .kp {
    font-size: 13px;
  }

  .ks {
    font-size: 8px;
  }

  .keypad {
    gap: 4px;
  }

  .krow {
    gap: 4px;
  }

  .display-screen {
    font-size: 1.9rem;
  }
}

@media (min-width: 600px) {
  .key {
    height: 58px;
  }

  .kp {
    font-size: 16px;
  }
}

/* ── Extra Responsive Tweaks ──────────────────────── */
@media (max-width: 1024px) {
  .text-content {
    padding-left: 2rem;
  }
  .grid-layout {
    gap: 2rem;
  }
}

@media (max-width: 900px) {
  .grid-layout,
  .split-layout {
    display: flex;
    flex-direction: column;
    gap: 3rem;
  }

  .text-content {
    padding-left: 0;
    text-align: center;
  }
  
  .intro-image,
  .split-visual {
    order: -1; /* Image above text */
    max-width: 500px;
    margin: 0 auto;
  }

  .standout-item {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .item-text {
    text-align: center;
  }

  .intro-main-cta h1 {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }
  
  .cta-banner {
    padding: 4rem 2rem;
  }
}

@media (max-width: 600px) {
  .section-header h1, .section-header h2, .section-block h2 {
    font-size: 1.8rem;
  }
  
  .intro-main-cta {
    padding: 2.5rem 1.5rem;
    margin-bottom: 3rem;
  }
  
  .cta-button-main {
    width: 100%;
    padding: 1rem 1.5rem;
  }
  
  .testimonial-card {
    padding: 2rem 1.5rem;
  }
  
  .footer-spacer {
    display: none;
  }
}