/* ==========================================================================
   Demo 03 — UI/UX Designer  ·  demos/03-ui-ux-designer/css/theme.css

   Design rationale
   ----------------
   Creative and typographic. Violet primary with a teal counterpoint on a
   near-white canvas, oversized display type and a lot of breathing room.
   Layout archetype E: an asymmetric bento grid that mixes text tiles, colour
   swatches and imagery, plus a horizontal process rail.

   ISOLATION CONTRACT
   Scoped to :root (token values) or .rp-demo--ui-ux-designer only.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens — light
   -------------------------------------------------------------------------- */

:root {
  --rp-primary: #7c3aed;
  --rp-primary-strong: #6828db;
  --rp-primary-soft: rgba(124, 58, 237, 0.1);
  --rp-accent: #14b8a6;
  --rp-on-primary: #ffffff;
  --rp-on-accent: #04231f;
  --rp-danger: #e11d48;

  --rp-bg: #ffffff;
  --rp-surface: #faf7ff;
  --rp-surface-2: #f1eafe;
  --rp-text: #1a1030;
  --rp-text-soft: #402f63;
  --rp-muted: #7c6f98;
  --rp-border: #ece5fa;
  --rp-border-strong: #d5c6f3;

  --rp-container: 1240px;
  --rp-radius: 16px;
  --rp-radius-lg: 26px;
  --rp-btn-radius: var(--rp-radius-pill);
  /* Generous rhythm — whitespace is the point of this demo. */
  --rp-section-y: clamp(4.5rem, 2.5rem + 7vw, 9rem);
}

/* --------------------------------------------------------------------------
   2. Tokens — dark
   -------------------------------------------------------------------------- */

:root[data-theme='dark'] {
  --rp-primary: #a78bfa;
  --rp-primary-strong: #bda5ff;
  --rp-primary-soft: rgba(167, 139, 250, 0.16);
  --rp-accent: #2dd4bf;
  --rp-on-primary: #16092e;

  --rp-bg: #0f0a1c;
  --rp-surface: #171029;
  --rp-surface-2: #211737;
  --rp-text: #f6f1ff;
  --rp-text-soft: #d0c4e8;
  --rp-muted: #9587b0;
  --rp-border: #281d40;
  --rp-border-strong: #3d2d5e;
}

/* --------------------------------------------------------------------------
   3. Hero — oversized type over a bento grid
   -------------------------------------------------------------------------- */

.ux-hero {
  padding-block: clamp(2.5rem, 1rem + 6vw, 5rem) var(--rp-section-y);
}

.ux-hero-title {
  font-family: var(--rp-font-display);
  font-size: clamp(2.4rem, 1.2rem + 5.4vw, 6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-inline-size: 16ch;
}

.ux-hero-title em {
  /* inline-block + relative so the highlight below tracks the WORD's width,
     not the whole line box. */
  position: relative;
  display: inline-block;
  font-style: normal;
  color: var(--rp-primary);
}

/* Marker-pen highlight sitting behind the emphasised words. */
.ux-hero-title em::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset-inline: -0.12em;
  inset-block-end: 0.12em;
  block-size: 0.22em;
  border-radius: var(--rp-radius-pill);
  background: var(--rp-accent);
  opacity: 0.4;
}

.ux-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rp-space-5);
  margin-block-start: var(--rp-space-6);
  padding-block-start: var(--rp-space-5);
  border-block-start: 1px solid var(--rp-border);
}

/* --------------------------------------------------------------------------
   4. Bento grid
   -------------------------------------------------------------------------- */

.ux-bento {
  display: grid;
  gap: var(--rp-space-4);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 180px;
  /* Dense so the small tiles backfill: with the feature photo at 2x2 the six
     tiles now tile the 4x3 grid exactly, leaving no empty cells. */
  grid-auto-flow: dense;
  margin-block-start: var(--rp-space-7);
}

.ux-tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--rp-space-2);
  padding: var(--rp-space-5);
  border-radius: var(--rp-radius-lg);
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  overflow: hidden;
  position: relative;
  transition: transform 0.4s var(--rp-ease), box-shadow 0.4s var(--rp-ease);
}

.ux-tile:hover {
  transform: translateY(-5px);
  box-shadow: var(--rp-shadow-lg);
}

/* Span helpers — the whole point of a bento layout. */
.ux-tile--w2 { grid-column: span 2; }
.ux-tile--w3 { grid-column: span 3; }
.ux-tile--h2 { grid-row: span 2; }

.ux-tile--primary {
  background: var(--rp-primary);
  color: var(--rp-on-primary);
  border-color: transparent;
}

.ux-tile--accent {
  background: var(--rp-accent);
  color: var(--rp-on-accent);
  border-color: transparent;
}

.ux-tile--image {
  padding: 0;
}

.ux-tile--image img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.ux-tile-value {
  font-family: var(--rp-font-display);
  font-size: var(--rp-fs-3xl);
  font-weight: 800;
  line-height: 1;
}

.ux-tile-label {
  font-size: var(--rp-fs-sm);
  opacity: 0.78;
}

/* Colour-swatch tile. */
.ux-swatches {
  display: flex;
  gap: 6px;
  margin-block-end: auto;
}

.ux-swatches span {
  flex: 1;
  border-radius: 10px;
  min-block-size: 46px;
}

@media (max-width: 900px) {
  .ux-bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
  }

  .ux-tile--w3 {
    grid-column: span 2;
  }
}

@media (max-width: 520px) {
  .ux-bento {
    grid-template-columns: 1fr;
  }

  .ux-tile--w2,
  .ux-tile--w3 {
    grid-column: span 1;
  }
}

/* --------------------------------------------------------------------------
   5. Case-study cards
   -------------------------------------------------------------------------- */

.ux-case {
  display: grid;
  gap: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  padding: var(--rp-space-6);
  border-radius: var(--rp-radius-lg);
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
}

.ux-case + .ux-case {
  margin-block-start: var(--rp-space-6);
}

.ux-case:nth-child(even) .ux-case-media {
  order: -1;
}

@media (max-width: 880px) {
  .ux-case {
    grid-template-columns: 1fr;
  }

  .ux-case:nth-child(even) .ux-case-media {
    order: 0;
  }
}

.ux-case-media {
  border-radius: var(--rp-radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.ux-case-media img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--rp-ease);
}

.ux-case:hover .ux-case-media img {
  transform: scale(1.04);
}

.ux-case-title {
  font-family: var(--rp-font-display);
  font-size: var(--rp-fs-2xl);
  font-weight: 800;
  line-height: var(--rp-lh-tight);
  margin-block: var(--rp-space-3);
}

/* Result metrics under each case study. */
.ux-case-results {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rp-space-6);
  margin-block-start: var(--rp-space-5);
  padding-block-start: var(--rp-space-4);
  border-block-start: 1px solid var(--rp-border);
}

.ux-case-result strong {
  display: block;
  font-family: var(--rp-font-display);
  font-size: var(--rp-fs-xl);
  color: var(--rp-primary);
}

.ux-case-result span {
  font-size: var(--rp-fs-xs);
  color: var(--rp-muted);
}

/* --------------------------------------------------------------------------
   6. Process rail
   -------------------------------------------------------------------------- */

.ux-process {
  display: grid;
  gap: var(--rp-space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  counter-reset: step;
}

.ux-step {
  position: relative;
  padding-block-start: var(--rp-space-6);
}

/* Big ghost numeral behind each step. */
.ux-step::before {
  counter-increment: step;
  content: counter(step, persian);
  position: absolute;
  inset-block-start: -0.35em;
  inset-inline-start: 0;
  font-family: var(--rp-font-display);
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--rp-primary);
  opacity: 0.14;
}

/* Connector line between steps on wide screens. */
.ux-step::after {
  content: '';
  position: absolute;
  inset-block-start: 14px;
  inset-inline-start: 0;
  inline-size: 100%;
  block-size: 1px;
  background: var(--rp-border);
}

.ux-step:last-child::after {
  display: none;
}

@media (max-width: 700px) {
  .ux-step::after {
    display: none;
  }
}

.ux-step h3 {
  position: relative;
  font-family: var(--rp-font-display);
  font-size: var(--rp-fs-lg);
  font-weight: 700;
  margin-block-end: var(--rp-space-2);
}

.ux-step p {
  color: var(--rp-muted);
  font-size: var(--rp-fs-sm);
}

/* --------------------------------------------------------------------------
   7. Tool chips
   -------------------------------------------------------------------------- */

.ux-tools .rp-chip {
  direction: ltr;
  font-size: var(--rp-fs-sm);
  padding-block: 0.5em;
  padding-inline: 1.1em;
  background: var(--rp-bg);
}

/* --------------------------------------------------------------------------
   8. Contact — split panel with a coloured side
   -------------------------------------------------------------------------- */

.ux-contact {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  border-radius: var(--rp-radius-lg);
  overflow: hidden;
  border: 1px solid var(--rp-border);
}

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

.ux-contact-side {
  padding: clamp(1.75rem, 1rem + 2.5vw, 3rem);
  background: var(--rp-primary);
  color: var(--rp-on-primary);
}

.ux-contact-side .rp-contact-icon {
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
}

.ux-contact-side .rp-contact-label {
  color: inherit;
  opacity: 0.72;
}

.ux-contact-side .rp-contact-value {
  color: inherit;
}

.ux-contact-form {
  padding: clamp(1.75rem, 1rem + 2.5vw, 3rem);
  background: var(--rp-bg);
}
