/* ============================================================
   OpenFortiMac landing page
   dark terminal / CLI aesthetic
   ============================================================ */

/* ===== Design tokens ===== */
:root {
  /* surfaces */
  --bg: #0c0e12;
  --bg-elevated: #15181d;
  --bg-hover: #1c2026;

  /* text */
  --ink: #e4e1d8;
  --ink-dim: #9ba1a8;
  --ink-dimmer: #5c6166;

  /* strokes */
  --border: #23272d;
  --border-strong: #363b42;

  /* accents */
  --accent: #50fa7b;
  --accent-ink: #052e16;
  --accent-soft: rgba(80, 250, 123, 0.12);
  --accent-glow: rgba(80, 250, 123, 0.25);
  --magenta: #ff79c6;
  --yellow: #f1fa8c;

  /* radii */
  --radius: 6px;
  --radius-sm: 4px;

  /* type */
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ===== Reset & base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: 'ss01', 'ss02', 'cv01', 'cv02';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle grid backdrop, barely visible */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(228, 225, 216, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(228, 225, 216, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 20%, transparent 75%);
}

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ===== Layout helpers ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(12, 14, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: opacity 0.15s ease;
}

.brand:hover {
  opacity: 0.85;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
}

.topbar-nav {
  display: flex;
  gap: 24px;
}

.topbar-link {
  font-size: 13px;
  color: var(--ink-dim);
  transition: color 0.15s ease;
  position: relative;
}

.topbar-link::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 6px;
  height: 1px;
  background: var(--ink-dimmer);
  transform: translateY(-50%);
}

.topbar-link:hover {
  color: var(--accent);
}

.topbar-link:hover::before {
  background: var(--accent);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 88px 0 56px;
}

.prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-dim);
  margin-bottom: 28px;
  opacity: 0;
  animation: rise 0.4s 0.05s ease forwards;
}

.prompt-sm {
  font-size: 12px;
  margin-bottom: 8px;
}

.prompt-sigil {
  color: var(--accent);
  font-weight: 600;
}

.prompt-cmd {
  color: var(--ink);
}

.prompt-mute {
  color: var(--ink-dim);
}

.caret {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  margin-left: 4px;
  animation: blink 1.1s steps(2, jump-none) infinite;
}

.hero h1 {
  font-size: clamp(40px, 6.5vw, 72px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
  max-width: 820px;
}

.h1-line {
  display: block;
  opacity: 0;
  animation: rise 0.5s ease forwards;
}

.h1-line:nth-child(1) {
  animation-delay: 0.15s;
}

.h1-line:nth-child(2) {
  animation-delay: 0.3s;
}

.h1-dim {
  color: var(--ink-dim);
}

.h1-accent {
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
}

.subtitle {
  font-size: 16px;
  color: var(--ink-dim);
  max-width: 640px;
  margin: 0 0 36px;
  line-height: 1.65;
  opacity: 0;
  animation: rise 0.5s 0.45s ease forwards;
}

.inline-link {
  color: var(--ink);
  border-bottom: 1px solid var(--border-strong);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.inline-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== CTA buttons ===== */
.cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  opacity: 0;
  animation: rise 0.5s 0.55s ease forwards;
}

.cta-tight {
  margin-bottom: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  letter-spacing: -0.005em;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-sigil {
  color: inherit;
  font-weight: 700;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #6effa0;
  border-color: #6effa0;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ===== Meta row ===== */
.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-dimmer);
  opacity: 0;
  animation: rise 0.5s 0.7s ease forwards;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-green {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.meta-sep {
  color: var(--border-strong);
}

/* ============================================================
   Showcase (screenshot)
   ============================================================ */
.showcase {
  padding: 32px 0 72px;
}

.shot {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
  max-width: 960px;
  margin: 0 auto;
  position: relative;
  opacity: 0;
  animation: rise 0.6s 0.85s ease forwards;
}

.shot::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 40%, transparent 60%, var(--border-strong) 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.4;
}

.shot img {
  display: block;
  width: 100%;
}

/* ============================================================
   Features
   ============================================================ */
.features {
  padding: 80px 0 100px;
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 700px;
  margin-bottom: 48px;
}

.section-label {
  font-size: 12px;
  color: var(--ink-dimmer);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.section-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  line-height: 1.2;
  color: var(--ink);
}

.section-head p {
  color: var(--ink-dim);
  font-size: 15px;
  margin: 0;
  line-height: 1.65;
}

/* ===== flags list ===== */
.flags {
  border-top: 1px solid var(--border);
}

.flag {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease, padding-left 0.2s ease;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: var(--radius-sm);
}

.flag:hover {
  background: var(--bg-elevated);
  padding-left: 24px;
}

.flag dt {
  color: var(--accent);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.flag dd {
  margin: 0;
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.6;
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

/* ============================================================
   Outro
   ============================================================ */
.outro {
  padding: 90px 0;
  border-top: 1px solid var(--border);
  background:
    radial-gradient(ellipse at center top, var(--accent-soft) 0%, transparent 60%);
}

.outro-inner {
  max-width: 640px;
  text-align: left;
}

.outro h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  line-height: 1.2;
}

.outro p {
  color: var(--ink-dim);
  font-size: 15px;
  margin: 0 0 28px;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 48px;
  color: var(--ink-dimmer);
  font-size: 12px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-col {
  max-width: 540px;
}

.footer-note {
  line-height: 1.65;
  color: var(--ink-dim);
}

.footer-note a {
  color: var(--ink);
  border-bottom: 1px dotted var(--border-strong);
  transition: color 0.15s, border-color 0.15s;
}

.footer-note a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--ink-dim);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

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

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .hero { padding: 56px 0 36px; }
  .showcase { padding: 20px 0 56px; }
  .features { padding: 56px 0 64px; }
  .outro { padding: 64px 0; }

  .flag {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px 16px;
  }

  .flag:hover {
    padding-left: 16px;
  }

  .topbar-nav {
    gap: 18px;
  }

  .topbar-link::before {
    display: none;
  }

  .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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

  .caret {
    opacity: 1;
  }
}