@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";

/* Dark theme only: <html> always carries the `dark` class, so shadcn's dark: styles apply. */
@custom-variant dark (&:is(.dark *));

/*
 * ─── shadcn/ui semantic tokens ────────────────────────────────────────────
 * Mapped onto the Figma palette (portfolio › Review UI › "last update").
 * shadcn components (Button, Input, Card, Sheet…) read these.
 */
:root {
  --radius: 0.5rem; /* 8px — inputs / service options in Figma */

  --background: #210d32;
  --foreground: #f4f6f8;
  --card: #12101d;
  --card-foreground: #f4f6f8;
  --popover: #1a0b27;
  --popover-foreground: #f4f6f8;
  --primary: #a855f7;
  --primary-foreground: #ffffff;
  --secondary: #f4f6f8;
  --secondary-foreground: #303030;
  --muted: rgb(255 255 255 / 0.1);
  --muted-foreground: #919eab;
  --accent: rgb(255 255 255 / 0.15);
  --accent-foreground: #ffffff;
  --destructive: #ef4f7c;
  --border: rgb(255 255 255 / 0.1);
  --input: rgb(255 255 255 / 0.2);
  --ring: #a855f7;
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);

  /* sm/md/lg follow --radius; xl (12px), 2xl (16px), 3xl (24px) keep Tailwind's values to match Figma. */
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
}

/*
 * ─── Brand tokens (Figma) ─────────────────────────────────────────────────
 */
@theme {
  /* md = the Figma tablet frame (744px wide), instead of Tailwind's default 768px. */
  --breakpoint-md: 46.5rem;
  /* Surfaces */
  --color-page: #210d32;          /* main page / section background */
  --color-page-deep: #1a0b27;     /* bottom of hero gradient */
  --color-ink: #07080f;           /* overlays */
  --color-surface: #12101d;       /* project / product cards */
  --color-surface-navy: #0e1120;  /* floating badges, contact card */
  --color-surface-night: #090219; /* features strip */
  --color-footer: #2c1938;

  /* Text */
  --color-heading: #e6e8f0;
  --color-default: #f4f6f8;
  --color-soft: #dfe3e8;          /* Figma: "disable" */
  --color-subtle: #919eab;        /* Figma: "disable-text" */
  --color-dim: #666666;           /* Figma: "secondary-text" */
  --color-text-dark: #303030;
  --color-placeholder-dark: #5f6972; /* placeholder / icon inside white inputs */
  --color-primary-darker: #3a2857;

  /* Brand */
  --color-primary-from: #a667ff;
  --color-primary-to: #9519ff;
  --color-brand-deep: #69499e;
  --color-lavender: #c4b5fd;
  --color-heliotrope: #cc97ff;    /* page badges ("REQUEST SERVICE") */
  --color-indigo: #4f46e5;
  --color-orchid-light: #e3b1f7;  /* hero "Client Growth" icon */
  --color-magenta: #cc0dfb;       /* hero AI badge border */

  /* Tag accents (each used at 7–15% alpha for bg/border) */
  --color-accent-pink: #f755f4;
  --color-accent-rose: #f755c1;
  --color-accent-cyan: #3ae8df;
  --color-accent-sky: #55d4f7;
  --color-accent-yellow: #f5c842;
  --color-accent-orange: #f7b355;
  --color-accent-lilac: #bbb7f8;
  --color-accent-mint: #00d9a6;
  --color-accent-green: #24e83b;
  --color-accent-lime: #b8c706;
  --color-accent-orchid: #d478ff;
  --color-accent-red: #ef4f7c;
  /* Career pages: job colors (icon circle / badge) and their light text shades */
  --color-accent-violet: #7667ff;
  --color-accent-violet-light: #c4b4ff;
  --color-accent-violet-pale: #ddd6ff;
  --color-accent-hot-pink: #fb64b6;
  --color-accent-hot-pink-light: #fda5d5;
  --color-accent-emerald: #00d492;
  --color-accent-emerald-light: #5ee9b5;
  --color-accent-azure: #51a2ff;
  --color-accent-azure-light: #8ec5ff;
  --color-accent-teal: #27d6b3;     /* "NEW" badge */
  --color-accent-aqua: #7bf7fb;     /* Airport AI Assistant */
  --color-accent-citron: #cfdc33;   /* Motakamel details */
  --color-primary-lighter: #b7a5d3; /* sidebar labels, upload link */
  --color-divider: rgb(137 171 214 / 0.16);
  --color-ink-blue: #07131f;        /* job photo fade */
  --color-menu-line: #8c73b6;       /* divider in the open phone menu */

  /* Typography */
  --font-heading: var(--font-outfit), var(--font-alexandria), sans-serif;
  --font-sans: var(--font-dm-sans), var(--font-alexandria), sans-serif;
  --font-display: var(--font-alexandria), sans-serif;
  --font-numeric: var(--font-cairo), sans-serif;
  --font-mono: Consolas, var(--font-inconsolata), Menlo, ui-monospace, monospace;
  /* Inconsolata at 110% width = Consolas letter width (ignored by Consolas itself). */
  --font-mono--font-variation-settings: "wdth" 110;

  /* Layout */
  --container-site: 1280px;

  /* Partner logos marquee (the list is rendered twice, so -50% loops seamlessly) */
  --animate-marquee: marquee 30s linear infinite;
  --animate-marquee-rtl: marquee-rtl 30s linear infinite;

  @keyframes marquee {
    to { transform: translateX(-50%); }
  }
  @keyframes marquee-rtl {
    to { transform: translateX(50%); }
  }
}

/*
 * Arabic: Outfit / DM Sans / Consolas have no Arabic glyphs, so lead with Alexandria everywhere.
 * Letter-spacing breaks Arabic letter joining, and Arabic needs taller lines than Latin.
 */
:root[dir="rtl"] {
  --font-heading: var(--font-alexandria), sans-serif;
  --font-sans: var(--font-alexandria), sans-serif;
  --font-mono: var(--font-alexandria), sans-serif;

  & :is(h1, h2, h3) {
    line-height: 1.4;
  }

  & * {
    letter-spacing: normal !important;
  }

  /* Chrome renders tel inputs left-to-right. Keep that for the typed number (right-to-left would reverse its
     space-separated groups), but while the Arabic placeholder shows, use right-to-left so its "*" sits at the end. */
  & input[type="tel"] {
    text-align: right;

    &:placeholder-shown {
      direction: rtl;
    }
  }
}

@utility container-site {
  width: 100%;
  max-width: calc(var(--container-site) + 2 * 1.25rem);
  margin-inline: auto;
  padding-inline: 1.25rem;

  /* Figma tablet frame (744): 40px side margins. */
  @media (width >= 46.5rem) {
    max-width: calc(var(--container-site) + 2 * 2.5rem);
    padding-inline: 2.5rem;
  }

  @media (width >= 64rem) {
    max-width: calc(var(--container-site) + 2 * 5rem);
    padding-inline: 5rem;
  }
}

/* Gradient text used on highlighted heading words ("Smarter Future", "Transformation"…) */
@utility text-gradient-brand {
  background-image: linear-gradient(-51deg, var(--color-brand-deep) 9.6%, #fff 101%);
  background-clip: text;
  color: transparent;
}

/* Gradient text used on stats ("20+", "99%") */
@utility text-gradient-stat {
  background-image: linear-gradient(to right, #f5befa, var(--color-indigo));
  background-clip: text;
  color: transparent;
}

/* ─── Image overlays (Figma) ─── */

/* Hero background: two soft radial glows + dark vertical fade */
@utility bg-hero-overlay {
  background-image:
    radial-gradient(ellipse 60% 55% at 60% 50%, rgb(79 70 229 / 0.18), transparent 60%),
    radial-gradient(ellipse 50% 45% at 57% 38%, rgb(222 173 247 / 0.18) 13%, transparent 50%),
    linear-gradient(180deg, rgb(7 8 15 / 0.4) 0%, rgb(7 8 15 / 0.85) 70%, var(--color-page-deep) 100%);
}

/* About photo: mint tint from the top corner */
@utility bg-mint-tint {
  background-image: linear-gradient(143deg, rgb(0 217 166 / 0.15) 0%, transparent 60%);
}

/* Project cards: image fades into the card surface */
@utility bg-card-fade {
  background-image: linear-gradient(
    0deg,
    var(--color-surface) 0%,
    rgb(18 16 29 / 0.71) 14%,
    rgb(18 16 29 / 0.29) 36%,
    transparent 50%
  );
}

/* Portfolio banner: ink → indigo diagonal */
@utility bg-banner-overlay {
  background-image: linear-gradient(
    166deg,
    rgb(7 8 15 / 0.85) 0%,
    rgb(17 16 44 / 0.74) 25%,
    rgb(30 28 83 / 0.63) 50%,
    rgb(49 44 140 / 0.51) 75%,
    rgb(79 70 229 / 0.4) 100%
  );
}

/* Floating badges ("Client Growth", "ISO Certified") */
@utility shadow-float {
  filter: drop-shadow(0 20px 30px rgb(0 0 0 / 0.5));
}

/* Purple pill button ("Get Started", "Subscribe") */
@utility bg-gradient-primary {
  background-image: linear-gradient(to right, var(--color-primary-from), var(--color-primary-to));
}

/* White button fading to lavender at the bottom-right ("Explore Service", "Send Request") */
@utility bg-gradient-white {
  background-image: linear-gradient(172deg, #fff 48%, #ddd2ee 78%, #a690cc 112%);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    @apply bg-background font-sans text-foreground antialiased;
    /* Matches the Figma page: darker at the top, slightly lighter purple toward the footer */
    background-image: linear-gradient(
      180deg,
      var(--color-page-deep) 0%,
      var(--color-page-deep) 12%,
      var(--color-page) 45%,
      var(--color-page) 72%,
      #2a1040 100%
    );
  }

  button:not(:disabled),
  [role="button"]:not(:disabled) {
    cursor: pointer;
  }
}

/* Career pages: Riyadh-at-night photo overlay (Figma "Career" hero). */
@utility bg-career-hero-overlay {
  background-image:
    radial-gradient(ellipse 60% 50% at 60% 50%, rgb(79 70 229 / 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 57% 38%, rgb(222 173 247 / 0.18) 13%, transparent 50%),
    linear-gradient(180deg, rgb(7 8 15 / 0.4) 0%, rgb(7 8 15 / 0.85) 70%, rgb(26 11 39) 100%);
}

/* Job details: "Ready to make an impact?" card. */
@utility bg-cta-card {
  background-image: linear-gradient(
    90deg,
    rgb(16 34 56) 0%,
    rgb(24 39 71 / 0.81) 25%,
    rgb(36 48 96 / 0.63) 50%,
    rgb(60 64 141 / 0.44) 75%,
    rgb(97 88 213 / 0.3) 93.75%,
    rgb(118 103 255 / 0.25) 100%
  );
}

/* Job details photo: dark fade on the start side, faint violet on the end side. */
@utility bg-job-photo-overlay {
  background-image: linear-gradient(90deg, rgb(7 19 31) 0%, rgb(7 19 31 / 0) 50%, rgb(118 103 255 / 0) 50%, rgb(118 103 255 / 0.1) 100%);
}
