/*
 * agenc-one.com — dark brand, mirrors the AgenC marketplace
 * (tetsuo-ai/agenc-services-storefront). Tokens live in tokens.css.
 */

@import "./tokens.css";

/* Local override: header is taller than the storefront's 72px because
   the agenc.tech-style header has its own top padding + wordmark. */
:root {
  --header-h: 104px;
}
@media (min-width: 768px) {
  :root { --header-h: 132px; }
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle brand gradient layer behind everything. Fixed so all
   frames share the same canvas tint and the scroll-snap panels
   blend into a single surface. */
.brand-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--brand-gradient);
  opacity: 0.22;
}
.brand-layer::before,
.brand-layer::after {
  content: "";
  position: absolute;
  inset: 0;
}
.brand-layer::before { background: var(--brand-gradient-scrim-horiz); }
.brand-layer::after  { background: var(--brand-gradient-scrim-vert); }

/* ===== Entrance ===== */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.feature-card:nth-child(2) { transition-delay: 0.06s; }
.feature-card:nth-child(3) { transition-delay: 0.12s; }
.feature-card:nth-child(4) { transition-delay: 0.04s; }
.feature-card:nth-child(5) { transition-delay: 0.10s; }
.feature-card:nth-child(6) { transition-delay: 0.16s; }

/* ===== Scroll container ===== */
.page-wrapper {
  position: relative;
  z-index: 1;
  height: 100vh;
  padding-top: var(--header-h);
  overflow-y: auto;
  scroll-snap-type: y proximity;
}

.frame {
  min-height: calc(100vh - var(--header-h));
  scroll-snap-align: start;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Photographic background slot used by hero + hardware frames. */
.frame-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.frame-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
}
.frame-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(11, 12, 16, 0.88) 0%,
      rgba(11, 12, 16, 0.62) 22%,
      rgba(11, 12, 16, 0.35) 48%,
      rgba(11, 12, 16, 0.65) 80%,
      rgba(11, 12, 16, 0.92) 100%
    ),
    linear-gradient(
      90deg,
      rgba(11, 12, 16, 0.80) 0%,
      rgba(11, 12, 16, 0.45) 32%,
      rgba(11, 12, 16, 0.15) 60%,
      rgba(11, 12, 16, 0.35) 100%
    );
}

/* ===== Header ===== */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
  padding-top: 24px;
  padding-bottom: 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: padding var(--mid) var(--ease),
              background-color var(--mid) var(--ease),
              backdrop-filter var(--mid) var(--ease),
              border-color var(--mid) var(--ease);
}
@media (min-width: 768px) {
  .header { padding-top: 56px; }
}

/* Scrolled state — blurred dark bar so content underneath has contrast */
.header.scrolled {
  padding-top: 12px;
  padding-bottom: 12px;
  background: rgba(11, 12, 16, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom-color: var(--line-soft);
}
@media (min-width: 768px) {
  .header.scrolled {
    padding-top: 16px;
    padding-bottom: 16px;
  }
}
.header-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--content-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}
.logo-wordmark {
  width: 94px;
  height: auto;
  color: var(--text);
}
@media (min-width: 768px) {
  .logo-wordmark { width: 120px; }
}
/* Backwards-compat for any other surfaces still using old logo classes */
.logo-svg { width: 28px; height: 28px; }
.logo-svg.sm { width: 20px; height: 20px; }
.logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}
.logo-text.sm { font-size: 15px; }

.nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}
@media (max-width: 1023px) {
  .nav { display: none; }
}
.nav-link {
  display: inline-block;
  color: rgba(248, 247, 255, 0.70);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color var(--fast) var(--ease);
}
@media (min-width: 768px) {
  .nav-link { font-size: 14px; }
}
.nav-link:hover { color: var(--text); }

.header-cta {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.30);
  color: rgba(255, 255, 255, 0.95);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--fast) var(--ease);
}
@media (min-width: 768px) {
  .header-cta { font-size: 14px; }
}
@media (max-width: 1023px) {
  .header-cta { display: none; }
}
.header-cta:hover { background: rgba(0, 0, 0, 0.45); }

/* ===== Buttons ===== */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease),
              border-color var(--fast) var(--ease),
              background var(--fast) var(--ease),
              color var(--fast) var(--ease);
}

.btn-primary {
  color: var(--text);
  background: var(--accent);
  box-shadow: var(--glow-soft);
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 18px 3px rgba(186, 99, 239, 0.55);
}

.btn-sm { padding: 10px 18px; }

.btn-outline {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
}
.btn-outline:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
}

/* ===== Common sections ===== */
.section-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-header.center {
  text-align: center;
  align-items: center;
}
.section-label {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(186, 99, 239, 0.22);
  animation: accent-pulse 2.4s var(--ease) infinite;
}

@keyframes accent-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

.section-title {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: balance;
  color: var(--text);
}
.section-desc {
  max-width: 620px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.7;
}

/* ===== Hero ===== */
.frame--hero {
  height: calc(100vh - var(--header-h));
  min-height: calc(100vh - var(--header-h));
  max-height: calc(100vh - var(--header-h));
  overflow: hidden;
  justify-content: flex-start;
}
/* Lock the hero photo to the viewport so it never scrolls — the next
   sections (hardware/features/cta) have their own opaque backgrounds
   that paint over it as the user scrolls past. */
.frame--hero .frame-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.frame--hero .frame-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}
.frame--hero .hero-inner,
.frame--hero .specs-bar {
  position: relative;
  z-index: 1;
}
.hero-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: auto;
  padding: 36px var(--content-pad) 28px;
  display: flex;
  align-items: center;
}
.hero-text {
  max-width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(186, 99, 239, 0.22);
  animation: accent-pulse 2.4s var(--ease) infinite;
}
.badge-label {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 68px;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 700;
  color: var(--text);
}
.hero-sub {
  max-width: 560px;
  color: var(--text-2);
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.specs-bar {
  max-width: var(--max-w);
  width: 100%;
  margin: auto auto 0;
  padding: 16px var(--content-pad) 22px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.spec {
  min-height: 88px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: rgba(16, 17, 22, 0.68);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.spec:hover {
  border-color: var(--line-strong);
  background: rgba(20, 21, 27, 0.78);
}
.spec-val {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.spec-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/* ===== Hardware ===== */
.frame--hardware { overflow: hidden; }
.frame--hardware .hardware {
  position: relative;
  z-index: 1;
}
.hardware {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h));
  padding: 46px var(--content-pad) 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.hardware-header-top { padding-top: 26px; }
.hardware-header-top .section-title { max-width: none; }
.hardware-header-top .section-desc { max-width: 62ch; }

.hardware-legend-intro {
  margin: auto auto 10px;
  max-width: 780px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 500;
  text-align: center;
  text-wrap: balance;
}

.hardware-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.hw-item {
  padding: 14px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: rgba(16, 17, 22, 0.72);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.hw-item:hover {
  border-color: var(--line-strong);
  background: rgba(20, 21, 27, 0.82);
}
.hw-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}
.hw-desc {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ===== Features ===== */
.frame--features {
  background:
    radial-gradient(1200px 600px at 85% 10%, rgba(186, 99, 239, 0.08), transparent 60%),
    radial-gradient(900px 500px at 10% 90%, rgba(255, 106, 47, 0.06), transparent 55%),
    var(--bg);
}

.features {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 70px var(--content-pad);
  display: flex;
  flex-direction: column;
  gap: 42px;
  position: relative;
  z-index: 1;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  min-height: 225px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--fast) var(--ease),
              border-color var(--fast) var(--ease),
              background var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}

.feature-icon { color: var(--accent); }

.feature-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.feature-desc {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.64;
}

/* ===== CTA + Footer ===== */
.frame--cta {
  justify-content: flex-start;
  background:
    radial-gradient(900px 500px at 10% 15%, rgba(186, 99, 239, 0.12), transparent 55%),
    radial-gradient(1000px 600px at 90% 80%, rgba(255, 106, 47, 0.08), transparent 60%),
    var(--bg);
  padding: 28px var(--content-pad) 0;
}

.cta-section {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 82px var(--content-pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  flex: 1;
  justify-content: center;
}

.cta-title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 52px;
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.cta-sub {
  max-width: 630px;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.7;
}

.cta-form {
  width: min(640px, 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.cta-input {
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  outline: none;
  color: var(--text);
  background: rgba(11, 12, 16, 0.6);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.cta-input::placeholder { color: var(--muted-2); }
.cta-input:focus {
  border-color: var(--accent-ring);
  background: rgba(11, 12, 16, 0.85);
}

.cta-trust {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cta-legal {
  max-width: 720px;
  color: var(--muted-2);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.65;
}

.success-msg {
  display: none;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-ring);
  background: var(--accent-wash);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-bar {
  border-top: 1px solid var(--line-soft);
  background: rgba(11, 12, 16, 0.6);
  padding: 20px 0;
}
.footer-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--content-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  transition: color var(--fast) var(--ease);
}
.footer-link:hover { color: var(--text); }

.footer-copy {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .hero-inner { display: block; padding-top: 20px; }
  .hero-title { font-size: 56px; }
  .hero-text { max-width: min(700px, 100%); }
  .specs-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hardware { gap: 20px; min-height: auto; padding-top: 56px; padding-bottom: 48px; }
  .hardware-header-top .section-title,
  .hardware-header-top .section-desc { max-width: none; }
  .hardware-header-top { padding-top: 18px; }
  .hardware-legend-intro { margin-top: 0; margin-bottom: 10px; }
  .hardware-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --content-pad: 18px; }
  .section-title { font-size: 34px; }
  .hero-title { font-size: 46px; }
  .hero-sub, .section-desc, .cta-sub { font-size: 15px; }
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hardware-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta-title { font-size: 38px; }
  .footer-inner { flex-wrap: wrap; justify-content: center; text-align: center; }
}

@media (max-width: 640px) {
  :root { --content-pad: 16px; }
  .page-wrapper { scroll-snap-type: none; }
  .nav-link { display: none; }
  .nav { gap: 12px; }

  .frame-bg img { object-position: center center; }

  .hero-inner { padding: 28px var(--content-pad); }
  .hero-title { font-size: 38px; text-align: center; }
  .hero-text { max-width: 100%; align-items: center; text-align: center; }
  .hero-sub { font-size: 14px; line-height: 1.6; max-width: 92%; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn-primary,
  .hero-actions .btn-outline { width: 100%; }

  .specs-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px var(--content-pad) 18px; }
  .spec { min-height: 68px; }
  .spec-val { font-size: 17px; }

  .hardware, .features { padding-top: 48px; padding-bottom: 48px; }
  .section-title { font-size: 28px; }
  .hardware-legend { grid-template-columns: 1fr; gap: 8px; }

  .features-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: auto; padding: 18px; }

  .cta-section { padding-top: 48px; padding-bottom: 48px; }
  .cta-title { font-size: 30px; }
  .cta-sub { font-size: 14px; }
  .cta-form { grid-template-columns: 1fr; border-radius: var(--radius-xl); padding: 10px; }

  .btn-primary, .btn-outline, .btn-sm { width: 100%; justify-content: center; }

  .footer-inner { flex-direction: column; text-align: center; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
