/* ============================================================
   RedSec — Tomasz Kowalcze
   Offensive Security Landing Page
   style.css
   ============================================================ */

/* --- Custom properties ------------------------------------ */
:root {
  /* Graphite background — dark blue-grey, not pure black */
  --c-bg:          #0b0b0f;
  --c-surface:     #13131a;
  --c-surface-2:   #1a1a23;
  --c-accent:      #c41e1e;
  --c-accent-hi:   #e02222;
  --c-accent-edge: rgba(196, 30, 30, 0.55);
  --c-headline:    #f0ede8;
  --c-sub:         #c8c4be;
  --c-body:        #888893;
  --c-muted:       #4c4c58;
  --c-border:      rgba(255, 255, 255, 0.06);
  --c-border-hi:   rgba(255, 255, 255, 0.11);

  --f-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --f-body:    'Inter', system-ui, -apple-system, sans-serif;

  --ease-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --t-base:     220ms var(--ease-quart);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* --- Body — graphite base --------------------------------- */
body {
  background-color: var(--c-bg);
  color: var(--c-body);
  font-family: var(--f-body);
  min-height: 100dvh;
  overflow: hidden;
  position: relative;

  /* Layered depth gradient — warm red from top, cool blue-grey body */
  background-image:
    radial-gradient(ellipse 130% 65% at 50% -8%,  rgba(196,30,30,0.11)   0%, transparent 55%),
    radial-gradient(ellipse 85%  65% at 12% 105%, rgba(196,30,30,0.07)   0%, transparent 50%),
    radial-gradient(ellipse 75%  55% at 92% 82%,  rgba(30,30,90,0.09)    0%, transparent 50%),
    radial-gradient(ellipse 100% 80% at 50% 50%,  rgba(20,20,35,0.5)     0%, transparent 70%);
}

/* Subtle dot grid — gives depth and "digital ops room" texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
  z-index: 0;
}

/* Vignette — dark edges focus the eye on the centre */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%,
    transparent 45%,
    rgba(5, 5, 8, 0.55) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* --- Phrase field ----------------------------------------- */
.word-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.wf-phrase {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  will-change: transform, opacity;
  opacity: 0;
  transition: opacity 1.6s ease;
}

.wf-phrase.is-visible {
  opacity: var(--phrase-opacity, 0.12);
}

/* Red glow boost when phrase pulses to peak */
.wf-phrase.is-pulsing {
  text-shadow: 0 0 12px rgba(196, 30, 30, 0.32);
  transition:
    opacity 1.6s ease,
    text-shadow 600ms ease;
}

/* --- Ambient glow orbs ------------------------------------ */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.ambient__orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 2.5s ease;
}

.is-loaded .ambient__orb { opacity: 1; }

/* Large halo at top — main red accent */
.ambient__orb--1 {
  width: 1000px;
  height: 660px;
  background: radial-gradient(ellipse, rgba(196,30,30,0.12) 0%, transparent 65%);
  filter: blur(55px);
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
}

/* Bottom-right warm glow */
.ambient__orb--2 {
  width: 700px;
  height: 480px;
  background: radial-gradient(ellipse, rgba(196,30,30,0.07) 0%, transparent 65%);
  filter: blur(75px);
  bottom: -80px;
  right: -80px;
}

/* Bottom-left cool blue accent */
.ambient__orb--3 {
  width: 580px;
  height: 580px;
  background: radial-gradient(ellipse, rgba(30,40,110,0.08) 0%, transparent 65%);
  filter: blur(85px);
  bottom: -40px;
  left: -120px;
}

/* --- Hero ------------------------------------------------- */
.hero {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  min-height: 100vh; /* fallback */
  padding: 2rem 1.5rem;
}


.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 520px;
  width: 100%;
}

/* --- Entrance animation ----------------------------------- */
/* Default (no JS): immediately visible */
.eyebrow,
.headline,
.descriptor,
.rule,
.cta-group,
.qr-block {
  opacity: 1;
  transform: translateY(0);
}

/* JS running: hide elements, set up transitions */
.js-ready .eyebrow,
.js-ready .headline,
.js-ready .descriptor,
.js-ready .rule,
.js-ready .cta-group,
.js-ready .qr-block {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity  750ms ease,
    transform 900ms var(--ease-expo);
}

/* Staggered reveal */
.is-loaded .eyebrow     { opacity:1; transform:translateY(0); transition-delay:  70ms; }
.is-loaded .headline    { opacity:1; transform:translateY(0); transition-delay: 260ms; }
.is-loaded .descriptor  { opacity:1; transform:translateY(0); transition-delay: 350ms; }
.is-loaded .rule        { opacity:1; transform:translateY(0); transition-delay: 440ms; }
.is-loaded .cta-group   { opacity:1; transform:translateY(0); transition-delay: 530ms; }
.is-loaded .qr-block    { opacity:1; transform:translateY(0); transition-delay: 660ms; }

.is-loaded .ambient__orb { opacity: 1; }

/* --- Eyebrow ---------------------------------------------- */
.eyebrow {
  font-family: var(--f-display);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 1.2rem;
}

/* --- Headline --------------------------------------------- */
.headline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.7rem;
}

.headline__brand {
  font-family: var(--f-display);
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--c-headline);
  text-shadow:
    0 0 60px rgba(196,30,30,0.18),
    0 2px 40px rgba(0,0,0,0.5);
}

.headline__red {
  color: var(--c-accent);
  text-shadow:
    0 0 30px rgba(196,30,30,0.50),
    0 0 80px rgba(196,30,30,0.20);
}

.headline__name {
  font-family: var(--f-body);
  font-size: clamp(0.82rem, 2.5vw, 1.1rem);
  font-weight: 300;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--c-sub);
}

/* --- Descriptor ------------------------------------------- */
.descriptor {
  font-family: var(--f-body);
  font-size: clamp(0.86rem, 2.3vw, 0.98rem);
  font-weight: 300;
  line-height: 1.82;
  color: var(--c-body);
  max-width: 360px;
  margin-bottom: 2rem;
}

.br-desktop { display: none; }
@media (min-width: 600px) { .br-desktop { display: inline; } }

/* --- Rule ------------------------------------------------- */
.rule {
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-accent-edge), transparent);
  margin-bottom: 2rem;
}

/* --- CTA buttons ------------------------------------------ */
.cta-group {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.5rem;
  font-family: var(--f-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  min-height: 44px;
  min-width: 120px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--t-base),
    border-color var(--t-base),
    color var(--t-base),
    box-shadow var(--t-base),
    transform 140ms ease;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.04);
  opacity: 0;
  transition: opacity var(--t-base);
}
.btn:hover::after, .btn:focus-visible::after { opacity: 1; }
.btn:active { transform: scale(0.972); }
.btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }

.btn--primary {
  background-color: var(--c-accent);
  border: 1px solid var(--c-accent);
  color: #f5f1ec;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.09),
    0 0 0 rgba(196,30,30,0);
}
.btn--primary:hover, .btn--primary:focus-visible {
  background-color: var(--c-accent-hi);
  border-color: var(--c-accent-hi);
  box-shadow:
    0 0 24px rgba(196,30,30,0.36),
    0 0 60px rgba(196,30,30,0.14),
    inset 0 1px 0 rgba(255,255,255,0.10);
}

.btn--ghost {
  background-color: transparent;
  border: 1px solid var(--c-border-hi);
  color: var(--c-sub);
}
.btn--ghost:hover, .btn--ghost:focus-visible {
  color: var(--c-headline);
  border-color: rgba(196,30,30,0.44);
  box-shadow: 0 0 20px rgba(196,30,30,0.10);
}

.btn__icon { width: 16px; height: 16px; flex-shrink: 0; }

/* --- QR block --------------------------------------------- */
.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.qr-frame {
  position: relative;
  padding: 13px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.qr-frame:hover {
  border-color: rgba(196,30,30,0.24);
  box-shadow: 0 0 32px rgba(196,30,30,0.10);
}

.qr-frame__c {
  position: absolute;
  width: 11px;
  height: 11px;
  border-color: var(--c-accent);
  border-style: solid;
  border-width: 0;
  opacity: 0.72;
  transition: opacity var(--t-base);
}
.qr-frame:hover .qr-frame__c { opacity: 1; }

.qr-frame__c--tl { top: -1px;    left: -1px;  border-top-width: 2px;    border-left-width: 2px;   }
.qr-frame__c--tr { top: -1px;    right: -1px; border-top-width: 2px;    border-right-width: 2px;  }
.qr-frame__c--bl { bottom: -1px; left: -1px;  border-bottom-width: 2px; border-left-width: 2px;   }
.qr-frame__c--br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px;  }

.qr-img {
  display: block;
  width: 140px;
  height: 140px;
  object-fit: contain;
}

.qr-label {
  font-family: var(--f-display);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-muted);
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 380px) {
  .hero { padding: 1.5rem 1rem; }
  .cta-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 240px;
  }
}

/* --- Reduced motion --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js-ready .eyebrow,
  .js-ready .headline,
  .js-ready .descriptor,
  .js-ready .rule,
  .js-ready .cta-group,
  .js-ready .qr-block {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .word-field { display: none; }
}
