@import url("https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&display=swap");

:root {
  /* Brand palette */
  --black: #000000;
  --gray: #898989;
  --white: #ffffff;
  --mint: #92fe9d;
  --cyan: #00c9ff;
  --gradient: linear-gradient(90deg, #92fe9d 0%, #00c9ff 100%);

  --ink: var(--white);
  --ink-soft: #cfcfcf;
  --muted: var(--gray);
  --paper: var(--black);
  --paper-soft: #0a0a0a;
  --panel: #111111;
  --line: rgba(255, 255, 255, 0.12);
  --header: var(--black);
  --accent: var(--cyan);
  --accent-deep: var(--mint);
  --accent-soft: rgba(0, 201, 255, 0.12);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --radius-sm: 12px;

  /* CircularXX → Satoshi (близкий бесплатный аналог) */
  --font-display: "CircularXX", "Satoshi", "Segoe UI", sans-serif;
  --font-body: "CircularXX", "Satoshi", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  background:
    radial-gradient(900px 480px at 90% -10%, rgba(0, 201, 255, 0.18) 0%, transparent 55%),
    radial-gradient(700px 420px at 0% 0%, rgba(146, 254, 157, 0.12) 0%, transparent 50%),
    var(--black);
  line-height: 1.5;
}

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

img {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.footer-inner,
.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--white);
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--white);
}

.brand-mark::after {
  content: ".";
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  justify-content: flex-end;
}

.nav a {
  padding: 0.35rem 0.15rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray);
  transition: color 0.2s ease;
  position: relative;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: transparent;
  color: var(--white);
}

.nav a[aria-current="page"]::after,
.nav a:hover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15rem;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
}

.hero {
  padding: 4.2rem 0 2.2rem;
  animation: rise 0.7s ease both;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--white);
}

.hero p,
.page-hero p {
  margin: 1rem 0 0;
  max-width: 38rem;
  color: var(--gray);
  font-size: 1.08rem;
  font-weight: 400;
}

.page-hero {
  padding: 2.5rem 0 1.5rem;
  animation: rise 0.55s ease both;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem 0 4rem;
}

.grid-cards.compact {
  padding: 0.5rem 0 2.5rem;
}

.category-block {
  padding-top: 0.5rem;
}

.category-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
}

.cats-jump {
  margin-top: 1.1rem;
  color: var(--gray);
  font-size: 0.95rem;
}

.cats-jump a {
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  border-bottom: 1px solid rgba(0, 201, 255, 0.35);
}

.cats-jump a:hover {
  border-bottom-color: var(--cyan);
}

.calc-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.4rem 1.35rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: rise 0.7s ease both;
}

.calc-card:nth-child(2) { animation-delay: 0.06s; }
.calc-card:nth-child(3) { animation-delay: 0.12s; }
.calc-card:nth-child(4) { animation-delay: 0.18s; }

.calc-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 201, 255, 0.45);
  box-shadow: 0 20px 44px rgba(0, 201, 255, 0.12);
}

.calc-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
}

.calc-card p {
  margin: 0;
  color: var(--gray);
  flex: 1;
  font-weight: 400;
}

.calc-card .cta {
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0.6rem 1.05rem;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: var(--black);
  font-weight: 700;
  font-size: 0.9rem;
}

.layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.1rem;
  padding-bottom: 3.5rem;
  animation: rise 0.65s ease both;
}

.panel {
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.field label {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--gray);
}

.field input,
.field select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0a0a0a;
  color: var(--white);
  font: inherit;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(0, 201, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(0, 201, 255, 0.16);
}

.field select option {
  background: #111;
  color: var(--white);
}

.hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease, opacity 0.2s ease;
}

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

.btn-primary {
  background: var(--gradient);
  color: var(--black);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--gray);
}

.results {
  display: grid;
  gap: 0.75rem;
}

.result-item {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: #0a0a0a;
  border: 1px solid var(--line);
}

.result-item .label {
  display: block;
  font-size: 0.8rem;
  color: var(--gray);
  font-weight: 500;
}

.result-item .value {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--white);
}

.result-item.accent {
  border-color: rgba(0, 201, 255, 0.35);
  background: linear-gradient(135deg, rgba(146, 254, 157, 0.08), rgba(0, 201, 255, 0.1));
}

.result-item.accent .value {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.note {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.calc-shell {
  width: min(420px, 100%);
  margin: 0 auto 3.5rem;
  padding: 1.2rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: rise 0.65s ease both;
}

.display {
  min-height: 5.4rem;
  margin-bottom: 0.9rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--black);
  color: var(--white);
  text-align: right;
  overflow: hidden;
  border: 1px solid var(--line);
}

.display .expression {
  min-height: 1.2rem;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  word-break: break-all;
}

.display .current {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.key {
  appearance: none;
  border: 0;
  min-height: 3.2rem;
  border-radius: var(--radius-sm);
  background: #1a1a1a;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}

.key:hover {
  transform: translateY(-1px);
  background: #242424;
}

.key:active {
  transform: translateY(1px);
}

.key.op {
  background: rgba(0, 201, 255, 0.14);
  color: var(--cyan);
}

.key.util {
  background: #161616;
  color: var(--gray);
}

.key.equals {
  background: var(--gradient);
  color: var(--black);
}

.key.equals:hover {
  filter: brightness(1.06);
}

.key.zero {
  grid-column: span 2;
}

.schedule {
  margin-top: 1rem;
  overflow: auto;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.schedule table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.schedule th,
.schedule td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  color: var(--ink-soft);
}

.schedule th:first-child,
.schedule td:first-child {
  text-align: left;
}

.schedule thead th {
  position: sticky;
  top: 0;
  background: #161616;
  font-weight: 700;
  color: var(--white);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  color: var(--gray);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-inner a {
  font-weight: 600;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-inner a:hover {
  filter: brightness(1.15);
}

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

@media (max-width: 860px) {
  .grid-cards,
  .layout,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    justify-content: flex-start;
  }
}

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