/* =========================================================
   GraphiQ website styles
   1. Colours & basics   2. Buttons & labels   3. Header
   4. Hero               5. Video tiles        6. Sections
   7. Footer & extras    8. Phones             9. Reduced motion
   ========================================================= */

/* ---------- 1. Colours & basics ---------- */
:root {
  --bg: #07070a;
  --bg-alt: #0d0d13;
  --surface: #14141c;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f1ea;
  --muted: #a6a3b0;
  --accent: #e9b872;        /* warm cinematic gold */
  --accent-2: #9a7bff;      /* soft violet glow */
  --whatsapp: #25d366;
  --radius: 18px;
  --max: 1200px;
  --header-h: 72px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;          /* "clip" keeps sticky (pinned) sections working */
}

/* Subtle film grain over the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, video, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
a { color: inherit; }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--accent); color: #111; padding: 0.6rem 1rem; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- 2. Buttons & labels ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: #121212;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(233, 184, 114, 0.25); }
.btn-ghost { background: transparent; color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn-small { padding: 0.55rem 1.1rem; font-size: 0.95rem; }
.btn-whatsapp { background: var(--whatsapp); color: #06210f; font-size: 1.1rem; padding: 1rem 1.9rem; }
.btn-whatsapp:hover { box-shadow: 0 10px 30px rgba(37, 211, 102, 0.3); }
.btn svg, .wa-float svg {
  width: 1.4em; height: 1.4em; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round;
}

.text-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* Clearly marks text that still needs real details */
.ph {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px dashed var(--accent);
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  margin-right: 0.35rem;
  vertical-align: 0.15em;
}

/* ---------- 3. Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(7, 7, 10, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }

.logo {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em;
  text-decoration: none; margin: 0;
}
.logo span { color: var(--accent); }
.logo img { height: 36px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 500; transition: color 0.2s; }
.site-nav a:not(.btn):hover { color: var(--text); }

.nav-toggle { display: none; }

/* ---------- 4. Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 2rem) 0 4rem;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 80% 40%, rgba(154, 123, 255, 0.18), transparent 70%),
    radial-gradient(50% 40% at 15% 80%, rgba(233, 184, 114, 0.12), transparent 70%),
    var(--bg);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; }

.hero h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); font-weight: 800; margin-bottom: 1.5rem; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), #f6dcb0 45%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

.hero-stage { position: relative; height: min(70vh, 620px); }
.media.hero-card { position: absolute; width: 44%; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.hero-card-1 { left: 28%; top: 0; z-index: 2; animation: float 7s ease-in-out infinite; }
.hero-card-2 { left: 0; top: 14%; transform: rotate(-6deg); opacity: 0.85; animation: float 8s ease-in-out -2s infinite; }
.hero-card-3 { right: 0; top: 18%; transform: rotate(6deg); opacity: 0.85; animation: float 9s ease-in-out -4s infinite; }

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.5rem; translate: -50% 0;
  width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--accent); animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- 5. Video tiles (placeholder until a video loads) ---------- */
.media {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #1b1830, #0e0e16 40%, #2a1f12 75%, #12121a);
  background-size: 200% 200%;
  animation: shimmer 10s ease-in-out infinite;
}
@keyframes shimmer { 0%, 100% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } }

.media video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.media.has-video { animation: none; }
.media.has-video video, .media.has-poster video { opacity: 1; }

.media-label {
  position: absolute; inset: auto 0.75rem 0.75rem 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px dashed rgba(233, 184, 114, 0.6);
  border-radius: 10px;
  background: rgba(7, 7, 10, 0.6);
  color: var(--accent);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; line-height: 1.4;
  text-align: left;
}
.media-label small { display: block; color: var(--muted); font-weight: 500; letter-spacing: 0; word-break: break-all; }
.media.has-video .media-label, .media.has-poster .media-label { display: none; }

/* ---------- 6. Sections ---------- */
.section { padding: clamp(4.5rem, 10vw, 8rem) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 40rem; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 750; }
.section-intro { color: var(--muted); }

/* Portfolio */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.work-media {
  width: 100%; padding: 0; cursor: pointer; color: inherit; font: inherit;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.work-media:hover { transform: translateY(-6px); border-color: rgba(233, 184, 114, 0.5); box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55); }
.work-media::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}
.work-info { padding: 0.9rem 0.25rem 0; }
.work-info h3 { font-size: 1.05rem; margin-bottom: 0.15rem; }
.work-info p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* Services */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.service {
  display: flex; flex-direction: column;
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), var(--surface);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.service:hover { border-color: rgba(233, 184, 114, 0.4); transform: translateY(-4px); }
.service h3 { font-size: 1.4rem; }
.service p { color: var(--muted); }
.service .service-details { font-size: 0.9rem; }
.service .text-link { margin-top: auto; }
.service-icon {
  width: 44px; height: 44px; margin-bottom: 1.5rem; padding: 10px;
  border-radius: 12px; background: rgba(233, 184, 114, 0.12);
  fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round;
}

/* Why GraphiQ */
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.why { padding: 2rem; border-top: 1px solid var(--line); }
.why-num { display: block; font-size: 0.85rem; font-weight: 700; color: var(--accent); letter-spacing: 0.15em; margin-bottom: 1rem; }
.why h3 { font-size: 1.35rem; }
.why p { color: var(--muted); margin: 0; }

/* Enquiry */
.cta {
  text-align: center;
  background:
    radial-gradient(50% 60% at 50% 100%, rgba(233, 184, 114, 0.14), transparent 70%),
    var(--bg-alt);
  border-top: 1px solid var(--line);
}
.cta-inner { max-width: 46rem; }
.cta h2 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
.cta .lead { margin: 0 auto 2rem; }

/* ---------- 7. Footer & extras ---------- */
.site-footer { padding: 2.5rem 0 6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-inner p { margin: 0; }
.logo-footer { color: var(--text); font-size: 1.25rem; }

/* Floating WhatsApp button */
.wa-float {
  position: fixed; z-index: 60;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--whatsapp); color: #06210f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 28px; height: 28px; }

/* Full-screen video viewer */
.viewer {
  padding: 0; border: 0; background: transparent; color: var(--text);
  max-width: min(92vw, 480px); width: 100%;
}
.viewer::backdrop { background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(6px); }
.viewer-video { width: 100%; max-height: 86vh; aspect-ratio: 9 / 16; border-radius: var(--radius); background: #000; object-fit: contain; margin-inline: auto; }
.viewer-placeholder {
  padding: 3rem 1.5rem; border: 1px dashed var(--accent); border-radius: var(--radius);
  background: var(--surface); text-align: center; color: var(--accent); font-weight: 600;
}
.viewer-placeholder code { color: var(--text); }
.viewer-close {
  display: block; margin: 0 0 0.75rem auto;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 1.1rem; cursor: pointer;
}

/* Small message pop-up */
.toast {
  position: fixed; z-index: 150; left: 50%; bottom: 6.5rem;
  translate: -50% 1rem;
  max-width: min(92vw, 26rem);
  padding: 0.9rem 1.2rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--accent);
  color: var(--text); font-size: 0.95rem; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, translate 0.25s ease;
}
.toast.is-visible { opacity: 1; translate: -50% 0; }

/* ---------- 8. Tablets & phones ---------- */
@media (max-width: 960px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .service-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }

  /* Menu folds into a button */
  .nav-toggle {
    display: grid; place-items: center;
    width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid var(--line); background: rgba(20, 20, 28, 0.7); cursor: pointer;
  }
  .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease; content: "";
  }
  .nav-toggle-bar { position: relative; }
  .nav-toggle-bar::before { position: absolute; top: -6px; }
  .nav-toggle-bar::after { position: absolute; top: 6px; }
  .menu-open .nav-toggle-bar { background: transparent; }
  .menu-open .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
  .menu-open .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.5rem 1.25rem 1.5rem;
    background: rgba(7, 7, 10, 0.97);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .menu-open .site-nav { display: flex; }
  .menu-open { background: rgba(7, 7, 10, 0.97); }
  .site-nav a:not(.btn) { padding: 0.9rem 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
  .site-nav .btn { margin-top: 1rem; justify-content: center; }

  /* Hero: one vertical video fills the background behind the headline */
  .hero { align-items: flex-end; padding-bottom: 5.5rem; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-copy { position: relative; z-index: 2; }
  .hero-stage { position: absolute; inset: 0; height: auto; z-index: 0; }
  .media.hero-card-1 {
    left: 0; top: 0; width: 100%; height: 100%; aspect-ratio: auto;
    border-radius: 0; border: 0; animation: none; box-shadow: none;
  }
  .hero-card-2, .hero-card-3 { display: none; }
  .hero-stage::after {
    content: ""; position: absolute; inset: 0; z-index: 3;
    background: linear-gradient(to top, var(--bg) 8%, rgba(7, 7, 10, 0.75) 45%, rgba(7, 7, 10, 0.35));
  }
  .hero-card-1 .media-label { inset: calc(var(--header-h) + 0.75rem) 0.75rem auto 0.75rem; z-index: 4; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }

  .work-grid { gap: 1rem; }
  .why-grid { grid-template-columns: 1fr; }
  .why { padding: 1.5rem 0; }
  .service { padding: 1.5rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* Narrow phones: one portfolio video per row */
@media (max-width: 600px) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 9. Respect "reduce motion" settings ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
