* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  background: #f7f7f5;
  color: #222222;
}

button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px 20px 56px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

/* =========================
   Top Language Dropdown
   ========================= */

.top-language {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.language-label {
  color: #666666;
  font-size: 13px;
  font-weight: 600;
}

.language-select {
  min-width: 104px;
  border: 1px solid #e3e3de;
  background: #ffffff;
  color: #222222;
  padding: 8px 34px 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #555555 50%),
    linear-gradient(135deg, #555555 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  transition:
    background-color 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.language-select:hover {
  background-color: #f4f4f1;
  border-color: #d6d6cf;
}

.language-select:focus {
  border-color: #222222;
  box-shadow: 0 0 0 3px rgba(34, 34, 34, 0.08);
}

.site-name {
  margin-bottom: 14px;
  color: #222222;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e5e5e0;
  color: #666666;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -1.5px;
  color: #111111;
}

.hero p {
  max-width: 720px;
  margin: 0 auto;
  color: #555555;
  font-size: 17px;
  line-height: 1.65;
}

.calculator-section {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 32px 0 42px;
}

.calculator {
  width: 100%;
  max-width: 430px;
  background: #ffffff;
  border: 1px solid #e6e6e0;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.06);
}

.screen {
  background: #f4f4f1;
  border: 1px solid #e2e2dc;
  border-radius: 18px;
  padding: 22px 16px;
  margin-bottom: 16px;
  text-align: right;
}

.screen-label {
  font-size: 13px;
  color: #777777;
  margin-bottom: 8px;
  font-weight: 600;
}

.display {
  font-size: clamp(42px, 9vw, 58px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1px;
  color: #111111;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.screen-unit {
  margin-top: 10px;
  color: #777777;
  font-size: 13px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.key {
  min-height: 62px;
  border: 1px solid #e3e3de;
  border-radius: 16px;
  font-size: 21px;
  font-weight: 700;
  cursor: pointer;
  background: #ffffff;
  color: #222222;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);

  transition:
    transform 0.14s ease,
    background-color 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.key:hover {
  background: #f4f4f1;
  border-color: #d6d6cf;
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.08);
}

.key:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.key:focus-visible {
  outline: 2px solid rgba(34, 34, 34, 0.22);
  outline-offset: 2px;
}

.key.operator {
  background: #f2f2ef;
  color: #111111;
  font-weight: 800;
  border-color: #deded8;
}

.key.operator:hover {
  background: #ebebe6;
  border-color: #d1d1c9;
}

.key.clear {
  background: #fff4f2;
  border-color: #f1d0cb;
  color: #a33a2b;
  font-weight: 800;
}

.key.clear:hover {
  background: #ffecea;
  border-color: #e8bdb7;
}

.key.equal {
  background: #222222;
  border-color: #222222;
  color: #ffffff;
  font-weight: 850;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.13);
}

.key.equal:hover {
  background: #111111;
  border-color: #111111;
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
}

.key.equal:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.14);
}

.key.equal.wide {
  grid-column: span 2;
}

.mobile-hint {
  display: none;
  margin: 14px 0 0;
  text-align: center;
  color: #777777;
  font-size: 13px;
  line-height: 1.5;
}

.result-box {
  margin-top: 16px;
  background: #fafaf8;
  border: 1px solid #e6e6e0;
  border-radius: 16px;
  padding: 14px;
  color: #555555;
  line-height: 1.6;
  font-size: 14px;
  min-height: 72px;
}

.result-box strong {
  color: #111111;
}

.content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin-top: 10px;
}

.faq-card {
  grid-column: 1 / -1;
}

.content-card {
  background: #ffffff;
  border: 1px solid #e6e6e0;
  border-radius: 20px;
  padding: 22px;
  box-shadow: none;
}

.content-card h2 {
  margin: 0 0 12px;
  color: #111111;
  font-size: 22px;
  letter-spacing: -0.3px;
}

.content-card h3 {
  margin: 18px 0 8px;
  color: #222222;
  font-size: 17px;
}

.content-card p,
.content-card li {
  color: #555555;
  line-height: 1.72;
  font-size: 16px;
}

.content-card ul,
.content-card ol {
  padding-left: 22px;
  margin-bottom: 0;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.example {
  background: #fafaf8;
  border: 1px solid #e6e6e0;
  border-radius: 14px;
  padding: 13px;
  color: #555555;
  line-height: 1.5;
}

.example strong {
  color: #111111;
  display: block;
  margin-bottom: 4px;
}

.footer {
  margin-top: 34px;
  text-align: center;
  color: #777777;
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .page {
    max-width: 100%;
    padding: 32px 16px 48px;
  }

  .hero {
    margin-bottom: 22px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero p {
    font-size: 16px;
  }

  .calculator-section {
    margin: 26px 0 34px;
  }

  .calculator {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
  }

  .content {
    grid-template-columns: 1fr;
  }

  .faq-card {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 24px 12px 40px;
  }

  .site-name {
    font-size: 21px;
  }

  .badge {
    font-size: 12px;
    padding: 6px 11px;
  }

  .hero h1 {
    font-size: 32px;
    letter-spacing: -1px;
  }

  .hero p {
    font-size: 15px;
  }

  .calculator {
    padding: 16px;
    border-radius: 22px;
  }

  .screen {
    padding: 20px 14px;
    border-radius: 16px;
    margin-bottom: 14px;
  }

  .display {
    font-size: 44px;
  }

  .keypad {
    gap: 9px;
  }

  .key {
    min-height: 60px;
    border-radius: 15px;
    font-size: 20px;
  }

  .key.equal {
    font-size: 22px;
  }

  .mobile-hint {
    display: block;
  }

  .result-box {
    margin-top: 14px;
    padding: 13px;
    font-size: 14px;
  }

  .content-card {
    padding: 19px;
    border-radius: 18px;
  }

  .content-card h2 {
    font-size: 21px;
  }

  .content-card h3 {
    font-size: 16px;
  }

  .content-card p,
  .content-card li {
    font-size: 15px;
  }

  .example-grid {
    grid-template-columns: 1fr;
  }
}

.top-language {
  margin-bottom: 16px;
}

.language-label {
  font-size: 12px;
}

.language-select {
  min-width: 96px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 12px;
}

@media (max-width: 380px) {
  .page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .calculator {
    padding: 14px;
  }

  .display {
    font-size: 39px;
  }

  .keypad {
    gap: 8px;
  }

  .key {
    min-height: 55px;
    border-radius: 14px;
    font-size: 19px;
  }
}