:root {
  --brand: #0f766e;
  --brand-deep: #0b5a54;
  --brand-soft: #d8f3ef;
  --ink: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.08);
  --paper: #f3f7f6;
  --white: #ffffff;
  --radius: 18px;
  --font-display: "Syne", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", sans-serif;
  --max: 1120px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(15, 118, 110, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(56, 189, 248, 0.12), transparent 50%),
    linear-gradient(180deg, #eef6f4 0%, var(--paper) 40%, #e8f1ef 100%);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2rem);
  backdrop-filter: blur(14px);
  background: rgba(238, 246, 244, 0.78);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand img {
  border-radius: 8px;
}

.top nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.top nav a:hover {
  color: var(--brand);
}

.nav-cta {
  color: var(--brand) !important;
  font-weight: 700;
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  min-height: calc(100svh - 64px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  color: var(--brand);
  line-height: 1.05;
  margin-bottom: 0.85rem;
  animation: rise 0.8s ease both;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 3.2vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.9rem;
  animation: rise 0.8s ease 0.08s both;
}

.lead {
  max-width: 32rem;
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 1.6rem;
  animation: rise 0.8s ease 0.16s both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: rise 0.8s ease 0.24s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--brand);
  color: var(--white);
}

.btn.primary:hover {
  background: var(--brand-deep);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(15, 23, 42, 0.16);
}

.btn.ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.hero-visual {
  display: flex;
  justify-content: center;
  animation: float-in 1s ease 0.2s both;
}

.device {
  width: min(100%, 360px);
  aspect-ratio: 9 / 17;
  padding: 14px;
  border-radius: 36px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.55)),
    var(--brand-soft);
  border: 1px solid rgba(15, 118, 110, 0.18);
  box-shadow: 0 30px 60px rgba(15, 118, 110, 0.18);
  animation: bob 6s ease-in-out infinite;
}

.device-screen {
  height: 100%;
  border-radius: 26px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1rem 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.calc-display {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 0.5rem 1.1rem 1rem;
  gap: 0.35rem;
}

.expr {
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 1.2em;
  transition: opacity 0.25s ease;
}

.result {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  padding: 0.75rem;
  background: var(--white);
  border-top: 1px solid var(--line);
}

.calc-keys span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 10px;
  background: #eef2f6;
  font-weight: 600;
  font-size: 0.95rem;
}

.calc-keys .op {
  background: #d9eee9;
  color: var(--brand-deep);
}

.calc-keys .eq {
  background: var(--brand);
  color: var(--white);
}

.calc-keys .wide {
  grid-column: span 2;
}

.modes,
.offline,
.download {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 36rem;
}

.section-head h2,
.offline h2,
.download h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.7rem;
}

.section-head p,
.offline p,
.download > p {
  color: var(--muted);
  font-size: 1.05rem;
}

.mode-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.75rem;
}

.mode-list li {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.25rem;
}

.mode-list strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
}

.mode-list span {
  color: var(--muted);
}

.offline {
  padding-top: 0;
}

.offline-inner {
  padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(14, 116, 144, 0.88)),
    var(--brand);
  color: var(--white);
}

.offline-inner p {
  color: rgba(255, 255, 255, 0.86);
  max-width: 36rem;
  margin-bottom: 1.5rem;
}

.offline-points {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-weight: 500;
}

.offline-points li {
  position: relative;
  padding-left: 1rem;
}

.offline-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #99f6e4;
}

.download {
  text-align: center;
  padding-bottom: 4rem;
}

.download .btn {
  margin: 1.4rem auto 0.9rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.foot {
  border-top: 1px solid var(--line);
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.35);
}

.foot div {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
}

.foot img {
  border-radius: 6px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 2rem;
  }

  .hero-visual {
    order: -1;
  }

  .device {
    width: min(100%, 300px);
  }

  .mode-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .top nav a:not(.nav-cta) {
    display: none;
  }

  .brand-mark {
    font-size: clamp(1.8rem, 9vw, 2.4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
