/* ==========================================================================
   Rhinofense — landing page styles
   Structure:  1. Tokens  2. Reset/base  3. Primitives  4. Nav  5. Hero
               6. Services  7. Strategy  8. About  9. Contact  10. Footer
               11. Motion  12. Responsive
   ========================================================================== */

/* ---------- 1. Design tokens -------------------------------------------- */
:root {
  /* Surfaces: obsidian base, each step slightly elevated */
  --bg:            #0a0a0b;
  --surface-1:     #0e0f11;
  --surface-2:     #131519;
  --surface-3:     #171a1f;
  --band:          #101216;

  /* Lines */
  --line:          rgba(255, 255, 255, 0.08);
  --line-strong:   rgba(255, 255, 255, 0.16);

  /* Text */
  --text:          #f2f4f6;
  --text-muted:    #a3abb5;
  --text-dim:      #7b848f;

  /* Accent: Rhinofense brand orange (#f47e2b, sampled from the logo) */
  --accent:        #f47e2b;
  --accent-soft:   rgba(244, 126, 43, 0.12);
  --accent-line:   rgba(244, 126, 43, 0.38);
  --accent-ink:    #180a02;
  --titanium:      #c7ced6;

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Rhythm */
  --gutter: 24px;
  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 10px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.68, 0.32, 1);
  --fast: 160ms;
  --mid: 280ms;
}

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

html {
  scroll-behavior: smooth;
  /* keeps anchored sections clear of the sticky bar */
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* `clip` (not `hidden`) keeps the sticky nav working */
}

/* Page-wide atmosphere: muted mesh + fine structural grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 620px at 78% -10%, rgba(244, 126, 43, 0.07), transparent 62%),
    radial-gradient(760px 520px at 8% 12%, rgba(120, 138, 168, 0.045), transparent 60%),
    radial-gradient(1000px 700px at 50% 108%, rgba(244, 126, 43, 0.045), transparent 65%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 120% 85% at 50% 0%, #000 35%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 120% 85% at 50% 0%, #000 35%, transparent 85%);
  pointer-events: none;
}

h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.022em; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
img { max-width: 100%; height: auto; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: 8px;
  transition: top var(--fast) var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---------- 3. Primitives ----------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(72px, 10vw, 130px); position: relative; }
.section--contact { padding-bottom: clamp(80px, 9vw, 120px); }

.section__head { max-width: 640px; margin-inline: auto; text-align: center; margin-bottom: clamp(40px, 5vw, 64px); }
.section__head--left { margin-inline: 0; text-align: left; }

.section__title { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
.section__lede { margin-top: 18px; color: var(--text-muted); font-size: 1.04rem; }

/* Monospace eyebrow — the "structured, secure" signal */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow::before { content: "// "; color: var(--text-dim); }

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

/* Buttons */
.btn {
  --btn-pad-y: 14px;
  --btn-pad-x: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: transform var(--fast) var(--ease), background-color var(--fast) var(--ease),
              border-color var(--fast) var(--ease), box-shadow var(--mid) var(--ease), color var(--fast) var(--ease);
}
.btn--sm { --btn-pad-y: 10px; --btn-pad-x: 18px; font-size: 0.88rem; }
.btn--block { width: 100%; }

.btn--accent {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 0 rgba(244, 126, 43, 0.45);
}
.btn--accent:hover {
  background: #f79352;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(244, 126, 43, 0.55);
}
.btn--accent:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.btn__icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--mid) var(--ease); }
.btn--ghost:hover .btn__icon { transform: translateX(4px); }

/* ---------- 4. Navigation ------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background-color var(--mid) var(--ease), border-color var(--mid) var(--ease),
              backdrop-filter var(--mid) var(--ease);
  padding-top: env(safe-area-inset-top, 0px);
}
/* Solid, blurred plate once the page scrolls */
.nav.is-scrolled {
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__logo {
  display: block;
  height: 32px;
  width: auto;
}
.brand--sm .brand__logo { height: 22px; }

.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__link {
  position: relative;
  font-size: 0.92rem;
  color: var(--text-muted);
  padding-block: 6px;
  transition: color var(--fast) var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--mid) var(--ease);
}
.nav__link:hover { color: var(--text); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }
.nav__link.is-active { color: var(--text); }
.nav__cta { margin-left: 4px; }

/* Mobile toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 42px; height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}
.nav__bar {
  display: block;
  width: 18px; height: 1.5px;
  margin-inline: auto;
  background: var(--text);
  transition: transform var(--mid) var(--ease), opacity var(--fast) var(--ease);
}
.nav__toggle[aria-expanded="true"] .nav__bar:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bar:last-child  { transform: translateY(-3.75px) rotate(-45deg); }

/* ---------- 5. Hero ------------------------------------------------------ */
.hero {
  position: relative;
  padding-top: clamp(72px, 11vw, 132px);
  padding-bottom: clamp(48px, 6vw, 84px);
  overflow: hidden;
}

/* Faint perspective grid — geometric, not "matrix" */
.hero__grid {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 120%;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 110px 110px;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 42%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 42%, #000 0%, transparent 72%);
  pointer-events: none;
}
.hero__glow {
  position: absolute;
  top: -180px; left: 50%;
  width: min(820px, 120vw); height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(244, 126, 43, 0.16), transparent 70%);
  filter: blur(22px);
  pointer-events: none;
}

.hero__inner { position: relative; text-align: center; }
.hero__title {
  font-size: clamp(2.6rem, 7.4vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;   /* avoids a one-word last line */
}
/* Second, quieter line of the headline */
.hero__title-sub {
  display: block;
  margin-top: 20px;
  font-size: clamp(1.1rem, 2.3vw, 1.7rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero__sub {
  max-width: 660px;
  margin: 26px auto 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.6vw, 1.14rem);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 38px;
}

/* ---------- 6. Services -------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;   /* lets the bullet block align across the row */
  padding: 32px 30px 30px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--mid) var(--ease), border-color var(--mid) var(--ease),
              box-shadow var(--mid) var(--ease);
}
/* Accent hairline that wipes across the top edge on hover */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity var(--mid) var(--ease), transform var(--mid) var(--ease);
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-line);
  box-shadow: 0 22px 48px -26px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(244, 126, 43, 0.07);
}
.card:hover::before { opacity: 1; transform: scaleX(1); }

.card__index {
  position: absolute;
  top: 26px; right: 28px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  transition: color var(--mid) var(--ease);
}
.card:hover .card__index { color: var(--accent); }

.card__icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  margin-bottom: 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  transition: border-color var(--mid) var(--ease), background-color var(--mid) var(--ease);
}
.card__icon svg {
  width: 22px; height: 22px;
  fill: none;
  stroke: var(--titanium);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--mid) var(--ease);
}
.card:hover .card__icon { border-color: var(--accent-line); background: var(--accent-soft); }
.card:hover .card__icon svg { stroke: var(--accent); }

.card__title { font-size: 1.24rem; margin-bottom: 12px; }
.card__body { color: var(--text-muted); font-size: 0.97rem; }

.card__list {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
}
.card__list li {
  position: relative;
  padding-left: 20px;
  font-size: 0.89rem;
  color: var(--text-dim);
}
.card__list li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.62em;
  width: 7px; height: 1px;
  background: var(--accent);
}

/* ---------- 7. Section band (used by About) ------------------------------ */
.band {
  background: var(--band);
  border-block: 1px solid var(--line);
  overflow: hidden;
}
/* Angled plate texture — the "armor" cue */
.band__texture {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.022) 0px,
    rgba(255, 255, 255, 0.022) 1px,
    transparent 1px,
    transparent 22px
  );
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}
.band__inner { position: relative; }

/* ---------- 8. About ----------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 72px);
  align-items: center;
}
.about__lede { color: var(--text-muted); margin-top: 18px; }
.about__cta { margin-top: 32px; }
.about__figure { margin: 0; }
.about__image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

/* ---------- 9. Contact --------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
.contact__lede { color: var(--text-muted); margin-top: 18px; }

/* Form — dark inputs, thin outline that lights on focus */
.form {
  padding: clamp(26px, 3.4vw, 38px);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 20px;
}
.field { display: grid; gap: 8px; }
.field__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.field__input {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.96rem;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
              background-color var(--fast) var(--ease);
}
.field__input--area { resize: vertical; min-height: 118px; }
.field__input::placeholder { color: #565e68; }
.field__input:hover { border-color: rgba(255, 255, 255, 0.24); }
.field__input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(244, 126, 43, 0.035);
  box-shadow: 0 0 0 3px rgba(244, 126, 43, 0.12);
}
.field__input[aria-invalid="true"] { border-color: #ff6b6b; }
.field__input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.16); }

.field__error {
  min-height: 0;
  font-size: 0.8rem;
  color: #ff8787;
}
.field__error:empty { display: none; }

.form__status {
  padding: 13px 16px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.9rem;
  text-align: center;
}
.form__status--error {
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.1);
  color: #ff8787;
}

/* ---------- 10. Footer --------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--surface-1);
  padding-block: 34px;
  padding-bottom: calc(34px + env(safe-area-inset-bottom, 0px));
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}
.footer__copy { color: var(--text-dim); font-size: 0.86rem; }
/* ---------- 11. Scroll reveal ------------------------------------------- */
/* Only armed when JS is present, so content never hides without it. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: 70ms; }
.js .reveal[data-delay="2"] { transition-delay: 140ms; }
.js .reveal[data-delay="3"] { transition-delay: 210ms; }
.js .reveal[data-delay="4"] { transition-delay: 280ms; }

/* ---------- 12. Responsive ---------------------------------------------- */
@media (max-width: 960px) {
  .about, .contact { grid-template-columns: 1fr; }
  .about__figure { max-width: 420px; }
}

@media (max-width: 820px) {
  :root { --gutter: 20px; }

  .nav__toggle { display: flex; }

  /* Collapsed panel under the bar */
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px var(--gutter) 22px;
    background: var(--bg);   /* opaque: nothing ghosts through the panel */
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--mid) var(--ease), transform var(--mid) var(--ease), visibility var(--mid);
  }
  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav__link {
    padding: 13px 2px;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .nav__link::after { display: none; }
  .nav__cta { margin: 14px 0 0; }

  .cards { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 auto; }
}

@media (max-width: 540px) {
  .card { padding: 26px 22px; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Motion & print preferences ---------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
