/* ═══════════════════════════════════════════════════
   RedSkill.org — Apple/Linear Design System
   Calm near-black grid, precise spacing, restrained surfaces.
   RedSkill red is reserved for primary actions and risk.
   ═══════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* Surface scale */
  --bg: #09090B;
  --bg-2: #0E0E12;
  --surface: #15151A;
  --surface-2: #1B1B21;
  --surface-3: #24242B;

  /* Text */
  --text: #F7F7F8;
  --white: #FFFFFF;
  --black: #000000;
  --text-soft: #D7D7DE;
  --muted: #B9B9C1;
  --muted-2: #9C9CA8;
  --lead: #C8C8D0;
  --case-text: #C0C0C8;
  --copy-text: #FFFFFF;
  --source-text: #E6B85C;
  --notice-text: #F3D99A;

  /* Borders */
  --line: rgba(var(--white-rgb), 0.095);
  --line-2: rgba(var(--white-rgb), 0.16);

  /* Brand — RedSkill red */
  --accent: #FF4D5E;
  --accent-light: #FF7A86;
  --coral: #FF4D5E;
  --coral-light: #FF7A86;
  --accent-bg: rgba(255, 77, 94, 0.10);

  /* Gold — warning / source metadata */
  --amber: #E6B85C;
  --amber-soft: #F1CA75;
  --gold: #E6B85C;
  --gold-soft: #F1CA75;
  --gold-bg: rgba(230, 184, 92, 0.10);

  /* Mint — safe status */
  --teal: #6DD6B3;
  --teal-soft: #92E0C5;
  --teal-bg: rgba(109, 214, 179, 0.10);

  /* Violet — subtle contrast */
  --violet: #A78BFA;
  --violet-bg: rgba(167, 139, 250, 0.10);

  /* RGB helpers */
  --bg-rgb: 9, 9, 11;
  --text-rgb: 247, 247, 248;
  --accent-rgb: 255, 77, 94;
  --coral-rgb: 255, 77, 94;
  --amber-rgb: 230, 184, 92;
  --gold-rgb: 230, 184, 92;
  --teal-rgb: 109, 214, 179;
  --white-rgb: 255, 255, 255;
  --black-rgb: 0, 0, 0;
  --muted-rgb: 236, 236, 241;

  /* Utility colors */
  --bg-top: #0B0B0E;
  --footer-bg: #070708;
  --terminal-bg: #0B0B0F;
  --input-bg: #18181E;

  /* Spacing — 4px base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Radii */
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Layout */
  --max-width: 1184px;

  /* Typography */
  --sans: "SF Pro Display", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Shadows */
  --shadow-sm: 0 18px 46px rgba(var(--black-rgb), 0.24);
  --shadow-md: 0 30px 90px rgba(var(--black-rgb), 0.36);

  /* Easing */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}


/* ═══════════════════════════════════════════════════
   Reset
   ═══════════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background:
    linear-gradient(180deg, rgba(var(--white-rgb), 0.035), transparent 310px),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 42%, var(--footer-bg) 100%);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  overflow-x: hidden;
}

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

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

img, svg, video {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
}

button { cursor: pointer; }


/* ═══════════════════════════════════════════════════
   Focus ring
   ═══════════════════════════════════════════════════ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
details summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}


/* ═══════════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════════ */

.shell {
  width: min(var(--max-width), calc(100% - var(--space-7)));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: var(--space-2);
  background: var(--accent);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-full);
  z-index: 999;
  font-weight: 700;
}

.skip-link:focus {
  left: var(--space-3);
}


/* ═══════════════════════════════════════════════════
   Typography
   ═══════════════════════════════════════════════════ */

h1, h2, h3 {
  color: var(--text);
  margin: 0;
  font-weight: 650;
}

h1 {
  max-width: 820px;
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

h2 {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

h3 {
  font-size: 1.08rem;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

p {
  line-height: 1.66;
  margin: 0;
}

.eyebrow {
  color: var(--muted-2);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
  margin: 0 0 var(--space-1);
}

.gradient-text {
  color: var(--text);
  background: linear-gradient(135deg, var(--white) 0%, var(--white) 42%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}


/* ═══════════════════════════════════════════════════
   Nav — floating pill on desktop
   ═══════════════════════════════════════════════════ */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  width: 0;
  z-index: 100;
}

.topbar {
  position: sticky;
  top: var(--space-3);
  z-index: 80;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}

.nav {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: 9px 12px 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: rgba(var(--bg-rgb), 0.76);
  box-shadow: 0 16px 48px rgba(var(--black-rgb), 0.22), inset 0 1px 0 rgba(var(--white-rgb), 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand img {
  width: 30px;
  height: 30px;
}

.navlinks,
.footer-links {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
}

.navlinks a,
.footer-links a {
  font-size: 0.84rem;
  color: var(--muted);
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  transition: color 0.45s var(--ease), background 0.45s var(--ease), border-color 0.45s var(--ease);
}

.navlinks a:hover,
.navlinks a:focus-visible,
.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text);
  border-color: var(--line);
  background: rgba(var(--white-rgb), 0.07);
  outline: 2px solid rgba(var(--accent-rgb), 0.26);
}


/* ═══════════════════════════════════════════════════
   Content sections
   ═══════════════════════════════════════════════════ */

.content {
  display: grid;
  gap: 0;
  margin-top: 72px;
}

.section-block {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}


/* ═══════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid var(--line-2);
  background: rgba(var(--white-rgb), 0.055);
  color: var(--text);
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 620;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(var(--white-rgb), 0.055);
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), background 0.5s var(--ease), color 0.5s var(--ease);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.50);
  background: rgba(var(--white-rgb), 0.085);
  outline: 2px solid rgba(var(--accent-rgb), 0.20);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn.primary {
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  color: var(--white);
  border-color: rgba(var(--white-rgb), 0.12);
  box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.18), inset 0 1px 0 rgba(var(--white-rgb), 0.22);
}

.btn.secondary {
  background: rgba(var(--white-rgb), 0.065);
  color: var(--text);
  border-color: var(--line-2);
}

.btn.ghost {
  background: rgba(var(--white-rgb), 0.04);
}


/* ═══════════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════════ */

.card {
  border: 1px solid rgba(var(--white-rgb), 0.10);
  background: linear-gradient(180deg, rgba(var(--white-rgb), 0.058), rgba(var(--white-rgb), 0.032));
  border-radius: var(--radius);
  padding: var(--space-5);
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  min-height: 100%;
  box-shadow: inset 0 1px 0 rgba(var(--white-rgb), 0.052);
}

.card p {
  color: var(--muted);
  line-height: 1.58;
}


/* ═══════════════════════════════════════════════════
   Grids
   ═══════════════════════════════════════════════════ */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

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


/* ═══════════════════════════════════════════════════
   Tags & Badges
   ═══════════════════════════════════════════════════ */

.tag-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(var(--white-rgb), 0.10);
  background: rgba(var(--white-rgb), 0.045);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 500;
}

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

.tag.safe {
  border-color: rgba(var(--teal-rgb), 0.28);
  color: var(--teal-soft);
  background: rgba(var(--teal-rgb), 0.08);
}

.tag.warn {
  border-color: rgba(var(--gold-rgb), 0.28);
  color: var(--gold-soft);
  background: rgba(var(--gold-rgb), 0.075);
}

.tag.risk {
  border-color: rgba(var(--accent-rgb), 0.30);
  color: var(--accent-light);
  background: rgba(var(--accent-rgb), 0.075);
}


/* ═══════════════════════════════════════════════════
   Inputs & Forms
   ═══════════════════════════════════════════════════ */

label {
  display: grid;
  gap: var(--space-2);
  color: var(--text);
  font-weight: 640;
  font-size: 0.9rem;
}

input, select, textarea {
  min-height: 46px;
  width: 100%;
  border: 1px solid rgba(var(--white-rgb), 0.13);
  background: rgba(var(--white-rgb), 0.055);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  outline: none;
  transition: border-color 0.45s var(--ease), box-shadow 0.45s var(--ease), background 0.45s var(--ease);
}

textarea {
  min-height: 116px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(var(--accent-rgb), 0.70);
  background: rgba(var(--white-rgb), 0.075);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14);
}


/* ═══════════════════════════════════════════════════
   Code & Terminal
   ═══════════════════════════════════════════════════ */

pre, code {
  font-family: var(--mono);
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-soft);
  margin: 0;
  padding: var(--space-4);
  font-size: 0.875rem;
  line-height: 1.58;
}

.output-box {
  border: 1px solid rgba(var(--white-rgb), 0.10);
  background: var(--terminal-bg);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
  box-shadow: inset 0 1px 0 rgba(var(--white-rgb), 0.05);
}

.output-box header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 14px var(--space-4);
  border-bottom: 1px solid rgba(var(--white-rgb), 0.09);
  background: rgba(var(--white-rgb), 0.045);
}

.output-box pre {
  max-height: 520px;
  overflow: auto;
}


/* ═══════════════════════════════════════════════════
   Copy buttons
   ═══════════════════════════════════════════════════ */

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.105);
  color: var(--white);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 620;
  white-space: nowrap;
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), background 0.45s var(--ease);
}

.copy-btn:hover,
.copy-btn:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.60);
  background: rgba(var(--accent-rgb), 0.16);
  outline: 2px solid rgba(var(--accent-rgb), 0.24);
  outline-offset: 2px;
}

.copy-btn:active {
  transform: translateY(1px) scale(0.99);
}

.source-btn {
  border-color: rgba(var(--gold-rgb), 0.25);
  background: rgba(var(--gold-rgb), 0.08);
  color: var(--gold);
}

.source-btn:hover,
.source-btn:focus-visible {
  border-color: var(--gold);
  background: rgba(var(--gold-rgb), 0.14);
}


/* ═══════════════════════════════════════════════════
   FAQ
   ═══════════════════════════════════════════════════ */

.faq details {
  border: 1px solid rgba(var(--white-rgb), 0.10);
  background: linear-gradient(180deg, rgba(var(--white-rgb), 0.058), rgba(var(--white-rgb), 0.032));
  border-radius: var(--radius-sm);
  padding: var(--space-5);
  box-shadow: inset 0 1px 0 rgba(var(--white-rgb), 0.052);
}

.faq details + details {
  margin-top: var(--space-3);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.faq p {
  margin-top: var(--space-3);
}


/* ═══════════════════════════════════════════════════
   Toast
   ═══════════════════════════════════════════════════ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(28px);
  opacity: 0;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  font-weight: 600;
  z-index: 200;
  box-shadow: var(--shadow-sm);
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease);
  max-width: calc(100% - var(--space-6));
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ═══════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════ */

.footer {
  padding: var(--space-7) 0 var(--space-8);
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 0;
  background: var(--footer-bg);
}

.footer .shell {
  display: grid;
  gap: var(--space-4);
}

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


/* ═══════════════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════════════ */

.hidden {
  display: none !important;
}


/* ═══════════════════════════════════════════════════
   Responsive — 980px
   ═══════════════════════════════════════════════════ */

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


/* ═══════════════════════════════════════════════════
   Responsive — 760px
   ═══════════════════════════════════════════════════ */

@media (max-width: 760px) {
  .shell {
    width: min(100% - var(--space-6), var(--max-width));
  }

  .content {
    margin-top: 44px;
  }

  .section-block {
    padding: 34px 0;
  }

  .topbar {
    top: 0;
    background: rgba(var(--bg-rgb), 0.86);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .nav {
    min-height: 64px;
    align-items: center;
    flex-direction: row;
    gap: 10px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    background: transparent;
    box-shadow: none;
    padding: 12px 0;
  }

  .navlinks,
  .footer-links {
    gap: 4px;
  }

  .navlinks {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .navlinks::-webkit-scrollbar {
    display: none;
  }

  .footer-links {
    flex-wrap: wrap;
  }

  .navlinks a,
  .footer-links a {
    padding: 7px 9px;
  }

  .footer {
    padding: var(--space-6) 0 var(--space-7);
  }
}


/* ═══════════════════════════════════════════════════
   Responsive — 640px
   ═══════════════════════════════════════════════════ */

@media (max-width: 640px) {
  h1 {
    font-size: 2.55rem;
    letter-spacing: -0.05em;
  }

  h2 {
    font-size: 1.62rem;
  }

  pre {
    font-size: 0.813rem;
  }
}


/* ═══════════════════════════════════════════════════
   Reduced motion
   ═══════════════════════════════════════════════════ */

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