/*
Theme Name: Hexagon Webworks
Theme URI: https://hexagonwebworks.com
Author: Hexagon Webworks
Author URI: https://hexagonwebworks.com
Description: A playful, creative homepage theme for Hexagon Webworks — an Oxfordshire web design & branding studio. Features bold typography, a cream + pastel palette, and rich vanilla-JS micro-interactions (custom cursor, magnetic buttons, scroll reveals, animated counters).
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hexagon-webworks
*/

/* ---------------------------------------------------------------------------
   Design tokens
--------------------------------------------------------------------------- */
:root {
  --background: oklch(0.968 0.008 91);
  --foreground: oklch(0.16 0.01 60);
  --card: oklch(0.985 0.006 91);
  --muted-foreground: oklch(0.5 0.01 70);
  --border: oklch(0.88 0.01 85);
  --lilac: oklch(0.82 0.09 300);
  --pink: oklch(0.85 0.09 350);
  --yellow: oklch(0.88 0.16 100);
  --mint: oklch(0.86 0.1 165);
  --tangerine: oklch(0.72 0.17 55);

  --radius: 1.25rem;
  --maxw: 80rem;
  --font-sans: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid var(--foreground);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.25s ease, color 0.25s ease;
  will-change: transform;
}
.btn-primary { background: var(--foreground); color: var(--background); }
.btn-primary:hover { background: var(--lilac); color: var(--foreground); border-color: var(--foreground); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--foreground); color: var(--background); }

/* ---------------------------------------------------------------------------
   Custom cursor
--------------------------------------------------------------------------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 999px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
.cursor-dot { width: 8px; height: 8px; background: #fff; }
.cursor-ring {
  width: 40px; height: 40px;
  border: 1.5px solid #fff;
  transition: width 0.25s ease, height 0.25s ease, background-color 0.25s ease;
}
.cursor-ring.is-active { width: 64px; height: 64px; background: rgba(255,255,255,0.15); }
@media (hover: none), (max-width: 900px) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------------------------------------------------------------------------
   Navbar
--------------------------------------------------------------------------- */
.nav {
  position: fixed;
  inset: 1rem 0 auto 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.nav-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: min(calc(100% - 2rem), var(--maxw));
  padding: 0.65rem 0.65rem 0.65rem 1.4rem;
  background: color-mix(in oklab, var(--card) 82%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.nav.scrolled .nav-inner { box-shadow: 0 12px 40px -18px rgba(0,0,0,0.35); }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.05rem; }
.brand .hex {
  width: 22px; height: 22px;
  background: var(--foreground);
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), background-color 0.3s ease;
}
.brand:hover .hex { transform: rotate(120deg); background: var(--tangerine); }
.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a { font-weight: 600; font-size: 0.95rem; position: relative; padding: 0.25rem 0; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: var(--foreground);
  transform: scaleX(0); transform-origin: right; transition: transform 0.3s ease;
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav .btn { padding: 0.6rem 1.15rem; font-size: 0.9rem; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-links { display: none; }
}

/* ---------------------------------------------------------------------------
   Hero
--------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 11rem 0 5rem;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.55;
  z-index: 0;
}
.blob-1 { width: 26rem; height: 26rem; background: var(--lilac); top: -6rem; right: -6rem; }
.blob-2 { width: 18rem; height: 18rem; background: var(--mint); bottom: -8rem; left: -5rem; opacity: 0.5; }
.hero .container { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  margin-bottom: 2rem;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--tangerine); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero h1 {
  max-width: 60rem;
  font-size: clamp(3rem, 9vw, 7.5rem);
  font-weight: 700;
  line-height: 0.92;
}
.hero h1 .row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em; }
.hero h1 .word {
  display: inline-block;
  opacity: 0; transform: translateY(40px) rotate(-4deg);
  animation: wordIn 0.7s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes wordIn { to { opacity: 1; transform: translateY(0) rotate(0); } }
.hero h1 .pill {
  background: var(--lilac);
  color: var(--foreground);
  padding: 0.05em 0.3em 0.12em;
  border-radius: 0.4em;
  transform: translateY(40px) rotate(-2deg);
}
.hero h1 .pill.in { transform: translateY(0) rotate(-2deg); }
.hero-sub {
  max-width: 34rem;
  margin-top: 2rem;
  font-size: 1.2rem;
  color: var(--muted-foreground);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }

/* ---------------------------------------------------------------------------
   Marquee
--------------------------------------------------------------------------- */
.marquee {
  border-top: 2px solid var(--foreground);
  border-bottom: 2px solid var(--foreground);
  background: var(--yellow);
  overflow: hidden;
  padding: 1rem 0;
  transform: rotate(-1.5deg);
  margin: 4rem 0;
}
.marquee-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-weight: 700; font-size: 1.5rem; display: inline-flex; align-items: center; gap: 2.5rem; }
.marquee .sep { color: var(--tangerine); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------------------
   Section header
--------------------------------------------------------------------------- */
.section { padding: 5rem 0; }
.section-head { max-width: 46rem; margin-bottom: 3.5rem; }
.section-head .mono { color: var(--tangerine); }
.section-head h2 {
  margin-top: 1rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.02;
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22,1,0.36,1); }
.reveal.in-view { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------------
   Services
--------------------------------------------------------------------------- */
.service {
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  position: relative;
  transition: padding 0.35s ease;
}
.service:last-child { border-bottom: 1px solid var(--border); }
.service::before {
  content: ""; position: absolute; inset: 0;
  background: var(--lilac); z-index: -1;
  transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
  border-radius: var(--radius);
}
.service:hover::before { transform: scaleY(1); }
.service:hover { padding-inline: 2rem; }
.service .num { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted-foreground); }
.service h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
.service .desc { margin-top: 0.5rem; color: var(--muted-foreground); max-width: 34rem; }
.service .tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.service .tag { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.7rem; border: 1px solid var(--foreground); border-radius: 999px; }
.service .arrow { font-size: 1.75rem; transition: transform 0.35s ease; }
.service:hover .arrow { transform: translate(6px, -6px); }
@media (max-width: 720px) {
  .service { grid-template-columns: 1fr; gap: 0.5rem; }
  .service .arrow { display: none; }
}

/* ---------------------------------------------------------------------------
   Work
--------------------------------------------------------------------------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.work-grid .work-card:first-child { grid-column: 1 / -1; }
.work-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  aspect-ratio: 16 / 10;
}
.work-card:first-child { aspect-ratio: 21 / 9; }
.work-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.22,1,0.36,1); }
.work-card:hover img { transform: scale(1.06); }
.work-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.75rem;
  background: linear-gradient(to top, rgba(20,18,15,0.78), rgba(20,18,15,0.05) 55%, transparent);
  color: #fff;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.work-card:hover .work-overlay { opacity: 1; transform: none; }
.work-overlay h3 { font-size: 1.75rem; }
.work-overlay .meta { margin-top: 0.35rem; font-family: var(--font-mono); font-size: 0.78rem; opacity: 0.85; }
.work-overlay .w-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.work-overlay .w-tag { font-size: 0.72rem; padding: 0.2rem 0.6rem; border: 1px solid rgba(255,255,255,0.6); border-radius: 999px; }
@media (max-width: 720px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-grid .work-card:first-child { grid-column: auto; }
  .work-overlay { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------------
   Stats
--------------------------------------------------------------------------- */
.stats { background: var(--foreground); color: var(--background); border-radius: calc(var(--radius) * 1.5); padding: 4rem 2rem; }
.stats-head { max-width: 40rem; margin-bottom: 3rem; }
.stats-head h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.stat .num { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 700; }
.stat .num .accent { color: var(--tangerine); }
.stat .label { margin-top: 0.5rem; color: color-mix(in oklab, var(--background) 70%, transparent); font-size: 0.95rem; }
@media (max-width: 720px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------------------
   CTA / footer
--------------------------------------------------------------------------- */
.cta { padding: 6rem 0 3rem; }
.cta h2 { font-size: clamp(2.5rem, 8vw, 6rem); font-weight: 700; line-height: 0.95; }
.cta h2 .pill { background: var(--pink); border-radius: 0.35em; padding: 0.02em 0.28em 0.1em; display: inline-block; transform: rotate(-2deg); }
.cta-email {
  display: inline-flex; align-items: center; gap: 0.75rem;
  margin-top: 2.5rem; font-size: clamp(1.25rem, 3vw, 2rem); font-weight: 700;
  padding-bottom: 0.35rem; border-bottom: 3px solid var(--foreground);
  transition: gap 0.3s ease, color 0.3s ease;
}
.cta-email:hover { gap: 1.5rem; color: var(--tangerine); border-color: var(--tangerine); }
.footer-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.5rem; margin-top: 5rem; padding-top: 2rem; border-top: 1px solid var(--border);
  color: var(--muted-foreground); font-size: 0.9rem;
}
.socials { display: flex; gap: 1.25rem; }
.socials a { font-weight: 600; position: relative; }
.socials a:hover { color: var(--foreground); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .hero h1 .word, .hero h1 .pill { opacity: 1; transform: none; }
}
