/* eCloudApp — design tokens: dark-only by deliberate choice (motion-agency aesthetic).
   Shape lock: buttons = full pill, cards = 20px, inputs = 12px. Accent = brand violet only;
   amber is reserved for imagery + process-step numerals, never a second competing accent. */

@font-face {
  font-family: "Rubik Var";
  src: url("../fonts/rubik-variable.woff2") format("woff2-variations");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Madeleina Sans";
  src: url("../fonts/madeleina-sans.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0a0a0d;
  --bg-elevated: #131218;
  --bg-elevated-2: #1a1922;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --fg: #f4f3f7;
  --fg-muted: #a7a5b3;
  --fg-faint: #6f6d7c;
  --accent: #8172f2;
  --accent-strong: #a297ff;
  --accent-fg: #0a0a0d;
  --amber: #f2bd42;

  --radius-pill: 999px;
  --radius-card: 20px;
  --radius-input: 12px;

  --font-display: "Madeleina Sans", "Rubik Var", system-ui, sans-serif;
  --font-body: "Rubik Var", system-ui, -apple-system, sans-serif;

  --container: 1240px;
  --section-pad: clamp(4.5rem, 9vw, 8rem);
  --edge-pad: clamp(1.25rem, 5vw, 3rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;

  /* Neumorphic dual-tone shadows: dark base + faint highlight, both against --bg */
  --neu-dark: rgba(0, 0, 0, 0.6);
  --neu-light: rgba(255, 255, 255, 0.035);
  --neu-raised: 9px 9px 20px var(--neu-dark), -7px -7px 16px var(--neu-light);
  --neu-raised-hover: 12px 12px 26px var(--neu-dark), -8px -8px 18px var(--neu-light);
  --neu-inset: inset 6px 6px 14px var(--neu-dark), inset -4px -4px 10px var(--neu-light);
}

:root[data-locale="ja"] { --font-body: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; --font-display: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; }
:root[data-locale="ar"] { --font-body: "Segoe UI", "Noto Sans Arabic", system-ui, sans-serif; --font-display: "Segoe UI", "Noto Sans Arabic", system-ui, sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
html { background: var(--bg); }
#bg-field {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}
body {
  margin: 0;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background: transparent;
  overflow-x: hidden;
}
[dir="rtl"] body { font-feature-settings: normal; }

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--edge-pad);
}

.icon { width: 1.5rem; height: 1.5rem; flex-shrink: 0; }
.icon svg { width: 100%; height: 100%; }

/* ---------- Focus / a11y ---------- */
:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip-link {
  position: fixed;
  inset-inline-start: 1rem;
  top: -3rem;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-input);
  z-index: 200;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: transform 0.35s var(--ease-out), background 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
  will-change: transform;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 7px 7px 16px var(--neu-dark), -5px -5px 12px rgba(129, 114, 242, 0.12); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:active { box-shadow: inset 4px 4px 10px rgba(0, 0, 0, 0.45); }
.btn-ghost { background: var(--bg); color: var(--fg); box-shadow: var(--neu-raised); }
.btn-ghost:hover { color: var(--accent-strong); box-shadow: var(--neu-raised-hover); }
.btn-ghost:active { box-shadow: var(--neu-inset); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  height: 4.5rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease-out), background 0.4s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(10, 10, 13, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; width: 100%; }
.nav-brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; }
.footer-brand { display: flex; align-items: center; gap: 0.55rem; }

.brand-chip {
  display: inline-flex;
  align-items: center;
  background: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-input);
  line-height: 0;
}
.brand-chip img { display: block; width: auto; }
footer .brand-chip { padding: 0.4rem 0.65rem; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-size: 0.92rem; color: var(--fg-muted); transition: color 0.25s var(--ease-out); }
.nav-links a:hover { color: var(--fg); }
.nav-right { display: flex; align-items: center; gap: 1.1rem; }

.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--bg);
  box-shadow: var(--neu-raised);
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { color: var(--fg); box-shadow: var(--neu-raised-hover); }
.lang-switch[open] summary { color: var(--fg); box-shadow: var(--neu-inset); }
.lang-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  inset-inline-end: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  padding: 0.4rem;
  min-width: 9.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lang-menu a {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--fg-muted);
}
.lang-menu a:hover { background: var(--bg-elevated-2); color: var(--fg); }
.lang-menu a[aria-current="true"] { color: var(--accent-strong); }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: 4.5rem;
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem var(--edge-pad) 1rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
  }
  .nav-links a { padding: 0.9rem 0; border-top: 1px solid var(--border); }
  .nav-links.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
  }
  .nav .btn-primary.nav-cta { display: none; }
}

/* ---------- Video hero (logo intro) ---------- */
/* No opaque background here on purpose: the ambient #bg-field canvas sits
   behind the whole page, and the video fades to transparent (not to a solid
   color) so its own stars dissolve into the canvas's stars instead of
   handing off at a visible seam. */
.video-hero {
  position: relative;
  height: 100dvh;
  overflow: hidden;
}
.video-hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 92%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 92%);
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}
@media (max-width: 760px) {
  .video-hero { height: 82dvh; }
  .video-hero-media { object-fit: cover; object-position: center 30%; }
}
@media (prefers-reduced-motion: reduce) {
  .video-hero-media { display: none; }
  .video-hero {
    background: url('/assets/img/video-hero-poster.jpg') center/cover no-repeat;
    mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 92%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 92%);
  }
}
.sound-toggle {
  position: absolute;
  z-index: 2;
  inset-block-end: 1.5rem;
  inset-inline-end: 1.5rem;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  color: #fff;
  transition: background 0.25s var(--ease-out);
}
.sound-toggle:hover { background: rgba(255, 255, 255, 0.16); }
.sound-toggle .icon { width: 1.15rem; height: 1.15rem; }
@media (prefers-reduced-motion: reduce) { .sound-toggle { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  padding-bottom: 3rem;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-copy { max-width: 34rem; }
.hero-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 4.6vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}
.hero-subtext {
  font-size: 1.05rem;
  color: var(--fg-muted);
  max-width: 34ch;
  margin-bottom: 2rem;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero-visual { position: relative; aspect-ratio: 1 / 1; }
.laptop3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.laptop3d-canvas:active { cursor: grabbing; }
.mac-frame { width: 100%; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.55)); }
.mac-frame-bezel {
  background: linear-gradient(180deg, #3a3a3d, #232326);
  border-radius: 14px 14px 3px 3px;
  padding: 14px 14px 8px;
  position: relative;
}
.mac-frame-cam {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0a0a0a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  margin: 0 auto 8px;
}
.mac-frame-screen {
  border-radius: 3px;
  overflow: hidden;
  aspect-ratio: 1624 / 969;
  background: #000;
}
.mac-frame-screen img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mac-frame-base {
  height: 14px;
  background: linear-gradient(180deg, #cfcfd2, #a9a9ac);
  border-radius: 0 0 8px 8px;
  position: relative;
}
.mac-frame-notch {
  position: absolute;
  top: 0;
  inset-inline: 0;
  margin-inline: auto;
  width: 90px;
  height: 10px;
  background: #8f8f92;
  border-radius: 0 0 8px 8px;
}

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { order: -1; aspect-ratio: 16 / 11; }
  .hero { padding-top: 5.5rem; }
}

/* ---------- Marquee (industries) — the ONE marquee on the page ---------- */
.marquee-section { padding-block: 2.6rem; border-block: 1px solid var(--border); }
.marquee-label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 1.1rem;
}
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; gap: clamp(2.5rem, 6vw, 5rem); animation: marquee 26s linear infinite; }
.marquee-track span { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2.1rem); color: var(--fg-faint); white-space: nowrap; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { from { transform: translateX(0); } to { transform: translateX(50%); } }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---------- Section shell ---------- */
section { padding-block: var(--section-pad); }
.section-head { max-width: 40rem; margin-bottom: 3rem; }
.section-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  line-height: 1.14;
}
.section-body { color: var(--fg-muted); margin-top: 1rem; font-size: 1.02rem; max-width: 60ch; }

/* ---------- Approach (asymmetric split) ---------- */
.approach .container { display: grid; grid-template-columns: 1fr 0.85fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.approach-visual { border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--border); }
.approach-visual img { width: 100%; height: 100%; object-fit: cover; }
.approach-points { display: grid; gap: 0.75rem; margin-top: 1.75rem; }
.approach-points li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  color: var(--fg);
  font-size: 0.98rem;
}
.approach-points li:last-child { border-bottom: 1px solid var(--border); }
.approach-points .icon { color: var(--accent-strong); }
@media (max-width: 900px) {
  .approach .container { grid-template-columns: 1fr; }
  .approach-visual { order: -1; aspect-ratio: 4 / 3; }
}

/* ---------- Process (horizontal scroll-pan storytelling) ---------- */
.process-pin { position: relative; overflow: hidden; }
.process-track { display: flex; height: 100dvh; align-items: center; will-change: transform; }
.process-panel {
  position: relative;
  flex: 0 0 min(88vw, 640px);
  margin-inline-end: clamp(1.5rem, 4vw, 3rem);
  padding: 2.75rem;
  border-radius: var(--radius-card);
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  box-shadow: var(--neu-raised);
  height: min(70vh, 30rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
}
.process-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(0deg, rgba(6, 6, 9, 0.94) 22%, rgba(6, 6, 9, 0.25) 78%);
}
.process-panel > * { position: relative; z-index: 1; }
.process-items li { color: rgba(255, 255, 255, 0.75); }
.process-panel:first-child { margin-inline-start: var(--edge-pad); }
.process-n { font-family: var(--font-display); color: var(--amber); font-size: 0.95rem; letter-spacing: 0.08em; margin-bottom: auto; }
.process-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 1rem; }
.process-items { display: grid; gap: 0.5rem; }
.process-items li { color: var(--fg-muted); font-size: 0.98rem; padding-inline-start: 1.1rem; position: relative; }
.process-items li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.process-static { display: none; }

@media (prefers-reduced-motion: reduce), (max-width: 760px) {
  .process-track { display: grid; grid-auto-flow: column; grid-auto-columns: 85%; height: auto; overflow-x: auto; scroll-snap-type: x mandatory; padding-block: 1rem; gap: 1.25rem; }
  .process-panel { scroll-snap-align: start; height: auto; margin-inline-end: 0; }
  .process-panel:first-child { margin-inline-start: 0; }
}

/* ---------- Services (bento, 7 cells) ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.25rem; }
.bento-card {
  border-radius: var(--radius-card);
  padding: 1.75rem;
  background: var(--bg);
  box-shadow: var(--neu-raised);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.bento-card:hover { box-shadow: var(--neu-raised-hover); transform: translateY(-2px); }
.bento-card .icon { color: var(--accent-strong); width: 1.9rem; height: 1.9rem; }
.bento-card h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.bento-card p { color: var(--fg-muted); font-size: 0.95rem; }
.bento-card--wide { grid-column: span 3; }
.bento-card--narrow { grid-column: span 2; }
.bento-card--dark { background: #0e0e13; }
.bento-card--photo {
  position: relative;
  justify-content: flex-end;
  background-size: cover;
  background-position: center;
  color: #fff;
  min-height: 16rem;
}
.bento-card--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(0deg, rgba(6, 6, 9, 0.92) 10%, rgba(6, 6, 9, 0.15) 75%);
}
.bento-card--photo > * { position: relative; z-index: 1; }
.bento-card--photo .icon { color: #fff; }
.bento-card--photo p { color: rgba(255, 255, 255, 0.78); }

@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .bento-card--wide, .bento-card--narrow { grid-column: span 2; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .bento-card--wide, .bento-card--narrow { grid-column: span 1; }
}

/* ---------- CTA band ---------- */
.cta-band {
  text-align: center;
}
.cta-band .section-head { margin-inline: auto; text-align: center; }
.cta-band .btn { margin-top: 0.5rem; }

/* ---------- Contact ---------- */
.contact .container { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 6vw, 5rem); }
.contact-info { display: grid; gap: 1.6rem; align-content: start; }
.contact-row { display: flex; gap: 0.9rem; align-items: flex-start; }
.contact-row .icon { color: var(--accent-strong); margin-top: 0.15rem; }
.contact-row a, .contact-row span { color: var(--fg-muted); font-size: 0.98rem; line-height: 1.5; }
.social-row { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.social-row a {
  width: 2.4rem; height: 2.4rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-pill);
  box-shadow: var(--neu-raised);
  color: var(--fg-muted);
  transition: color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.social-row a .icon { width: 1.1rem; height: 1.1rem; }
.social-row a:hover { color: var(--accent-strong); box-shadow: var(--neu-raised-hover); }
.social-row a:active { box-shadow: var(--neu-inset); }

#contact-form {
  background: var(--bg-elevated);
  border-radius: var(--radius-card);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--neu-raised);
}
.form-field { display: grid; gap: 0.4rem; margin-bottom: 1.1rem; }
.form-field label { font-size: 0.88rem; color: var(--fg-muted); }
.form-field input, .form-field textarea {
  background: var(--bg-elevated-2);
  border: none;
  box-shadow: inset 5px 5px 12px rgba(0, 0, 0, 0.5), inset -4px -4px 9px rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-input);
  padding: 0.85rem 1rem;
  color: var(--fg);
  font: inherit;
  resize: vertical;
}
.form-field textarea { min-height: 8rem; }
.form-field input:focus, .form-field textarea:focus {
  box-shadow: inset 5px 5px 12px rgba(0, 0, 0, 0.5), inset -4px -4px 9px rgba(255, 255, 255, 0.04), 0 0 0 2px var(--accent-strong);
  outline: none;
}
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--fg-faint); }
.form-note { font-size: 0.85rem; margin-top: 0.9rem; min-height: 1.2em; }
.form-note[data-state="success"] { color: #6fd39a; }
.form-note[data-state="error"] { color: #f28b82; }
.hp-field { position: absolute; inset-inline-start: -9999px; }

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

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding-block: 3rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; }
.footer-brand img { height: 2.2rem; }
.footer-tagline { color: var(--fg-faint); font-size: 0.88rem; margin-top: 0.6rem; max-width: 22rem; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; color: var(--fg-faint); font-size: 0.82rem; margin-top: 1.75rem; }

/* ---------- Reveal utility (GSAP sets these) ---------- */
[data-reveal] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; transform: translateY(24px); }
}
