/* ═══════════════════════════════════════════════════════
   WEBSITE-DESIGN.CSS — Section 02 (Iconiq Creatives)
   Browser-mockup cards · Hover preview · Blue → Pink accents
═══════════════════════════════════════════════════════ */

/* ── Section ───────────────────────────────────────── */
.webd-section {
  background: #060606;
  position: relative;
  padding: clamp(80px, 12vw, 140px) 0 clamp(60px, 8vw, 100px);
  overflow: hidden;
}

.webd-section::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -8%;
  width: 55%;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(65, 189, 254, 0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.webd-section::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -8%;
  width: 50%;
  height: 55%;
  background: radial-gradient(ellipse at center, rgba(225, 17, 251, 0.06) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.webd-bg-num {
  position: absolute;
  top: clamp(16px, 3vw, 48px);
  right: clamp(12px, 4vw, 64px);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(100px, 18vw, 220px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.03);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* ── Eyebrow ────────────────────────────────────────── */
.webd-eyebrow {
  margin-bottom: clamp(24px, 4vw, 40px);
  position: relative;
  z-index: 1;
}

.webd-section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-blue);
}

.webd-section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--gradient-brand-h);
  display: block;
  flex-shrink: 0;
}

/* ── Intro ──────────────────────────────────────────── */
.webd-block-intro {
  text-align: center;
  max-width: 680px;
  margin: 0 auto clamp(40px, 6vw, 64px);
  position: relative;
  z-index: 1;
}

.webd-block-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--color-white);
  margin-bottom: clamp(12px, 1.6vw, 18px);
}

.webd-block-desc {
  font-family: var(--font-body);
  font-size: clamp(var(--text-sm), 1.4vw, var(--text-base));
  line-height: 1.65;
  color: var(--color-text-secondary);
}

/* ── Grid ───────────────────────────────────────────── */
.webd-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(56px, 7vw, 76px);   /* wide enough for the phone's right overhang */
  max-width: 940px;
  margin: 0 auto;
}

@media (max-width: 560px) { .webd-grid { grid-template-columns: 1fr; max-width: 420px; gap: 40px; } }

/* ── Card ───────────────────────────────────────────── */
.webd-card {
  --webd-accent: var(--color-blue);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s var(--ease-out-quart) var(--webd-delay, 0ms),
    transform 0.7s var(--ease-out-quart) var(--webd-delay, 0ms);
}
.webd-card.in-view { opacity: 1; transform: none; }

/* Whole-card click target (keeps valid markup: no iframe inside <a>) */
.webd-card__link {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: 14px;
}
.webd-card__link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--webd-accent) 55%, transparent);
}

/* Browser frame */
.webd-card__frame {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: #0d0d10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.8);
  transition:
    transform var(--t-base),
    border-color var(--t-base),
    box-shadow var(--t-base);
}

.webd-card__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #131317;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.webd-card__dots { display: inline-flex; gap: 5px; flex-shrink: 0; }
.webd-card__dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.webd-card__dots i:first-child { background: rgba(255, 95, 86, 0.55); }
.webd-card__dots i:nth-child(2) { background: rgba(255, 189, 46, 0.55); }
.webd-card__dots i:nth-child(3) { background: rgba(39, 201, 63, 0.5); }

.webd-card__url {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

/* Viewport (holds screenshot + fallback + hover overlay) */
.webd-card__viewport {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0d0d10;
}

.webd-card__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 120% at 20% 15%, color-mix(in srgb, var(--webd-accent) 26%, transparent) 0%, transparent 55%),
    linear-gradient(140deg, #101017 0%, #07070b 100%);
}

.webd-card__mono {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--webd-accent) 78%, white 22%);
  opacity: 0.9;
}

/* Full-page screenshot of the live site. Rendered at full height (width
   100%, height auto); the viewport shows the top, and hover scrolls it. */
.webd-shot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: block;
  z-index: 2;
  opacity: 0;
  transform: translateY(0);            /* transform is driven by JS (rAF) */
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.webd-card.is-live .webd-shot { opacity: 1; }

/* Hover "Visit site" chip — small, so the scrolling site stays visible */
.webd-card__visit {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #05060a;
  background: color-mix(in srgb, var(--webd-accent) 88%, white 12%);
  box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t-base), transform var(--t-base);
}
.webd-card__visit svg { width: 14px; height: 14px; }

/* Meta */
.webd-card__meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 2px;
}
.webd-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-white);
  transition: color var(--t-fast);
}
/* Brand logo (with name) in place of the plain text name */
.webd-card__logo {
  display: block;
  align-self: flex-start;
  height: 30px;
  width: auto;
  max-width: 82%;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 2px;
  opacity: 0.95;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.webd-card:hover .webd-card__logo,
.webd-card:focus-within .webd-card__logo {
  opacity: 1;
  transform: translateY(-1px);
}
.webd-card__cat {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ── iPhone 17 Pro mock — overlaps the browser frame's bottom-right ── */
.webd-phone {
  position: absolute;
  z-index: 4;
  right: -50px;                 /* sit to the right so only ~half overlaps the desktop */
  bottom: 40px;
  width: clamp(64px, 26%, 108px);
  aspect-ratio: 191 / 412;
  border-radius: clamp(14px, 4.5vw, 22px);
  background: linear-gradient(150deg, #33333b 0%, #0b0b0f 60%);
  box-shadow:
    0 20px 34px -14px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.5s ease, transform 0.5s var(--ease-out-quart),
    box-shadow var(--t-base);
  pointer-events: none;
}
.webd-card.is-live-m .webd-phone { opacity: 1; transform: none; }

.webd-phone__screen {
  position: absolute;
  inset: 3px;
  border-radius: clamp(11px, 3.6vw, 18px);
  overflow: hidden;
  background: #0d0d10;
}
.webd-mshot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: block;
  transform: translateY(0);            /* transform is driven by JS (rAF) */
}
.webd-phone__island {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 6px;
  border-radius: 100px;
  background: #000;
  z-index: 2;
}

/* keep the "Visit site" chip clear of the phone */
.webd-card.has-phone .webd-card__visit { left: 10px; right: auto; }

/* On one-column (phones) keep the mock from overflowing the screen edge. */
@media (max-width: 560px) {
  .webd-phone { right: -14px; }
}

/* Hover (pointer devices only) — lift the frame + auto-scroll the live site */
@media (hover: hover) {
  .webd-card:hover .webd-card__frame,
  .webd-card:focus-within .webd-card__frame {
    transform: translateY(-6px);
    border-color: transparent;                 /* no border highlight — just the glow */
    box-shadow:
      0 26px 50px -24px rgba(0, 0, 0, 0.9),
      0 0 44px -6px color-mix(in srgb, var(--webd-accent) 55%, transparent);
  }

  /* The desktop + phone scroll is driven by JS (rAF) so they stay content-locked. */

  /* Phone lifts a touch and picks up the same accent glow as the frame. */
  .webd-card:hover .webd-phone,
  .webd-card:focus-within .webd-phone {
    transform: translateY(-6px) scale(1.01);
    box-shadow:
      0 26px 40px -16px rgba(0, 0, 0, 0.9),
      inset 0 0 0 1px rgba(255, 255, 255, 0.10),
      0 0 34px -6px color-mix(in srgb, var(--webd-accent) 55%, transparent);
  }

  .webd-card:hover .webd-card__visit,
  .webd-card:focus-within .webd-card__visit {
    opacity: 1;
    transform: translateY(0);
  }
  .webd-card:hover .webd-card__name,
  .webd-card:focus-within .webd-card__name {
    color: color-mix(in srgb, var(--webd-accent) 65%, white 35%);
  }
}

/* ── Footer CTA ─────────────────────────────────────── */
.webd-footer {
  display: flex;
  justify-content: center;
  margin-top: clamp(40px, 6vw, 64px);
  position: relative;
  z-index: 1;
}

.webd-footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border: 1px solid rgba(65, 189, 254, 0.28);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.07em;
  color: var(--color-blue);
  text-decoration: none;
  transition:
    background var(--t-base),
    border-color var(--t-base),
    box-shadow var(--t-base),
    transform var(--t-base);
}
.webd-footer-cta svg { width: 13px; height: 13px; }

.webd-footer-cta:hover {
  background: rgba(65, 189, 254, 0.07);
  border-color: rgba(65, 189, 254, 0.55);
  box-shadow: 0 0 32px rgba(65, 189, 254, 0.12);
  transform: translateY(-2px);
}

/* ── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .webd-card { opacity: 1; transform: none; transition: none; }
  .webd-shot,
  .webd-card__frame,
  .webd-card__visit { transition: none; }
  .webd-card:hover .webd-shot,
  .webd-card:focus-within .webd-shot { transform: translateY(0); }
  .webd-card:hover .webd-mshot,
  .webd-card:focus-within .webd-mshot { transform: translateY(0); }
}
