/* ============================================
   DevNS.me Landing Page
   Dark terminal-inspired theme
   ============================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-deep: #0b0e17;
  --bg-surface: #111827;
  --bg-card: #151c2e;
  --bg-card-hover: #1a2236;
  --border-subtle: rgba(99, 130, 190, 0.12);
  --border-glow: rgba(99, 130, 190, 0.25);

  --text-primary: #e8ecf4;
  --text-secondary: #8896b3;
  --text-muted: #5a6a8a;

  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.3);
  --accent-green: #10b981;
  --accent-green-dim: rgba(16, 185, 129, 0.15);
  --accent-green-glow: rgba(16, 185, 129, 0.4);
  --accent-purple: #a855f7;
  --accent-purple-dim: rgba(168, 85, 247, 0.15);
  --accent-purple-glow: rgba(168, 85, 247, 0.4);
  --accent-cyan: #06b6d4;
  --accent-cyan-dim: rgba(6, 182, 212, 0.12);
  --accent-orange: #f59e0b;

  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-glow-blue: 0 0 30px rgba(59, 130, 246, 0.15);
  --shadow-glow-green: 0 0 30px rgba(16, 185, 129, 0.12);
  --shadow-glow-purple: 0 0 30px rgba(168, 85, 247, 0.12);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-display);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Background texture --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(168, 85, 247, 0.05), transparent),
    radial-gradient(ellipse 50% 30% at 10% 80%, rgba(16, 185, 129, 0.04), transparent);
  pointer-events: none;
  z-index: 0;
}

/* Noise overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* --- Layout --- */
.page-wrapper {
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(11, 14, 23, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-blue);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo .dot-me {
  color: var(--accent-blue);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

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

.nav-signin {
  color: var(--accent-blue) !important;
  border: 1px solid var(--accent-blue);
  border-radius: 6px;
  padding: 4px 14px;
  transition: background 0.2s, color 0.2s;
}

.nav-signin:hover {
  background: var(--accent-blue);
  color: var(--bg-primary) !important;
}

/* Hamburger button (hidden on desktop) */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
}

/* Logo */
.logo-container {
  margin-bottom: 40px;
  position: relative;
}

.logo-text {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  position: relative;
  display: inline-block;
  color: var(--text-primary);
}

.logo-text .dev {
  color: var(--accent-blue);
}

.logo-text .ns {
  color: var(--accent-blue);
}

.logo-text .dot-me {
  color: var(--accent-blue);
}

/* DNS resolve animation on logo */
.logo-text::after {
  content: '_';
  animation: blink-cursor 1s steps(1) infinite;
  color: var(--text-primary);
  font-weight: 300;
}

@keyframes blink-cursor {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Glow pulse behind logo */
.logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
  animation: glow-pulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* DNS resolution demo */
.dns-resolve-demo {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  overflow: hidden;
  min-height: 1.6em;
}

.dns-resolve-demo .prompt {
  color: var(--accent-green);
}

.dns-resolve-demo .arrow {
  color: var(--accent-purple);
  margin: 0 8px;
}

.dns-resolve-demo .ip {
  color: var(--accent-orange);
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 40px;
}

.hero-tagline strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* CTA Buttons */
.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-blue-glow);
}

.btn-primary:hover {
  background: #4f8ffa;
  box-shadow: 0 4px 24px var(--accent-blue-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-glow);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: float-down 2s ease-in-out infinite;
}

.scroll-indicator svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
}

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

/* --- Sections --- */
section {
  padding: 100px 0;
}

.section-header {
  margin-bottom: 56px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent-green);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-top: 16px;
  max-width: 600px;
  line-height: 1.7;
  font-weight: 300;
}

/* --- Feature Cards (two-column) --- */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--card-accent, var(--accent-blue)), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}

.feature-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card--green { --card-accent: var(--accent-green); }
.feature-card--purple { --card-accent: var(--accent-purple); }
.feature-card--blue { --card-accent: var(--accent-blue); }
.feature-card--cyan { --card-accent: var(--accent-cyan); }

.feature-card--full {
  grid-column: 1 / -1;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.feature-icon--green {
  background: var(--accent-green-dim);
  color: var(--accent-green);
}

.feature-icon--purple {
  background: var(--accent-purple-dim);
  color: var(--accent-purple);
}

.feature-icon--blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
}

.feature-icon--cyan {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.feature-card .feature-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 400;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- Code blocks inside cards --- */
.dns-example {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 2;
  overflow-x: auto;
}

.dns-example .label {
  color: var(--text-muted);
  min-width: 80px;
  display: inline-block;
}

.dns-example .host {
  color: var(--accent-green);
}

.dns-example .arrow-sym {
  color: var(--text-muted);
  margin: 0 8px;
}

.dns-example .ip-val {
  color: var(--accent-orange);
}

/* Inline code badges */
.code-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.code-badge--green {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.code-badge--purple {
  background: var(--accent-purple-dim);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* NS server row */
.ns-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.ns-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ns-row .label {
  color: var(--text-muted);
  font-size: 0.85rem;
  min-width: 80px;
}

.ns-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Stats bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 60px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.stat-value--green { color: var(--accent-green); }
.stat-value--blue { color: var(--accent-blue); }
.stat-value--purple { color: var(--accent-purple); }

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

/* --- HTTPS / Use Cases Section --- */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.use-case-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.25s;
}

.use-case-item:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.use-case-icon {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  margin-top: 8px;
  box-shadow: 0 0 8px var(--accent-cyan);
}

.use-case-item h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.use-case-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Info callout --- */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px;
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-radius: var(--radius-md);
  margin-top: 32px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.callout-icon {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--accent-cyan);
  margin-top: 2px;
}

.callout code {
  font-family: var(--font-mono);
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--accent-cyan);
}

.callout strong {
  color: var(--text-primary);
}

/* --- How It Works --- */
.options-layout {
  margin-top: 12px;
}

.option-block {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 32px;
  background: var(--bg-card);
}

.option-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-blue);
  margin-bottom: 12px;
}

.option-separator {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
}

.option-separator::before,
.option-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.option-separator span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.option-block .step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 23px;
  top: 76px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--border-glow), transparent);
}

.step {
  display: flex;
  gap: 28px;
  position: relative;
  padding: 28px 0;
}

.step:first-child {
  padding-top: 0;
}

.step:last-child {
  padding-bottom: 0;
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-blue);
}

.step-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.step-content a {
  text-decoration: none;
  color: var(--accent-green);
}

.step-content code {
  font-family: var(--font-mono);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--accent-green);
  border: 1px solid var(--border-subtle);
}

/* --- Example Repo Callout --- */
.example-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 32px 40px;
  margin: 0 0 80px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-card);
}

.example-callout h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.example-callout p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}

.example-callout .btn {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .example-callout {
    flex-direction: column;
    text-align: center;
    padding: 28px 24px;
  }
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer a {
  color: var(--accent-blue);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* --- Animations: fade in on scroll --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }
.reveal-d5 { transition-delay: 0.40s; }
.reveal-d6 { transition-delay: 0.48s; }

/* Hero-specific entrance */
.hero .logo-container {
  animation: hero-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero .dns-resolve-demo {
  animation: hero-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.hero .hero-tagline {
  animation: hero-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.hero .hero-cta {
  animation: hero-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .use-cases-grid {
    grid-template-columns: 1fr;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(11, 14, 23, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 24px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-signin {
    display: inline-block;
    text-align: center;
    margin-top: 4px;
  }

  .hero {
    padding: 100px 20px 60px;
    min-height: auto;
  }

  section {
    padding: 60px 0;
  }

  .step {
    gap: 16px;
  }

  .feature-card {
    padding: 24px;
  }

  .dns-example {
    font-size: 0.72rem;
  }

  .ns-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
