/* ==========================================================================
   Datagram — Design System
   Inspired by trmnl.com / dialpad.com: minimal, spacious, elegant.
   ========================================================================== */

/* ---- Tokens ---- */
:root {
  --bg:         #0a0a0a;
  --bg-surface: #1a1a1a;
  --bg-card:    #141414;
  --text:       #f5f5f5;
  --text-muted: #888;
  --accent:     #2563eb;
  --accent-hover:#1d4ed8;
  --warm:       #d4a853;
  --border:     #2a2a2a;
  --white:      #ffffff;
  --black:      #0a0a0a;

  --font-head:  'Space Grotesk', system-ui, sans-serif;
  --font-body:  'Inter', system-ui, sans-serif;

  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;
  --space-3xl:  96px;
  --space-4xl:  144px;

  --radius:     8px;
  --max-width:  1200px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; font-weight: 600; }

/* ---- Layout helpers ---- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-lg); }
@media (min-width: 768px) { .container { padding: 0 var(--space-2xl); } }
.section { padding: var(--space-3xl) 0; }
.section--dark { background: var(--bg-surface); }

/* ---- Navigation ---- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-lg);
  height: 64px;
}
@media (min-width: 768px) { .nav__inner { padding: 0 var(--space-2xl); } }

.nav__logo {
  font-family: var(--font-head); font-size: 1.35rem; font-weight: 700;
  color: var(--white); letter-spacing: -.02em; text-decoration: none;
}
.nav__logo:hover { color: var(--accent); }

.nav__links { display: flex; gap: var(--space-xl); align-items: center; }
.nav__link {
  font-size: .875rem; font-weight: 500; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em; text-decoration: none;
  transition: color .2s;
}
.nav__link:hover { color: var(--white); }

/* Services dropdown */
.nav__dropdown { position: relative; }
.nav__dropdown-toggle::after { content: ' \25BE'; font-size: .7em; opacity: .5; }
.nav__dropdown-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-sm) 0; min-width: 240px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.nav__dropdown:hover .nav__dropdown-menu { display: block; }
.nav__dropdown-item {
  display: block; padding: var(--space-sm) var(--space-md);
  font-size: .85rem; color: var(--text-muted); text-transform: none;
  letter-spacing: 0; transition: background .15s, color .2s;
}
.nav__dropdown-item:hover { background: var(--bg-card); color: var(--white); }

/* Mobile menu */
.nav__toggle { display: none; background: none; border: none; cursor: pointer; padding: var(--space-sm); }
.nav__toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: .3s; }
@media (max-width: 768px) {
  .nav__toggle { display: block; }
  .nav__links {
    display: none; flex-direction: column; position: absolute;
    top: 64px; left: 0; right: 0; background: var(--bg-surface);
    padding: var(--space-lg); border-bottom: 1px solid var(--border);
    gap: var(--space-md);
  }
  .nav__links.open { display: flex; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  padding: 14px 28px; border-radius: var(--radius); font-family: var(--font-body);
  font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .2s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--white); }
.btn--primary:hover { background: var(--accent-hover); color: var(--white); }
.btn--outline { border: 1px solid var(--accent); color: var(--accent); background: transparent; }
.btn--outline:hover { background: var(--accent); color: var(--white); }

/* ---- Hero ---- */
.hero {
  min-height: 90vh; display: flex; align-items: center; justify-content: center;
  text-align: center; position: relative; overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
}
.hero__bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(37,99,235,.12) 0%, transparent 60%);
}
.hero__content { position: relative; z-index: 1; padding: var(--space-3xl) var(--space-lg); }
.hero__eyebrow {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .2em;
  color: var(--accent); margin-bottom: var(--space-lg); font-weight: 600;
}
.hero__title {
  font-size: clamp(2.5rem, 8vw, 5.5rem); font-weight: 700;
  letter-spacing: -.03em; color: var(--white); margin-bottom: var(--space-lg);
}
.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem); color: var(--text-muted);
  max-width: 600px; margin: 0 auto var(--space-2xl); line-height: 1.7;
}

/* ---- Services Grid ---- */
.services-grid {
  display: grid; grid-template-columns: 1fr; gap: var(--space-lg);
}
@media (min-width: 640px) { .services-grid--sm { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .services-grid--lg { grid-template-columns: repeat(3, 1fr); } }

.service-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-xl);
  transition: border-color .2s, transform .2s, box-shadow .2s;
  text-decoration: none; color: inherit; display: block;
}
.service-card:hover {
  border-color: var(--accent); transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(37,99,235,.1);
}
.service-card__icon { font-size: 2rem; margin-bottom: var(--space-md); }
.service-card__title {
  font-family: var(--font-head); font-size: 1.15rem; font-weight: 600;
  color: var(--white); margin-bottom: var(--space-sm);
}
.service-card__desc { font-size: .9rem; color: var(--text-muted); line-height: 1.6; }

/* Service cards on home page - larger */
.services-home--lg .service-card { padding: var(--space-2xl); }
.services-home--lg .service-card__title { font-size: 1.35rem; }

/* ---- Section headings ---- */
.section__eyebrow {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .2em;
  color: var(--accent); margin-bottom: var(--space-md); font-weight: 600;
}
.section__title {
  font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 700; color: var(--white);
  letter-spacing: -.02em; margin-bottom: var(--space-lg);
}
.section__text { max-width: 640px; color: var(--text-muted); line-height: 1.8; font-size: 1.05rem; }

/* ---- About section (light) ---- */
.about-section { background: var(--white); color: var(--black); }
.about-section .section__eyebrow { color: var(--accent); }
.about-section .section__title { color: var(--black); }
.about-section .section__text { color: #444; }
.about-section .btn--primary { background: var(--bg); color: var(--white); }
.about-section .btn--primary:hover { background: #222; }

/* ---- Work / Gallery ---- */
.gallery-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md);
}
@media (min-width: 768px) { .gallery-grid--lg { grid-template-columns: repeat(3, 1fr); } }
.gallery-item {
  aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-surface); position: relative; cursor: pointer;
}
.gallery-item__img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item__caption {
  position: absolute; bottom: 0; left: 0; right: 0; padding: var(--space-md);
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  color: var(--white); font-size: .85rem; font-weight: 500;
}

/* ---- Trust bar ---- */
.trust-bar { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trust-bar__inner {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: var(--space-2xl) var(--space-3xl); padding: var(--space-2xl) 0;
}
.trust-bar__item { font-family: var(--font-head); color: var(--text-muted); font-size: .9rem; font-weight: 600; opacity: .5; }

/* ---- CTA band ---- */
.cta-band {
  background: var(--accent); text-align: center; padding: var(--space-3xl) var(--space-lg);
}
.cta-band__title { font-size: clamp(1.5rem, 4vw, 2.5rem); color: var(--white); margin-bottom: var(--space-md); }
.cta-band .btn--primary { background: var(--white); color: var(--accent); }
.cta-band .btn--primary:hover { background: #eee; }

/* ---- Service detail page ---- */
.service-hero {
  padding: var(--space-4xl) 0 var(--space-3xl); text-align: center; position: relative; overflow: hidden;
}
.service-hero__bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 40%, #0f1a2e 100%);
}
.service-hero__bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(37,99,235,.1) 0%, transparent 55%);
}
.service-hero__content { position: relative; z-index: 1; }
.service-hero__title { font-size: clamp(2rem, 6vw, 4rem); color: var(--white); letter-spacing: -.03em; margin-bottom: var(--space-md); }
.service-hero__subtitle { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-muted); max-width: 640px; margin: 0 auto; }

.service-content { display: grid; gap: var(--space-3xl); }
@media (min-width: 960px) {
  .service-content--split { grid-template-columns: 1fr 1fr; gap: var(--space-3xl); align-items: start; }
}

.features-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-lg); margin-top: var(--space-xl); }
.feature-item { display: flex; gap: var(--space-md); align-items: flex-start; }
.feature-item__icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(37,99,235,.12); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.feature-item__title { font-family: var(--font-head); font-weight: 600; color: var(--white); margin-bottom: var(--space-xs); }
.feature-item__desc { font-size: .9rem; color: var(--text-muted); }

/* ---- Contact ---- */
.contact-grid { display: grid; gap: var(--space-2xl); }
@media (min-width: 768px) { .contact-grid--lg { grid-template-columns: 1fr 1fr; } }
.form-group { margin-bottom: var(--space-md); }
.form-label { display: block; font-size: .85rem; font-weight: 500; color: var(--text-muted); margin-bottom: var(--space-sm); }
.form-input, .form-textarea {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface); color: var(--text); font-family: var(--font-body); font-size: .95rem;
  transition: border-color .2s;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 140px; }

/* ---- Footer ---- */
.footer {
  background: var(--bg-surface); border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0 var(--space-xl); font-size: .85rem; color: var(--text-muted);
}
.footer__inner {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: var(--space-lg); max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-lg);
}
@media (min-width: 768px) { .footer__inner { padding: 0 var(--space-2xl); } }
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--white); }
.footer__copy { text-align: center; margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px solid var(--border); }

/* ---- Animations (scroll reveal) ---- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal--delay-1 { transition-delay: .1s; }
.reveal--delay-2 { transition-delay: .2s; }
.reveal--delay-3 { transition-delay: .3s; }

/* ---- Lightbox ---- */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.92); cursor: zoom-out; justify-content: center; align-items: center;
}
.lightbox.active { display: flex; }
.lightbox__img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: var(--radius); }

/* ---- Utility ---- */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
/* ---- Photo overlays ---- */
.hero__photo {
    position: absolute; inset: 0; z-index: 0;
    width: 100%; height: 100%; object-fit: cover; opacity: .35;
}

.service-card--with-bg::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(20,20,20,.1) 0%, rgba(20,20,20,.55) 100%);
    border-radius: var(--radius);
}

.service-card { position: relative; }

.service-hero__photo {
    position: absolute; inset: 0; z-index: 0;
    width: 100%; height: 100%; object-fit: cover; opacity: .3;
}

.gallery-item { position: relative; overflow: hidden; }
.gallery-item__caption {
    position: absolute !important; bottom: 0; left: 0; right: 0; padding: var(--space-md);
    background: linear-gradient(transparent, rgba(0,0,0,.8)) !important;
    color: var(--white) !important; font-size: .85rem; font-weight: 500;
}
