/* ============================================================
   Byte Stack Solutions, pages.css
   Hero, page sections, use-case grid, comparison, terminal
   ============================================================ */

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + var(--s-7)) 0 var(--s-9);
  overflow: hidden;
}

.hero--compact {
  min-height: auto;
  padding: calc(var(--nav-h) + var(--s-8)) 0 var(--s-8);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-6);
  max-width: 880px;
}

.hero--center .hero__inner {
  align-items: center;
  text-align: center;
  margin: 0 auto;
}

.hero__title {
  font-size: clamp(2.6rem, 6vw + 1rem, 5.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.hero__title .rotator {
  display: inline-flex;
  align-items: baseline;
  position: relative;
  white-space: nowrap;
}

.hero__title .rotator__word {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  transition: opacity var(--t-med), transform var(--t-med);
}

.hero__title .rotator__word.out {
  opacity: 0;
  transform: translateY(-30%);
}

.hero__title .caret {
  display: inline-block;
  width: 4px;
  height: 0.85em;
  background: var(--accent-cyan);
  margin-left: 6px;
  vertical-align: -10%;
  animation: blink 1.1s steps(2, end) infinite;
  border-radius: 2px;
  box-shadow: 0 0 12px var(--accent-cyan);
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero__sub {
  font-size: clamp(1.05rem, 1vw + 0.8rem, 1.35rem);
  color: var(--text-soft);
  max-width: 56ch;
  line-height: 1.55;
}

.hero__scroll {
  position: absolute;
  bottom: var(--s-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.7;
  z-index: 1;
}

.hero__scroll-bar {
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, transparent, var(--accent-cyan));
  position: relative;
  overflow: hidden;
}

.hero__scroll-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-cyan);
  animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollDot {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* ============ VALUE PROPS ============ */
.value-props {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}

@media (max-width: 800px) {
  .value-props { grid-template-columns: 1fr; }
}

/* ============ SPLIT (services / software teaser) ============ */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}

.split__panel {
  position: relative;
  padding: var(--s-7);
  border-radius: var(--r-5);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--t-med) var(--ease-out);
}

.split__panel:hover {
  transform: translateY(-4px);
}

.split__panel--websites::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.18), transparent 60%);
  pointer-events: none;
}

.split__panel--software::before {
  content: '';
  position: absolute;
  bottom: -50%;
  left: -30%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.18), transparent 60%);
  pointer-events: none;
}

.split__panel > * { position: relative; z-index: 1; }

.split__panel h3 {
  font-size: clamp(1.6rem, 2vw + 0.8rem, 2.2rem);
  margin-bottom: var(--s-3);
}

.split__panel p {
  margin-bottom: var(--s-5);
  max-width: 36ch;
}

.split__link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 600;
  color: var(--accent-cyan);
  font-size: 1rem;
}

.split__link svg {
  width: 18px;
  height: 18px;
  transition: transform var(--t-med);
}

.split__panel:hover .split__link svg { transform: translateX(6px); }

/* ============ PROCESS ============ */
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-5);
  position: relative;
}

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

@media (max-width: 500px) {
  .process { grid-template-columns: 1fr; }
}

.process__step {
  position: relative;
  padding: var(--s-5);
  text-align: center;
}

.process__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  letter-spacing: 0.2em;
  margin-bottom: var(--s-3);
}

.process__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--s-4);
  border-radius: var(--r-4);
  background: var(--gradient-accent-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.process__icon svg { width: 32px; height: 32px; color: var(--accent-cyan); }

.process__icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gradient-accent);
  filter: blur(18px);
  opacity: 0.3;
  z-index: -1;
}

.process__step h4 {
  font-size: 1.1rem;
  margin-bottom: var(--s-2);
}

.process__step p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* connecting line on desktop */
@media (min-width: 900px) {
  .process::before {
    content: '';
    position: absolute;
    top: 78px;
    left: 12.5%;
    right: 12.5%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    z-index: -1;
  }
}

/* ============ SOFTWARE HERO GRID ============ */
.software-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--s-7);
  align-items: center;
}

.software-hero-grid__terminal {
  justify-self: end;
  width: 100%;
  min-width: 0;
}

@media (max-width: 900px) {
  .software-hero-grid {
    grid-template-columns: 1fr;
    gap: var(--s-6);
  }
  .software-hero-grid__terminal {
    justify-self: stretch;
  }
}

/* ============ TERMINAL ============ */
.terminal {
  background: rgba(5, 8, 15, 0.7);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-4);
  overflow: hidden;
  backdrop-filter: blur(var(--blur));
  font-family: var(--font-mono);
  font-size: 0.95rem;
  max-width: 640px;
  width: 100%;
  box-shadow: var(--shadow-lift), var(--shadow-glow);
}

@media (max-width: 640px) {
  .terminal {
    font-size: 0.78rem;
    max-width: 100%;
  }
  .terminal__body {
    padding: var(--s-4);
    height: 200px;
  }
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal__dot:nth-child(1) { background: #ff5f57; }
.terminal__dot:nth-child(2) { background: #febc2e; }
.terminal__dot:nth-child(3) { background: #28c840; }

.terminal__title {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.terminal__body {
  padding: var(--s-5);
  height: 260px;
  overflow-y: auto;
  scroll-behavior: smooth;
  color: var(--text-soft);
}

.terminal__line {
  display: block;
  white-space: pre-wrap;
  margin-bottom: 4px;
}

.terminal__line .prompt { color: var(--accent-cyan); }
.terminal__line .flag { color: var(--accent-violet); }
.terminal__line .ok { color: var(--success); }
.terminal__line .comment { color: var(--text-faint); font-style: italic; }
.terminal__cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent-cyan);
  vertical-align: -10%;
  animation: blink 1.1s steps(2, end) infinite;
}

/* ============ USE CASE BLOCKS (custom-software) ============ */
.use-case {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-7);
  align-items: center;
  padding: var(--s-7) 0;
  position: relative;
}

.use-case + .use-case {
  border-top: 1px solid var(--border);
}

.use-case:nth-child(even) .use-case__visual {
  order: -1;
}

@media (max-width: 900px) {
  .use-case { grid-template-columns: 1fr; gap: var(--s-5); }
  .use-case:nth-child(even) .use-case__visual { order: 0; }
}

.use-case__visual {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-4);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
}

.use-case__visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 24px, rgba(0, 212, 255, 0.04) 24px, rgba(0, 212, 255, 0.04) 25px),
    repeating-linear-gradient(90deg, transparent, transparent 24px, rgba(0, 212, 255, 0.04) 24px, rgba(0, 212, 255, 0.04) 25px);
}

.use-case__visual svg {
  position: relative;
  z-index: 1;
  width: 70%;
  height: auto;
  filter: drop-shadow(0 8px 30px rgba(0, 212, 255, 0.4));
}

.use-case__content .tag {
  margin-bottom: var(--s-3);
}

.use-case__content h3 {
  font-size: clamp(1.6rem, 2vw + 0.8rem, 2.2rem);
  margin-bottom: var(--s-3);
}

.use-case__content p {
  margin-bottom: var(--s-5);
}

.use-case__features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}

.use-case__features li {
  display: flex;
  gap: var(--s-2);
  font-size: 0.92rem;
  color: var(--text-soft);
  align-items: flex-start;
}

.use-case__features li::before {
  content: '';
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M2 8L6 12L14 4' stroke='%2300d4ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  flex-shrink: 0;
  margin-top: 4px;
}

.use-case__stack {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* ============ ALSO LIST ============ */
.also {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}

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

@media (max-width: 480px) {
  .also { grid-template-columns: 1fr; }
}

.also__item {
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: 0.95rem;
  transition: all var(--t-med);
}

.also__item:hover {
  border-color: var(--accent-cyan);
  background: var(--surface-strong);
  transform: translateY(-2px);
}

.also__item svg {
  width: 20px;
  height: 20px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

/* ============ TECH STACK GRID ============ */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s-3);
}

.stack-item {
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  text-align: center;
  transition: all var(--t-med);
}

.stack-item:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.stack-item__name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.stack-item__role {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============ COMPARISON TABLE ============ */
.compare {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  overflow: hidden;
}

@media (max-width: 700px) {
  .compare { font-size: 0.9rem; }
}

.compare__row {
  display: contents;
}

.compare__cell {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
}

.compare__cell--head {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.compare__cell--label {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.compare__cell--good {
  color: var(--accent-cyan);
  font-weight: 500;
}

.compare__cell--bad {
  color: var(--text-faint);
}

.compare__row:last-child .compare__cell {
  border-bottom: none;
}

/* ============ FOUNDER ============ */
.founder {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--s-6);
  padding: var(--s-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  align-items: center;
}

@media (max-width: 600px) {
  .founder { grid-template-columns: 1fr; text-align: center; }
  .founder__avatar { margin: 0 auto; }
}

.founder__avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--gradient-accent);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 700;
  color: var(--bg);
  box-shadow: 0 0 60px rgba(0, 212, 255, 0.4);
  padding: 2px;
}

.founder__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transform: scale(1.15) translateY(5%);
}

.founder__name {
  font-size: 1.6rem;
  margin-bottom: var(--s-1);
}

.founder__role {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  margin-bottom: var(--s-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============ CONTACT GRID ============ */
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s-6);
  align-items: start;
}

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.contact-info__item {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  align-items: flex-start;
}

.contact-info__item svg {
  width: 22px;
  height: 22px;
  color: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-info__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.contact-info__value {
  font-size: 1rem;
  color: var(--text);
}

.contact-info__value a:hover { color: var(--accent-cyan); }

/* ============ 404 ============ */
.glitch {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(8rem, 22vw, 18rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glitch::before {
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  transform: translate(-3px, 0);
  animation: glitchA 2.4s infinite linear alternate-reverse;
}

.glitch::after {
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
  transform: translate(3px, 0);
  animation: glitchB 2.8s infinite linear alternate-reverse;
}

@keyframes glitchA {
  0%, 90%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 2px); }
  40% { transform: translate(4px, -2px); }
}

@keyframes glitchB {
  0%, 90%, 100% { transform: translate(0, 0); }
  20% { transform: translate(6px, -2px); }
  40% { transform: translate(-4px, 2px); }
}

/* ============ SERVICES CARDS (services.html) ============ */
.service-card {
  position: relative;
  padding: var(--s-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  overflow: hidden;
  transition: all var(--t-med);
}

.service-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
}

.service-card__visual {
  height: 180px;
  margin: calc(var(--s-6) * -1) calc(var(--s-6) * -1) var(--s-4);
  background: var(--gradient-accent-soft);
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.service-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease-out), filter var(--t-med);
  filter: saturate(0.85) brightness(0.85);
}

.service-card__visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 14, 26, 0) 30%, rgba(10, 14, 26, 0.55) 100%),
    linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(168, 85, 247, 0.18));
  pointer-events: none;
  transition: opacity var(--t-med);
}

.service-card:hover .service-card__visual img {
  transform: scale(1.08);
  filter: saturate(1) brightness(1);
}

.service-card__visual svg {
  width: 80px;
  height: 80px;
  color: var(--text);
  filter: drop-shadow(0 6px 20px rgba(0, 212, 255, 0.5));
  transition: transform var(--t-med);
}

.service-card:hover .service-card__visual svg { transform: scale(1.1) rotate(-3deg); }

.service-card__price {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  letter-spacing: 0.05em;
}
