:root {
  --bg-1: #f8fbff;
  --bg-2: #eef4ff;
  --bg-3: #ffffff;
  --text: #0f172a;
  --muted: #5f6b7a;
  --line: rgba(148, 163, 184, 0.22);
  --line-strong: rgba(148, 163, 184, 0.35);
  --card: rgba(255, 255, 255, 0.72);
  --card-strong: rgba(255, 255, 255, 0.84);
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-3: #06b6d4;
  --success-bg: rgba(16, 185, 129, 0.08);
  --success-line: rgba(16, 185, 129, 0.2);
  --success-text: #065f46;
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 14px 40px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 28px 70px rgba(15, 23, 42, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 26%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 44%, var(--bg-3) 100%);
}

body {
  position: relative;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.site-shell {
  position: relative;
  z-index: 1;
}

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(37, 99, 235, 0.16), transparent 30%),
    radial-gradient(circle at 82% 10%, rgba(124, 58, 237, 0.12), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(6, 182, 212, 0.08), transparent 30%);
  filter: blur(8px);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent 75%);
}

/* Topbar */
.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 16px 18px 0;
}

.topbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav a,
.footer-links a,
.text-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav a:hover,
.footer-links a:hover,
.text-link:hover {
  color: var(--text);
}

.nav-cta {
  text-decoration: none;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
}

/* Layout */
.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 18px 48px;
}

.page-narrow {
  max-width: 960px;
}

.main-layout,
.ip-grid,
.details-layout,
.bottom-grid,
.article-grid {
  display: grid;
  gap: 22px;
}

.ip-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 22px;
}

.details-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  margin-bottom: 22px;
}

.bottom-grid {
  grid-template-columns: 1fr;
}

.article-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-hero {
  margin-bottom: 24px;
  animation: fadeUp 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Typography */
h1 {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 650;
}

h2 {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

h3 {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

h4 {
  font-weight: 500;
}

.hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(2.2rem, 4.8vw, 3.8rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 650;
  max-width: 10ch;
}

.hero-text {
  margin: 0;
  font-size: 0.985rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 700px;
}

.article-title {
  margin-top: 14px;
  margin-bottom: 10px;
  font-size: clamp(1.85rem, 3.6vw, 2.7rem);
  letter-spacing: -0.03em;
  font-weight: 650;
  line-height: 1.05;
}

.article-summary {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 24px;
  font-weight: 400;
}

/* Hero */
.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  animation: fadeUp 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-copy {
  max-width: 760px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Cards */
.card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
  transform: translateY(0) scale(1);
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.35s ease,
    border-color 0.35s ease,
    opacity 0.35s ease,
    filter 0.35s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.25), rgba(255,255,255,0));
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-hover);
}

.card:hover::before {
  opacity: 0.95;
}

.ip-grid > .card,
.details-layout > .card,
.bottom-grid > .card {
  animation: fadeUp 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ip-grid > .card:nth-child(1) {
  animation-delay: 0.08s;
}

.ip-grid > .card:nth-child(2) {
  animation-delay: 0.14s;
}

.details-layout > .card:nth-child(1) {
  animation-delay: 0.20s;
}

.details-layout > .card:nth-child(2) {
  animation-delay: 0.26s;
}

.bottom-grid > .card:nth-child(1) {
  animation-delay: 0.32s;
}

.hero-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card h2,
.card h3 {
  margin: 0;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.section-head {
  margin-bottom: 16px;
}

.section-head p,
.share-card p,
.article-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #334155;
  font-size: 0.74rem;
  font-weight: 600;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.35s ease,
    border-color 0.35s ease,
    opacity 0.35s ease;
}

.card:hover .badge {
  transform: translateY(-1px);
}

.ip-value {
  margin: 18px 0 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.35rem, 2.8vw, 2.1rem);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.025em;
  word-break: break-word;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.info-box,
.stack-item,
.share-result {
  position: relative;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--card-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
  transform: translateY(0);
  will-change: transform, box-shadow;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.35s ease,
    border-color 0.35s ease,
    opacity 0.35s ease,
    filter 0.35s ease;
}

.info-box:hover,
.stack-item:hover,
.share-result:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.info-box span,
.stack-item span,
.modal-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.info-box strong,
.stack-item strong {
  display: block;
  line-height: 1.65;
  font-size: 0.95rem;
  font-weight: 500;
  word-break: break-word;
}

/* Buttons */
.primary-btn,
.secondary-btn,
.outline-btn,
.icon-btn,
.modal {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.35s ease,
    border-color 0.35s ease,
    opacity 0.35s ease,
    filter 0.35s ease;
  cursor: pointer;
}

.primary-btn:hover,
.secondary-btn:hover,
.outline-btn:hover,
.icon-btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.primary-btn:active,
.secondary-btn:active,
.outline-btn:active,
.icon-btn:active {
  transform: translateY(0) scale(0.99);
}

.primary-btn,
.secondary-btn,
.outline-btn {
  min-height: 46px;
  border-radius: 18px;
  padding: 0 18px;
  font-weight: 600;
}

.primary-btn {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
}

.secondary-btn,
.outline-btn {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-size: 18px;
}

.full-width {
  width: 100%;
}

.shared-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--success-line);
  background: var(--success-bg);
  color: var(--success-text);
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.hidden {
  display: none !important;
}

.modal {
  width: min(100%, 540px);
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
  animation: modalIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-header h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  font-weight: 600;
}

.modal-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.select-input,
.share-result input {
  width: 100%;
  min-height: 50px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  background: #fff;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.select-input:focus,
.share-result input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.expiry-text {
  margin: 0 0 14px;
  color: var(--muted);
}

/* Prose */
.prose-card {
  padding: 30px;
}

.prose h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.28rem;
  font-weight: 600;
}

.prose p,
.prose li {
  color: var(--text);
  line-height: 1.8;
}

.prose ul {
  padding-left: 20px;
}

.prose code {
  background: rgba(15, 23, 42, 0.06);
  padding: 2px 8px;
  border-radius: 8px;
  font-family: ui-monospace, monospace;
}

/* Footer */
.site-footer {
  padding: 4px 18px 24px;
}

.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px 28px;
  align-items: start;
}

.footer-brand {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.footer-text {
  color: var(--muted);
  max-width: 420px;
  line-height: 1.6;
  font-size: 0.92rem;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
  align-content: start;
}

.footer-links a {
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.footer-links a:hover {
  color: var(--text);
}

/* Toast */
.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1100;
  padding: 14px 16px;
  border-radius: 16px;
  background: #0f172a;
  color: white;
  font-weight: 600;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive */
@media (max-width: 980px) {
  .hero,
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .ip-grid,
  .details-layout,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    width: 100%;
  }

  .hero h1 {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 18px 14px 38px;
  }

  .card,
  .modal,
  .prose-card {
    padding: 18px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions > *,
  .nav-cta {
    width: 100%;
  }

  h1 {
    font-size: clamp(1.8rem, 9vw, 2.6rem);
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 2.9rem);
  }

  .ip-value {
    font-size: 1.25rem;
  }

  .nav {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .card:hover,
  .info-box:hover,
  .stack-item:hover,
  .share-result:hover,
  .primary-btn:hover,
  .secondary-btn:hover,
  .outline-btn:hover,
  .icon-btn:hover {
    transform: none !important;
  }
}