/* ═══════════════════════════════════════════════════════
   Digital Nexo Web — Portfolio
   Visual foundation: DataDay Design System (Operations Cockpit)
   Space Grotesk · Inter · JetBrains Mono · slate + orange, dark-first
═══════════════════════════════════════════════════════ */

/* 1 ─── Google Fonts ─── */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

/* 2 ─── Tokens (DataDay, dark) ─── */
:root {
  /* Surfaces — barely tilted toward dark blue */
  --bg:          #0A0E1A;
  --bg-elev:     #0F1524;
  --surface:     #141B30;
  --surface-2:   #1A233C;

  /* Borders */
  --line:        rgba(255, 255, 255, 0.06);
  --line-2:      rgba(255, 255, 255, 0.10);

  /* Text */
  --text:        #E7ECF3;
  --text-dim:    #8B94A8;
  --text-faint:  #5B6478;

  /* Brand accent — orange (sparingly: CTAs, eyebrows, active states) */
  --accent:      #FF6B2C;
  --accent-hover:#FF7D44;
  --accent-dim:  rgba(255, 107, 44, 0.12);
  --accent-glow: rgba(255, 107, 44, 0.20);

  /* Type families */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* Spacing (8px base) */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Radius ladder */
  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Motion */
  --ease-out:  cubic-bezier(0.25, 1, 0.5, 1);
  --dur:       140ms;
  --dur-card:  250ms;

  /* Layout */
  --maxw: 1120px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

/* 4 ─── Body ─── */
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.shell { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }

/* Eyebrow — orange caps label */
.eyebrow {
  display: inline-block;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-body);
}

/* ═══════════════════════════════════════════════════════
   5 ─── NAVBAR ─── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 26, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  line-height: 1;
}
.brand-name {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: background var(--dur) ease, color var(--dur) ease;
}
.nav-links a:hover { background: var(--surface-2); color: var(--text); }

/* ═══════════════════════════════════════════════════════
   6 ─── HERO ─── */
.hero {
  position: relative;
  padding: clamp(80px, 14vh, 150px) 0 clamp(72px, 12vh, 120px);
  background: var(--bg);
  overflow: hidden;
}
/* Dot grid — pure CSS radial-gradient, fades toward the edges, slow drift */
.hero::before {
  content: "";
  position: absolute;
  inset: -40px;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 35%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 35%, transparent 100%);
  pointer-events: none;
  animation: grid-drift 26s linear infinite;
}
/* Faint orange wash, top-center — gentle breathing glow */
.hero::after {
  content: "";
  position: absolute;
  top: -30%;
  left: 50%;
  width: 760px;
  height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--accent-dim) 0%, transparent 62%);
  pointer-events: none;
  animation: glow-breathe 7s ease-in-out infinite;
}
/* Horizontal scan line that sweeps down the hero */
.hero-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 18%, #ffd9c2 50%, var(--accent) 82%, transparent 100%);
  opacity: 0;
  filter: blur(0.3px);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: hero-scan 9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.hero-inner {
  position: relative;
  max-width: 820px;
}
.hero .eyebrow { margin-bottom: 20px; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--text);
  text-wrap: balance;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  margin-top: 22px;
  max-width: 540px;
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  line-height: 1.55;
  color: var(--text-dim);
}
.hero-actions {
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
/* Meta strip — mono, understated */
.hero-meta {
  margin-top: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: -0.01em;
  color: var(--text-faint);
}
.hero-meta .dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--line-2);
}
/* Live status pip — slow pulse */
.hero-meta .pip {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pip-pulse 2.6s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════
   7 ─── ABOUT ─── */
.about {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(64px, 10vh, 96px) 0;
}
.about-inner {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}
.about .eyebrow { margin-bottom: 18px; }
.about h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}
.about p {
  margin-top: 18px;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text-dim);
  text-wrap: pretty;
}

/* ═══════════════════════════════════════════════════════
   8 ─── PROJECTS GRID ─── */
.projects {
  padding: clamp(72px, 11vh, 110px) 0;
  background: var(--bg);
}
.section-head {
  margin-bottom: 40px;
  max-width: 560px;
}
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
}
.section-head p {
  margin-top: 14px;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-dim);
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* ═══════════════════════════════════════════════════════
   9 ─── CARD ─── */
.card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  transition:
    border-color var(--dur-card) ease,
    background var(--dur-card) ease,
    transform var(--dur-card) var(--ease-out),
    box-shadow var(--dur-card) ease;
}
/* Diagonal sheen that sweeps once on hover */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: skewX(-18deg);
  transition: left 650ms var(--ease-out);
  pointer-events: none;
  z-index: 2;
}
.card:hover::before { left: 130%; }
.card > * { position: relative; }
.card:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32);
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  border: 1px solid var(--line-2);
  color: var(--accent);
}
.card-icon svg { width: 20px; height: 20px; }
.card-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}
.card-tagline {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.01em;
}
.card-desc {
  margin-top: 14px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-dim);
  text-wrap: pretty;
}

/* 10 ─── BADGES ─── */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  margin-bottom: 22px;
}
.badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  white-space: nowrap;
}

/* Push the button to the bottom so cards align */
.card-spacer { flex: 1; }

/* 11 ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur) ease, color var(--dur) ease,
              border-color var(--dur) ease, opacity var(--dur) ease;
}
.btn-primary {
  position: relative;
  overflow: hidden;
  padding: 11px 22px;
  background: var(--accent);
  color: #fff;
}
/* Recurring sheen sweep across primary buttons */
.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg);
  animation: btn-sheen 5s ease-in-out infinite;
  pointer-events: none;
}
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { opacity: 0.9; }
.btn-ghost {
  padding: 11px 20px;
  background: transparent;
  color: var(--text-dim);
  border-color: var(--line-2);
  font-weight: 500;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }
.btn-soon { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary:hover .btn-arrow { transform: translateX(2px); }
.btn-arrow { transition: transform var(--dur) ease; }

/* ═══════════════════════════════════════════════════════
   12 ─── FOOTER ─── */
.footer {
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
  padding: clamp(48px, 8vh, 72px) 0 36px;
}
.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 320px;
}
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-contact .caps {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  transition: background var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.contact-item:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.contact-item-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
}
.contact-item-icon svg { width: 16px; height: 16px; }
.contact-item-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}
.contact-links {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.contact-link {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  transition: background var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.contact-link:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.contact-link svg { width: 18px; height: 18px; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: -0.01em;
  color: var(--text-faint);
}

/* ═══════════════════════════════════════════════════════
   Futuristic motion — keyframes + scroll reveal */
@keyframes grid-drift {
  from { background-position: 0 0; }
  to   { background-position: 26px 26px; }
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
@keyframes hero-scan {
  0%   { top: 0;    opacity: 0; }
  8%   { opacity: 0.9; }
  40%  { opacity: 0.9; }
  55%  { top: 100%; opacity: 0; }
  100% { top: 100%; opacity: 0; }
}
@keyframes pip-pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 7px rgba(255, 107, 44, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 44, 0); }
}
@keyframes btn-sheen {
  0%   { left: -60%; }
  55%  { left: 140%; }
  100% { left: 140%; }
}

/* Scroll reveal — hidden only once JS confirms it can animate (html.js).
   No-JS, print, and the safety timeout all leave content fully visible. */
.reveal {
  transition: opacity 560ms var(--ease-out), transform 560ms var(--ease-out);
}
html.js .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(22px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.projects-grid .card.reveal.is-visible { transition-delay: 0ms; }
.projects-grid .card:nth-child(2).reveal { transition-delay: 90ms; }
.projects-grid .card:nth-child(3).reveal { transition-delay: 180ms; }

/* ═══════════════════════════════════════════════════════
   Reduced-motion — disable smooth scroll, ambient loops + transitions */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn, .contact-link, .nav-links a { transition: none; }
  .hero::before, .hero::after, .hero-scan,
  .hero-meta .pip, .btn-primary::before { animation: none; }
  .hero::after { opacity: 0.8; }
  .hero-scan { display: none; }
  .reveal { transition: none; }
  html.js .reveal:not(.is-visible) { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════
   13 ─── MEDIA QUERIES ─── */
@media (max-width: 900px) {
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links a { padding: 8px 10px; font-size: 0.82rem; }
}

@media (max-width: 768px) {
  .brand-name { display: none; }
  .footer-top { flex-direction: column; gap: 24px; }
}

@media (max-width: 600px) {
  .projects-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .shell { width: min(100% - 32px, var(--maxw)); }
  .navbar-inner { height: 58px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 7px 8px; font-size: 0.8rem; }
  .hero { padding-top: 64px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}
