/* ============================================================
   DIA Cyber Solutions Ltd — landing design system
   Calm, editorial. Palette: cream paper, charcoal ink, ocean slate.
   Motion language adapted from iQLY's landing (word-stagger reveal,
   ken-burns hero, tactile buttons, scroll reveals).
   ============================================================ */

:root {
  /* Color */
  --dc-bg: #FAF9F6;
  --dc-card: #FFFFFF;
  --dc-panel: #F2F1EC;
  --dc-fg: #1E242B;
  --dc-fg2: #5A6570;
  --dc-fg3: #8A93A0;
  --dc-line: #E6E4DD;

  --dc-brand: #3D5A6C;        /* ocean */
  --dc-brand-dark: #2F4756;
  --dc-accent: #5C7D8E;       /* lighter teal for links / hovers */
  --dc-brand-line: rgba(61, 90, 108, 0.16);
  --dc-brand-line2: rgba(61, 90, 108, 0.42);
  --dc-brand-wash: rgba(61, 90, 108, 0.06);

  --dc-night: #16222B;        /* deep navy for dark sections */
  --dc-night-2: #1A2934;
  --dc-tactile-cream: #EDF2F4;

  /* On-night text */
  --dc-night-fg2: rgba(250, 249, 246, 0.74);
  --dc-night-fg3: rgba(250, 249, 246, 0.56);
  --dc-night-line: rgba(250, 249, 246, 0.14);
  --dc-night-line-strong: rgba(250, 249, 246, 0.4);

  /* Type scale (interpolates 390 -> 1440) */
  --t-display: clamp(44px, 29.143px + 3.8095vw, 84px);
  --t-h2: clamp(36px, 28.571px + 1.9048vw, 56px);
  --t-h3: clamp(22px, 19.771px + 0.5714vw, 28px);
  --t-body: clamp(16px, 15.629px + 0.0952vw, 17px);

  /* Space */
  --gutter: clamp(20px, 9.6px + 2.6667vw, 48px);
  --section-y: clamp(72px, 54.171px + 4.5714vw, 120px);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-word: cubic-bezier(0.2, 0.75, 0.1, 1);

  /* Fonts */
  --font-display: "Bricolage Grotesque", "Bricolage Grotesque Variable", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--dc-bg);
  color: var(--dc-fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--dc-accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--dc-brand-wash); color: var(--dc-brand-dark); }

/* ---------- Typography ---------- */
.display { font-family: var(--font-display); font-weight: 400; font-size: var(--t-display); line-height: 0.98; letter-spacing: -0.03em; }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--t-h2); line-height: 1.07; letter-spacing: -0.03em; }
.h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--t-h3); line-height: 1.2; letter-spacing: -0.02em; }
.body { font-family: var(--font-sans); font-weight: 400; font-size: var(--t-body); line-height: 1.59; text-wrap: pretty; }
.mono {
  font-family: var(--font-mono); font-weight: 400; font-size: 12px; line-height: 16px;
  letter-spacing: 0.12em; text-transform: uppercase;
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section-tint { background: var(--dc-panel); border-block: 1px solid var(--dc-line); }
.section-night { background: var(--dc-night); color: var(--dc-bg); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--dc-fg2); }
.on-night .muted { color: var(--dc-night-fg2); }

/* ---------- Buttons (tactile) ---------- */
.btn {
  --b-bg: var(--dc-card); --b-fg: var(--dc-brand);
  --b-edge: var(--dc-brand-line2); --b-base: var(--dc-brand-line2); --b-hi: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 1px solid var(--b-edge); background-color: var(--b-bg); color: var(--b-fg);
  font-family: var(--font-sans); font-weight: 700; font-size: 15px; line-height: 1;
  padding: 0.95rem 1.55rem 1.02rem; border-radius: 999px; text-decoration: none;
  box-shadow: inset 0 1px 0 var(--b-hi), inset 0 -3px 0 var(--b-base);
  transition: translate 0.14s var(--ease), box-shadow 0.14s var(--ease), background-color 0.16s var(--ease);
  white-space: nowrap;
}
.btn .arr { transition: translate 0.16s var(--ease); }
.btn--primary-cream { --b-bg: var(--dc-brand); --b-fg: var(--dc-card); --b-edge: var(--dc-brand-dark); --b-base: var(--dc-brand-dark); --b-hi: rgba(255,255,255,0.28); }
.btn--primary-night { --b-bg: var(--dc-bg); --b-fg: var(--dc-brand); --b-edge: var(--dc-tactile-cream); --b-base: var(--dc-tactile-cream); --b-hi: #fff; }
.btn--secondary-night { --b-bg: transparent; --b-fg: var(--dc-bg); --b-edge: var(--dc-night-line-strong); --b-base: var(--dc-night-line-strong); --b-hi: var(--dc-night-line); }
.btn--ghost { --b-bg: transparent; --b-edge: transparent; --b-base: transparent; --b-hi: transparent; --b-fg: var(--dc-brand); box-shadow: none; padding-inline: 0; }
@media (hover: hover) {
  .btn:hover {
    translate: 0 -1px;
    box-shadow: inset 0 1px 0 var(--b-hi), inset 0 -4px 0 var(--b-base);
  }
  .btn:hover .arr { translate: 3px 0; }
}
.btn:active { translate: 0 1px; box-shadow: inset 0 1px 0 var(--b-hi), inset 0 -1px 0 var(--b-base); }

/* Text link with arrow */
.link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-sans); font-weight: 600; font-size: 15px;
  color: var(--dc-brand); text-decoration: none;
}
.link .arr { transition: translate 0.16s var(--ease); }
.link:hover { color: var(--dc-brand-dark); }
.link:hover .arr { translate: 3px 0; }
.on-night .link { color: var(--dc-night-fg2); }
.on-night .link:hover { color: var(--dc-bg); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: #FFFFFF;
  color: var(--dc-fg);
  border-bottom: 1px solid var(--dc-line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.logo { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.logo .mark { color: var(--dc-brand); display: inline-flex; }
.logo .word {
  font-family: var(--font-display); font-weight: 600; font-size: 16.5px;
  letter-spacing: -0.01em; color: var(--dc-fg);
}
.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a:not(.btn) {
  font-size: 14.5px; font-weight: 500; color: var(--dc-fg2); text-decoration: none;
  transition: color 0.16s var(--ease);
}
.nav a:not(.btn):hover { color: var(--dc-fg); }
.nav a:not(.btn)[aria-current="page"] { color: var(--dc-fg); box-shadow: inset 0 -1.5px 0 var(--dc-brand); }
.nav .nav-cta { margin-left: 0.5rem; }

/* Mobile nav */
.nav-toggle { display: none; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 10px; }
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--dc-bg); border-bottom: 1px solid var(--dc-line);
    padding: 0.5rem var(--gutter) 1.25rem;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 0.85rem 0; font-size: 16px; border-bottom: 1px solid var(--dc-line); }
  .nav a:not(.btn):last-child { border-bottom: 0; }
  .nav .nav-cta { margin: 0.75rem 0 0; }
}

/* ---------- Hero (dark, full-bleed) ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  color: var(--dc-bg); background: var(--dc-night);
  min-height: min(100svh, 920px);
  display: flex; align-items: flex-end;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media .settle { width: 100%; height: 100%; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(22, 34, 43, 0.05) 0%, rgba(22, 34, 43, 0.34) 60%, var(--dc-night) 100%);
}
.hero-inner {
  width: 100%; padding-block: 168px 88px;
}
.hero-content { max-width: 640px; display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; }
.hero-content h1 { font-size: clamp(42px, 26px + 3.5vw, 74px); }
.hero-content .sub { color: var(--dc-night-fg2); max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 0.5rem; }

/* ---------- Page hero (light, interior pages) ---------- */
.page-hero {
  padding-top: clamp(150px, 20vh, 210px);
  padding-bottom: clamp(52px, 9vh, 96px);
  border-bottom: 1px solid var(--dc-line);
}
.page-hero h1 { margin: 0 0 1.25rem; }
.page-hero h1.display { font-size: clamp(40px, 32px + 2.4vw, 62px); line-height: 1.03; }
.page-hero .sub { color: var(--dc-fg2); max-width: 560px; margin: 0; }

/* ---------- Statement (2-col) ---------- */
.statement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.statement-grid .media { border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--dc-panel); }
.statement-grid .media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .statement-grid { grid-template-columns: 1fr; } }

/* ---------- Capabilities (numbered rows) ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 3rem; }
.cap-list { border-top: 1px solid var(--dc-line); }
.cap-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.7rem 0; border-bottom: 1px solid var(--dc-line);
  text-decoration: none; width: 100%; text-align: left;
}
.cap-row .left { display: flex; align-items: center; }
.cap-row .title { font-family: var(--font-display); font-weight: 500; font-size: clamp(20px, 1.5vw, 28px); letter-spacing: -0.01em; color: var(--dc-fg); transition: color 0.16s var(--ease); }
.cap-row .arr { color: var(--dc-fg3); flex-shrink: 0; transition: transform 0.2s var(--ease), color 0.16s var(--ease); }
.cap-row:hover .title { color: var(--dc-brand); }
.cap-row:hover .arr { color: var(--dc-brand); transform: translateX(4px); }
@media (max-width: 640px) {
  .cap-row { padding: 1.4rem 0; }
  .cap-row .title { font-size: 20px; }
}

/* ---------- Services page rows ---------- */
.svc-list { border-top: 1px solid var(--dc-line); }
.svc-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem);
  padding-block: clamp(2.5rem, 6vw, 4.5rem); border-bottom: 1px solid var(--dc-line);
}
.svc-row .media { border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--dc-panel); }
.svc-row .media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.svc-row .media:hover img { transform: scale(1.03); }
.svc-row.flip .media { order: 2; }
.svc-row .body-copy { display: flex; flex-direction: column; justify-content: center; gap: 1.1rem; }
.svc-row h2 { margin: 0; }
.svc-row p { margin: 0; color: var(--dc-fg2); }
.svc-tags { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-family: var(--font-sans); font-weight: 600; font-size: 13px; color: var(--dc-brand); }
@media (max-width: 860px) {
  .svc-row { grid-template-columns: 1fr; }
  .svc-row.flip .media { order: 0; }
}

/* ---------- About ---------- */
.about-photo { border-radius: 18px; overflow: hidden; aspect-ratio: 21 / 9; background: var(--dc-panel); margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-story { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(2rem, 5vw, 4.5rem); padding-bottom: var(--section-y); border-bottom: 1px solid var(--dc-line); }
.about-story .lead { font-family: var(--font-display); font-size: clamp(24px, 2.2vw, 32px); font-weight: 400; line-height: 1.25; letter-spacing: -0.02em; margin: 0; }
.about-story .copy { color: var(--dc-fg2); margin: 0; }
@media (max-width: 860px) { .about-story { grid-template-columns: 1fr; } }

.details { padding-top: clamp(2.5rem, 6vw, 4rem); max-width: 720px; }
.details h2 { margin: 0 0 2rem; }
.details dl { margin: 0; border-top: 1px solid var(--dc-line); }
.details .row { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--dc-line); }
.details dt { color: var(--dc-fg2); font-weight: 400; }
.details dd { margin: 0; font-weight: 600; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(2.5rem, 6vw, 5rem); }
.contact-grid .info h2 { font-size: 12px; font-family: var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dc-fg3); margin: 0 0 0.4rem; font-weight: 400; }
.contact-grid .info .block { margin-bottom: 2rem; }
.contact-grid .info a { color: var(--dc-brand); text-decoration: none; }
.contact-grid .info a:hover { color: var(--dc-brand-dark); }
.contact-grid .info p { margin: 0; }
.contact-media { border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--dc-panel); margin-top: 2rem; }
.contact-media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.email-panel { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; }
.email-panel h2 { margin: 0; }
.email-panel p { margin: 0; }
.contact-email {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(22px, 2.4vw, 32px); line-height: 1.2; letter-spacing: -0.02em;
  color: var(--dc-brand); text-decoration: none;
  border-bottom: 2px solid var(--dc-brand-line2); padding-bottom: 0.2rem;
  overflow-wrap: anywhere;
}
.contact-email:hover { color: var(--dc-brand-dark); border-color: var(--dc-brand-dark); }

/* ---------- Closing CTA ---------- */
.closing { text-align: center; max-width: 680px; margin-inline: auto; }
.closing h2 { margin: 0 0 1.25rem; }
.closing p { color: var(--dc-fg2); margin: 0 0 2.25rem; }
.on-night .closing p { color: var(--dc-night-fg2); }
.closing .actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--dc-line); background: var(--dc-bg); }
.site-footer .container {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.75rem; font-size: 13px; color: var(--dc-fg2); flex-wrap: wrap;
}
.site-footer .brand-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.site-footer .brand-line .sep { color: var(--dc-line); }
.site-footer .brand-line strong { color: var(--dc-fg); font-weight: 600; }
.site-footer .foot-nav { display: flex; gap: 1.5rem; }
.site-footer .foot-nav a { text-decoration: none; color: var(--dc-fg2); }
.site-footer .foot-nav a:hover { color: var(--dc-fg); }
@media (max-width: 640px) {
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Motion
   ============================================================ */

/* Word-split reveal. Words rise 105% with a 5deg tilt out of a
   clipping box, staggered. "enter" plays on load, "view" on scroll. */
[data-split] { --step: 95ms; --dur: 1.1s; }
[data-split][data-tone="text"] { --step: 30ms; --dur: 0.9s; }
.sw { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.02em 0.12em; margin: 0 -0.02em -0.12em; }
.si { display: inline-block; transform-origin: 0 100%; }

html[data-js] [data-split="view"] .si { opacity: 0; transform: translateY(105%) rotate(5deg); }
html[data-js] [data-split="view"][data-in] .si {
  opacity: 1; transform: none;
  transition: transform var(--dur) var(--ease-word), opacity calc(var(--dur) * 0.9) ease;
  transition-delay: calc(var(--base, 0ms) + min(var(--w, 0), 40) * var(--step));
}
[data-split="enter"] .si {
  animation: dc-word var(--dur) var(--ease-word) calc(var(--base, 120ms) + min(var(--w, 0), 40) * var(--step)) both;
}
@keyframes dc-word { from { opacity: 0; transform: translateY(105%) rotate(5deg); } }

/* Generic reveal-on-scroll */
html[data-js] [data-reveal] { opacity: 0; transform: translateY(var(--reveal-y, 16px)) scale(var(--reveal-s, 1)); }
html[data-js] [data-reveal][data-in] {
  opacity: 1; transform: none;
  transition: opacity 600ms var(--ease) calc(var(--i, 0) * 60ms), transform 600ms var(--ease) calc(var(--i, 0) * 60ms);
}
[data-reveal="card"] { --reveal-y: 24px; }
[data-reveal="glass"] { --reveal-y: 0; --reveal-s: 0.98; }

/* Above-the-fold entrance (plain CSS, paints before JS) */
[data-enter] { animation: dc-enter 600ms var(--ease) calc(var(--i, 0) * 60ms) both; }
@keyframes dc-enter { from { opacity: 0; transform: translateY(16px); } }

/* Hero photo: settles from a slight zoom on load, then drifts slowly. */
.settle { animation: dc-settle 1.8s var(--ease) both; }
@keyframes dc-settle { from { scale: 1.12; } }
.kenburns { animation: dc-kenburns 14s ease-in-out infinite alternate; }
@keyframes dc-kenburns { to { transform: scale(1.05); } }

/* Reduced motion: show everything, no movement. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html[data-js] [data-reveal],
  html[data-js] [data-split="view"] .si { opacity: 1 !important; transform: none !important; }
  .kenburns, .settle, [data-split="enter"] .si, [data-enter] { animation: none !important; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
