/* ============================================================
   Dijimind — diji-mind.com
   Design system: logo-derived palette on ink & cream neutrals
   ============================================================ */

:root {
  /* Brand — from logo */
  --ink: #131022;
  --ink-soft: #1d1a31;
  --ink-mute: #4b4761;
  --cream: #f6f3e8;
  --cream-deep: #ece8d6;
  --purple: #7c5cfc;
  --yellow: #f6b51e;
  --red: #f4472b;

  /* Extended */
  --white: #ffffff;
  --line: rgba(19, 16, 34, 0.12);
  --line-invert: rgba(246, 243, 232, 0.16);
  --purple-soft: rgba(124, 92, 252, 0.12);
  --yellow-soft: rgba(246, 181, 30, 0.16);
  --red-soft: rgba(244, 71, 43, 0.12);

  --font-display: "Space Grotesk", "Poppins", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-logo: "Poppins", sans-serif;

  --radius: 20px;
  --radius-sm: 12px;
  --container: 1180px;
  --header-h: 76px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--red);
}

.section-title {
  font-size: clamp(30px, 4vw, 44px);
  margin: 14px 0 18px;
  max-width: 640px;
}

.section-lead {
  font-size: 18px;
  color: var(--ink-mute);
  max-width: 620px;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(246, 243, 232, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-logo);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.logo svg { height: 34px; width: auto; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.main-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-mute);
  transition: color 0.2s ease;
}

.main-nav a:hover { color: var(--ink); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.lang-switch {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 7px 14px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lang-switch:hover { color: var(--ink); border-color: var(--ink); }

/* Header on dark hero (before scroll) */
.site-header.on-dark:not(.is-scrolled) .main-nav a,
.site-header.on-dark:not(.is-scrolled) .lang-switch { color: rgba(246, 243, 232, 0.75); }
.site-header.on-dark:not(.is-scrolled) .main-nav a:hover { color: var(--cream); }
.site-header.on-dark:not(.is-scrolled) .lang-switch { border-color: var(--line-invert); }
.site-header.on-dark:not(.is-scrolled) .lang-switch:hover { color: var(--cream); border-color: var(--cream); }
.site-header.on-dark:not(.is-scrolled) .logo { color: var(--cream); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 110;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 8px;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle span { top: 19px; }
.nav-toggle span::before { top: -7px; left: 0; }
.nav-toggle span::after { top: 7px; left: 0; }

body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 99px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: #d93a20; }

.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

.btn-ghost.on-dark { border-color: var(--line-invert); color: var(--cream); }
.btn-ghost.on-dark:hover { border-color: var(--cream); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: var(--ink);
  color: var(--cream);
  padding: calc(var(--header-h) + 90px) 0 0;
  overflow: hidden;
}

.hero-arc {
  position: absolute;
  right: -160px;
  top: 50%;
  transform: translateY(-58%);
  width: 620px;
  opacity: 0.16;
  pointer-events: none;
}

.hero-dot {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero .container { position: relative; }

.hero-content { max-width: 720px; padding-bottom: 90px; }

.hero .eyebrow { color: rgba(246, 243, 232, 0.6); }
.hero .eyebrow::before { background: var(--yellow); }

.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  margin: 20px 0 24px;
}

.hero h1 em {
  font-style: normal;
  color: var(--yellow);
}

.hero-lead {
  font-size: 19px;
  line-height: 1.7;
  color: rgba(246, 243, 232, 0.75);
  max-width: 600px;
  margin-bottom: 38px;
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: 16px; }

.hero-stats {
  border-top: 1px solid var(--line-invert);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.hero-stat {
  padding: 30px 28px 34px 0;
}

.hero-stat + .hero-stat { padding-left: 28px; border-left: 1px solid var(--line-invert); }

.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero-stat span {
  font-size: 14px;
  color: rgba(246, 243, 232, 0.6);
}

.hero-stat:nth-child(1) strong { color: var(--yellow); }
.hero-stat:nth-child(2) strong { color: var(--cream); }
.hero-stat:nth-child(3) strong { color: var(--purple); }
.hero-stat:nth-child(4) strong { color: var(--red); }

/* ---------- Sections ---------- */

.section { padding: 110px 0; }
.section.alt { background: var(--white); }
.section-head { margin-bottom: 56px; }

/* ---------- Services ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.section.alt .service-card { background: var(--cream); }

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(19, 16, 34, 0.1);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.service-icon svg { width: 26px; height: 26px; }

.service-card:nth-child(1) .service-icon { background: var(--red-soft); color: var(--red); }
.service-card:nth-child(2) .service-icon { background: var(--purple-soft); color: var(--purple); }
.service-card:nth-child(3) .service-icon { background: var(--yellow-soft); color: #b97f00; }
.service-card:nth-child(4) .service-icon { background: rgba(19, 16, 34, 0.08); color: var(--ink); }

.service-card h3 { font-size: 20px; }

.service-card p { font-size: 15px; color: var(--ink-mute); }

/* ---------- AI panel ---------- */

.ai-panel {
  background: linear-gradient(135deg, #1d1a31 0%, #262052 55%, #37286e 100%);
  border-radius: 28px;
  padding: 68px 60px;
  color: var(--cream);
  position: relative;
  overflow: hidden;
}

.ai-panel::after {
  content: "";
  position: absolute;
  right: -140px;
  top: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 252, 0.35), transparent 70%);
  pointer-events: none;
}

.ai-panel .eyebrow { color: rgba(246, 243, 232, 0.6); }
.ai-panel .eyebrow::before { background: var(--yellow); }
.ai-panel .section-title { color: var(--cream); }
.ai-panel .section-lead { color: rgba(246, 243, 232, 0.7); }

.ai-head { margin-bottom: 44px; position: relative; }

.ai-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  position: relative;
}

.ai-card {
  background: rgba(246, 243, 232, 0.05);
  border: 1px solid rgba(246, 243, 232, 0.14);
  border-radius: 16px;
  padding: 26px 24px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.ai-card:hover { border-color: rgba(124, 92, 252, 0.7); background: rgba(124, 92, 252, 0.1); }

.ai-card h3 { font-size: 19px; margin-bottom: 8px; }

.ai-card h3 span { margin-right: 10px; }

.ai-card p { font-size: 15px; color: rgba(246, 243, 232, 0.68); }

.ai-providers { margin-top: 44px; position: relative; }

.ai-providers h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(246, 243, 232, 0.55);
  margin-bottom: 16px;
}

.provider-chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  border: 1px solid rgba(246, 243, 232, 0.22);
  border-radius: 99px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(246, 243, 232, 0.85);
}

.ai-note {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(246, 243, 232, 0.14);
  font-size: 14.5px;
  color: rgba(246, 243, 232, 0.62);
  max-width: 720px;
  position: relative;
}

/* ---------- Sectors ---------- */

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.sector-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 24px 22px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.sector-card:hover { border-color: var(--purple); transform: translateY(-4px); }

.sector-card h3 { font-size: 17px; margin-bottom: 6px; }

.sector-card p { font-size: 14px; color: var(--ink-mute); }

/* ---------- Process ---------- */

.process { background: var(--ink); color: var(--cream); }

.process .eyebrow { color: rgba(246, 243, 232, 0.6); }
.process .eyebrow::before { background: var(--purple); }
.process .section-lead { color: rgba(246, 243, 232, 0.65); }

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  counter-reset: step;
}

.process-step {
  border: 1px solid var(--line-invert);
  border-radius: var(--radius);
  padding: 30px 26px;
  position: relative;
}

.process-step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--yellow);
  letter-spacing: 0.1em;
}

.process-step h3 { font-size: 20px; margin: 14px 0 10px; }

.process-step p { font-size: 15px; color: rgba(246, 243, 232, 0.65); }

/* ---------- Engineering ---------- */

.eng-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.eng-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px;
}

.eng-item .tick {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.eng-item h3 { font-size: 16px; margin-bottom: 4px; }
.eng-item p { font-size: 14px; color: var(--ink-mute); }

/* ---------- Cases ---------- */

.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.case-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.case-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(19, 16, 34, 0.1);
}

.case-tag {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 99px;
  margin-bottom: 18px;
}

.case-card:nth-child(3n+1) .case-tag { background: var(--purple-soft); color: var(--purple); }
.case-card:nth-child(3n+2) .case-tag { background: var(--yellow-soft); color: #b97f00; }
.case-card:nth-child(3n) .case-tag { background: var(--red-soft); color: var(--red); }

.case-card h3 { font-size: 21px; margin-bottom: 12px; }

.case-card > p { font-size: 15px; color: var(--ink-mute); flex: 1; }

.case-meta {
  display: flex;
  gap: 22px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.case-meta div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
}

.case-meta div span { font-size: 13px; color: var(--ink-mute); }

.cases-note {
  margin-top: 28px;
  font-size: 14px;
  color: var(--ink-mute);
}

/* ---------- CTA ---------- */

.cta {
  background: var(--ink);
  color: var(--cream);
  border-radius: 28px;
  padding: 72px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  overflow: hidden;
}

.cta-arc {
  position: absolute;
  right: -70px;
  bottom: -110px;
  width: 320px;
  opacity: 0.45;
  pointer-events: none;
}

.cta h2 { font-size: clamp(28px, 3.6vw, 40px); max-width: 520px; position: relative; }

.cta p { color: rgba(246, 243, 232, 0.65); margin-top: 12px; max-width: 480px; position: relative; }

.cta .btn { position: relative; flex: none; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--cream);
  border-top: 1px solid var(--line);
  padding: 64px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--ink-mute);
  max-width: 280px;
  margin-top: 16px;
}

.footer-col h4 {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; display: grid; gap: 10px; }

.footer-col a, .footer-col li {
  font-size: 15px;
  color: var(--ink);
}

.footer-col a:hover { color: var(--red); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-mute);
}

/* ---------- Legal pages ---------- */

.legal { padding: calc(var(--header-h) + 60px) 0 90px; }

.legal .container { max-width: 820px; }

.legal h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 10px; }

.legal .updated { color: var(--ink-mute); font-size: 14px; margin-bottom: 40px; }

.legal h2 { font-size: 22px; margin: 38px 0 12px; }

.legal p { margin-bottom: 14px; }

.legal ul { margin: 0 0 14px; padding-left: 24px; }

.legal li { margin-bottom: 8px; }

.legal a { color: var(--red); }

/* ---------- Back to top ---------- */

.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 90;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--cream);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(19, 16, 34, 0.28);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover { background: var(--red); transform: translateY(-3px); }

.to-top svg { width: 20px; height: 20px; }

@media (max-width: 720px) {
  .to-top { right: 18px; bottom: 18px; width: 46px; height: 46px; }
}

/* ---------- Reveal animations ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .services-grid, .process-grid { grid-template-columns: repeat(2, 1fr); }
  .sectors-grid { grid-template-columns: repeat(2, 1fr); }
  .eng-grid { grid-template-columns: repeat(2, 1fr); }
  .cases-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stat:nth-child(3) { border-left: none; padding-left: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }

  .main-nav {
    position: fixed;
    inset: 0;
    background: var(--ink);
    color: var(--cream);
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 105;
  }

  .main-nav a { font-size: 22px; color: rgba(246, 243, 232, 0.8); }

  body.nav-open .main-nav { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  .header-actions .btn { display: none; }

  .section { padding: 72px 0; }
  .services-grid, .process-grid, .sectors-grid, .eng-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stat { padding: 22px 16px 24px 0; }
  .hero-stat + .hero-stat { padding-left: 16px; }
  .hero-stat:nth-child(odd) { border-left: none; padding-left: 0; }
  .hero-stat strong { font-size: 30px; }

  .cta { flex-direction: column; align-items: flex-start; padding: 48px 32px; }
  .ai-panel { padding: 44px 28px; border-radius: 20px; }
  .ai-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; }
}
