/* ============================================================
   WE ELEMENT LTD — Custom styles & design tokens
   ------------------------------------------------------------
   Tailwind (via CDN) handles most layout/spacing utilities.
   This file holds:
     1. Brand colour + type variables (CSS custom properties)
     2. Base element styles (fonts, smooth scroll, selection)
     3. Reusable component classes (buttons, eyebrows, cards)
     4. Scroll-reveal animation classes used by script.js
   Plain CSS so it ports cleanly into WordPress.
   ============================================================ */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  /* Core palette */
  --ink:          #0E0E10; /* near-black — main dark background       */
  --charcoal:     #1A1A1C; /* dark surface / cards                    */
  --stone:        #F4F1EC; /* light section background                */
  --text-light:   #EDEDE8; /* text on dark                            */
  --text-dark:    #0E0E10; /* text on light                           */
  --muted:        #8A8A8E; /* secondary / caption text                */
  --accent:       #27aae1; /* BRAND BLUE — buttons, active links only */
  --accent-hover: #4db8ea; /* lighter blue hover state                */

  /* Derived helpers */
  --hairline:      rgba(237, 237, 232, 0.13); /* faint divider on dark  */
  --hairline-dark: rgba(14, 14, 16, 0.12);    /* faint divider on light */

  /* Layout */
  --container: 1240px; /* max content width */
  --radius: 4px;       /* restrained, architectural corners */
}

/* ---------- 2. BASE ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* keep anchored headings clear of sticky header */
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--text-dark);
  background-color: var(--stone);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Display serif for headings */
.font-display {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

/* Tighter, editorial leading for large display text */
.display-tight {
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* Italic editorial variant (hero, accents) */
.display-italic { font-style: italic; }

.text-accent { color: var(--accent); }

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- 3. COMPONENTS ---------- */

/* Section eyebrow — small uppercase tracked label */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Centered content container */
.container-x {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
@media (min-width: 1024px) {
  .container-x { padding-inline: 2.5rem; }
}

/* Dark pill behind the logo if it ever sits on a light section */
.logo-pill {
  display: inline-flex;
  align-items: center;
  background: var(--ink);
  border-radius: 6px;
  padding: 6px 10px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0.95rem 1.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease,
              border-color 0.25s ease, transform 0.25s ease;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Primary — brand blue fill */
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* Outline — for dark backgrounds (white outline) */
.btn-outline {
  background: transparent;
  color: var(--text-light);
  border-color: rgba(237, 237, 232, 0.45);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Outline — for light backgrounds */
.btn-outline-dark {
  background: transparent;
  color: var(--text-dark);
  border-color: rgba(14, 14, 16, 0.25);
}
.btn-outline-dark:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Text link with brand-blue arrow animation */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.25s ease, color 0.2s ease;
}
.link-arrow:hover { gap: 0.85rem; color: var(--accent-hover); }

/* ---------- 4. MEDIA / IMAGES ----------
   All photo containers use object-fit: cover so images crop
   gracefully without distortion at any size. */
.media-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-4-3  { aspect-ratio: 4 / 3; }
.ratio-3-4  { aspect-ratio: 3 / 4; }

/* ---------- 5. SCROLL-REVEAL ANIMATIONS ----------
   Elements tagged .reveal start hidden and nudged down, then
   fade/slide into place when scrolled into view (script.js adds
   .is-visible). Respects reduced-motion (see bottom). */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* ---------- 6. HEADER ----------
   Always a translucent ink background with blur; gains opacity
   + hairline once scrolled (script.js toggles .header-scrolled). */
.site-header {
  background-color: rgba(14, 14, 16, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.site-header.header-scrolled {
  background-color: rgba(14, 14, 16, 0.94);
  border-bottom-color: var(--hairline);
}

.mobile-menu { transition: opacity 0.3s ease; }
.mobile-menu[hidden] { display: none; }

/* ---------- 7. CARD HOVERS ---------- */
.project-card { transition: transform 0.4s ease; }
.project-card:hover { transform: translateY(-6px); }
.project-card__media img { transition: transform 0.6s ease; }
.project-card:hover .project-card__media img { transform: scale(1.05); }

.product-block { transition: transform 0.35s ease; }

/* ---------- 8. FORM ELEMENTS ---------- */
.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
  display: block;
}
.field-input {
  width: 100%;
  background: rgba(237, 237, 232, 0.04);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--text-light);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.field-input::placeholder { color: rgba(138, 138, 142, 0.85); }
.field-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(237, 237, 232, 0.07);
}
.field-input[type="file"] { padding: 0.65rem 1rem; cursor: pointer; }
.field-input[type="file"]::file-selector-button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 0.45rem 0.9rem;
  margin-right: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

/* ---------- 9. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover,
  .project-card:hover { transform: none; }
  .project-card:hover .project-card__media img { transform: none; }
}
