:root {
  --bg: #050505;
  --bg-elevated: #0b0b0e;
  --bg-elevated-soft: #111119;
  --text: #f9fafb;
  --muted: #9ca3af;
  --muted-strong: #e5e7eb;
  --accent: #e11d48; /* deep red */
  --accent-soft: rgba(225, 29, 72, 0.12);
  --accent-line: rgba(248, 113, 113, 0.5);
  --border: #262631;
  --border-soft: #1a1a22;
  --radius-lg: 14px;
  --radius-md: 8px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  --max-width: 960px;
  --shadow-soft: 0 0 0 1px #111, 0 16px 32px rgba(0, 0, 0, 0.85);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font-mono);
  background: radial-gradient(circle at top, #15151f 0, #050506 50%, #000 100%);
  color: var(--text);
}

/* Layout */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.1rem;
}

.shell {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  margin: 1.25rem auto 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: radial-gradient(
    circle at top left,
    #15151f 0,
    #06060a 55%,
    #000 100%
  );
  box-shadow: var(--shadow-soft);
  padding: 1.9rem 1.6rem 1.6rem;
  overflow: hidden;
}

/* subtle scanline overlay – toned down */
.shell-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: 0.2;
  background-image: linear-gradient(
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px
  );
  background-size: 100% 2px;
}

/* Header */

.site-header {
  margin: 0 auto;
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.site-logo {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted-strong);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.7);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.site-nav a {
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--muted);
  border-radius: var(--radius-md);
  padding: 0.26rem 0.7rem;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.35);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--muted-strong);
  border-color: var(--border);
  outline: none;
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
  color: var(--muted);
}

.site-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.site-meta-link {
  text-decoration: none;
  color: var(--muted);
  border-bottom: 1px dotted var(--muted);
}

.site-meta-link:hover,
.site-meta-link:focus-visible {
  color: var(--muted-strong);
  border-bottom-color: var(--muted-strong);
  outline: none;
}

/* Theme toggle */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.7);
  color: var(--muted);
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
}

.theme-toggle-icon {
  font-size: 0.85rem;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--muted-strong);
  border-color: #4b5563;
  outline: none;
}

/* Dots */

.dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  border: 1px solid #52525b;
  background: #18181b;
}

.dot--red {
  background: radial-gradient(
    circle at 30% 0%,
    #fecaca 0,
    #ef4444 40%,
    #450a0a 100%
  );
}

.dot--amber {
  background: radial-gradient(
    circle at 30% 0%,
    #fde68a 0,
    #f59e0b 40%,
    #451a03 100%
  );
}

/* Hero */

.hero {
  text-align: left;
  position: relative;
  z-index: 1;
  margin-bottom: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.75);
  margin-bottom: 0.8rem;
}

.hero-title {
  font-size: 1.95rem;
  margin: 0 0 0.4rem;
  line-height: 1.3;
}

.hero-title-accent {
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: block;
  margin-top: 0.25rem;
  color: var(--muted-strong);
}

.hero-sub {
  margin: 0 0 1rem;
  font-size: 0.87rem;
  color: var(--muted);
  max-width: 38rem;
}

.hero-highlight {
  color: var(--muted-strong);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.7);
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    box-shadow 0.18s ease, transform 0.08s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #f97373, var(--accent));
  color: #111827;
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(220, 38, 38, 0.45);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(220, 38, 38, 0.6);
  outline: none;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: #4b5563;
  outline: none;
}

.btn-full {
  width: 100%;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.76rem;
  color: var(--muted);
}

.hero-links-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
}

.hero-links a {
  color: var(--muted-strong);
  text-decoration: none;
  border-bottom: 1px dotted var(--muted-strong);
}

.hero-links a:hover,
.hero-links a:focus-visible {
  border-bottom-style: solid;
  outline: none;
}

.hero-links-sep {
  color: var(--muted);
}

/* Sections */

.section {
  position: relative;
  z-index: 1;
  padding-top: 1.4rem;
  padding-bottom: 1.2rem;
}

.section-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin: 0 0 0.35rem;
  color: var(--muted-strong);
}

.section-sub {
  margin: 0 0 1.1rem;
  font-size: 0.84rem;
  color: var(--muted);
  max-width: 32rem;
}

/* Grid / cards */

.grid {
  display: grid;
  gap: 0.9rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(
    to bottom right,
    var(--bg-elevated-soft),
    #050509
  );
  padding: 0.85rem 0.9rem 0.9rem;
}

.card-title {
  font-size: 0.85rem;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-strong);
}

.card-body {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.card-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: var(--muted-strong);
}

.card-list li + li {
  margin-top: 0.16rem;
}

/* Steps */

.steps-grid {
  margin-bottom: 1.1rem;
}

.card-step {
  position: relative;
  padding-top: 1.25rem;
}

.step-number {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

/* Terminal strip */

.terminal-strip {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: radial-gradient(
    circle at top left,
    #181827 0,
    #050507 55%,
    #000 100%
  );
  padding: 0.65rem 0.75rem 0.7rem;
  font-size: 0.78rem;
  color: var(--muted-strong);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.75);
}

.terminal-strip p {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.terminal-strip pre {
  margin: 0;
  font-family: var(--font-mono);
  white-space: pre;
  overflow-x: auto;
}

/* Area */

.area-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 0.9rem;
}

.area-block {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.7);
  padding: 0.9rem 0.9rem 0.85rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.tag-list span {
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: #050507;
  color: var(--muted-strong);
}

/* Contact */

.section-accent {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: radial-gradient(circle at top, var(--accent-soft), #050508 55%);
  margin-top: 0.6rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 1rem;
  align-items: center;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-link {
  font-size: 0.8rem;
  color: var(--muted-strong);
  text-decoration: none;
  border-bottom: 1px dotted var(--muted-strong);
}

.contact-link:hover,
.contact-link:focus-visible {
  border-bottom-style: solid;
  outline: none;
}

.contact-tip {
  margin: 0.2rem 0 0;
  font-size: 0.74rem;
  color: var(--muted);
}

/* Footer */

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 1.2rem;
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0.1rem 0;
}

.site-footer a {
  color: var(--muted-strong);
  text-decoration: none;
  border-bottom: 1px dotted var(--muted-strong);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  border-bottom-style: solid;
  outline: none;
}

/* Links */

a {
  color: var(--accent);
}

/* Light theme overrides */

:root[data-theme="light"] {
  --bg: #f4f4f5;
  --bg-elevated: #ffffff;
  --bg-elevated-soft: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --muted-strong: #111827;
  --border: #d1d5db;
  --border-soft: #e5e7eb;
  --shadow-soft: 0 0 0 1px rgba(15, 23, 42, 0.06),
    0 16px 32px rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] body {
  background: radial-gradient(
    circle at top,
    #ffffff 0,
    #e5e7eb 50%,
    #d1d5db 100%
  );
}

:root[data-theme="light"] .shell {
  background: radial-gradient(
    circle at top left,
    #ffffff 0,
    #f3f4f6 55%,
    #e5e7eb 100%
  );
}

:root[data-theme="light"] .shell-overlay {
  opacity: 0.08;
}

:root[data-theme="light"] .site-logo {
  background: rgba(255, 255, 255, 0.9);
  border-color: #e5e7eb;
  color: #111827;
}

:root[data-theme="light"] .site-nav a {
  background: rgba(255, 255, 255, 0.9);
  border-color: transparent;
  color: #4b5563;
}

:root[data-theme="light"] .site-nav a:hover,
:root[data-theme="light"] .site-nav a:focus-visible {
  border-color: #d1d5db;
  color: #111827;
}

:root[data-theme="light"] .site-meta-link {
  color: #4b5563;
  border-bottom-color: #d1d5db;
}

:root[data-theme="light"] .site-meta-link:hover,
:root[data-theme="light"] .site-meta-link:focus-visible {
  color: #111827;
  border-bottom-color: #9ca3af;
}

:root[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.9);
  border-color: #d1d5db;
  color: #4b5563;
}

:root[data-theme="light"] .theme-toggle:hover,
:root[data-theme="light"] .theme-toggle:focus-visible {
  border-color: #9ca3af;
  color: #111827;
}

:root[data-theme="light"] .hero-badge {
  background: rgba(255, 255, 255, 0.95);
  border-color: #e5e7eb;
  color: #6b7280;
}

:root[data-theme="light"] .card {
  background: rgba(255, 255, 255, 0.95);
  border-color: #e5e7eb;
}

:root[data-theme="light"] .area-block {
  background: rgba(255, 255, 255, 0.95);
}

:root[data-theme="light"] .tag-list span {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #111827;
}

:root[data-theme="light"] .section-accent {
  background: radial-gradient(
    circle at top,
    rgba(248, 250, 252, 0.96),
    #e5e7eb 80%
  );
  border-color: #e5e7eb;
}

:root[data-theme="light"] .terminal-strip {
  background: rgba(243, 244, 246, 0.98);
  border-color: #e5e7eb;
}

:root[data-theme="light"] .btn-primary {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.35);
}

:root[data-theme="light"] .btn-primary:hover,
:root[data-theme="light"] .btn-primary:focus-visible {
  background: #020617;
  border-color: #020617;
}

:root[data-theme="light"] .btn-ghost {
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  border-color: #e5e7eb;
}

:root[data-theme="light"] .btn-ghost:hover,
:root[data-theme="light"] .btn-ghost:focus-visible {
  border-color: #9ca3af;
}

:root[data-theme="light"] a {
  color: #111827;
}

:root[data-theme="light"] .hero-links a,
:root[data-theme="light"] .site-footer a {
  border-bottom-color: #9ca3af;
}

/* Responsive */

@media (min-width: 960px) {
  .shell,
  .site-header {
    max-width: 75vw;
  }
}

@media (max-width: 820px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .area-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 1.25rem 0.75rem;
  }

  .shell {
    padding: 1.5rem 1.1rem 1.3rem;
  }

  .site-header {
    align-items: flex-start;
  }

  .site-header-right {
    justify-content: flex-start;
  }

  .hero-title {
    font-size: 1.7rem;
  }

  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
