:root {
  --brand: #4c34fb;
  --brand-dark: #3421bf;
  --brand-light: #8f7bff;
  --brand-glow: rgba(76, 52, 251, 0.35);
  --ink: #2f2f2f;
  --ink-light: #555555;
  --bg-soft: #f4f5f7;
  --border: #e2e3e8;
  --white: #ffffff;
  --success: #1a7a4c;
  --success-bg: #e7f6ee;
  --error: #b3261e;
  --error-bg: #fbeceb;
  --radius: 10px;
  --radius-lg: 20px;
  --shadow: 0 4px 16px rgba(47, 47, 47, 0.08);
  --shadow-lg: 0 20px 40px -16px rgba(47, 47, 47, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--brand-dark); }

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

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.accent-gradient {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Topbar */
.topbar {
  background: linear-gradient(90deg, #202020, #2c2c2c);
  color: #ddd;
  font-size: 0.85rem;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 24px;
}
.topbar-phone {
  color: #fff;
  font-weight: 600;
}
.topbar-phone:hover { color: #cfd0ff; }

/* Header */
.site-header {
  border-bottom: 1px solid transparent;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 50;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 24px rgba(47, 47, 47, 0.07);
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
}
.brand img { display: block; transition: transform 0.25s var(--ease); }
.brand:hover img { transform: scale(1.04); }
.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  flex-wrap: wrap;
}
.site-nav a {
  position: relative;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  padding-bottom: 4px;
}
.site-nav a.active,
.site-nav a:hover { color: var(--brand); }
.site-nav a:not(.btn-nav)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  transition: right 0.25s var(--ease);
}
.site-nav a:not(.btn-nav):hover::after,
.site-nav a:not(.btn-nav).active::after { right: 0; }
.site-nav a.btn-nav {
  background: var(--bg-soft);
  padding: 8px 14px;
  border-radius: 100px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.site-nav a.btn-nav:hover { background: var(--brand); color: #fff; }
.header-call { flex-shrink: 0; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: 0 10px 24px -8px var(--brand-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px var(--brand-glow);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border-color: var(--brand);
  color: var(--brand);
}
.btn-outline:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px var(--brand-glow);
}
.btn-lg { padding: 17px 32px; font-size: 1.05rem; border-radius: 14px; }
.btn-block { display: flex; justify-content: center; width: 100%; text-align: center; }

/* Flash */
.flash {
  margin: 20px 0;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-weight: 500;
}
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-error { background: var(--error-bg); color: var(--error); }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(244, 245, 247, 0.93) 0%, rgba(238, 240, 255, 0.88) 100%),
    url('/assets/images/cornwall-coast.jpg') center / cover no-repeat;
  padding: 100px 0 92px;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}
.hero::before {
  width: 440px;
  height: 440px;
  background: var(--brand);
  opacity: 0.28;
  top: -180px;
  right: -140px;
}
.hero::after {
  width: 320px;
  height: 320px;
  background: var(--brand-light);
  opacity: 0.22;
  bottom: -160px;
  left: -100px;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero h1 { font-size: 2.8rem; font-weight: 800; }
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  background: rgba(76, 52, 251, 0.09);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 18px;
}
.hero .eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.hero-cta { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -20px var(--brand-glow), var(--shadow);
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.65);
}
.hero-card ul { margin: 0; padding-left: 20px; }
.hero-card li { margin-bottom: 10px; }

/* Sections */
section.block { padding: 72px 0; }
.block-alt { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: 2rem; font-weight: 800; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(76, 52, 251, 0.28);
}
.card h3 { color: var(--brand); }

.card-photo {
  margin: -28px -28px 20px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}
.card-photo img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.card:hover .card-photo img { transform: scale(1.05); }

/* Page banner photo */
.page-banner {
  position: relative;
  height: 320px;
  overflow: hidden;
}
.page-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.page-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 15, 20, 0) 55%, rgba(0, 0, 0, 0.25) 100%);
}

/* Pricing */
.plan {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  background: var(--white);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.plan:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.plan.featured {
  border: 2px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, var(--brand), var(--brand-light)) border-box;
  box-shadow: 0 28px 56px -20px var(--brand-glow);
  transform: translateY(-8px);
}
.plan.featured:hover { transform: translateY(-12px); }
.plan .price { font-size: 2.2rem; font-weight: 700; margin: 12px 0; }
.plan .price span { font-size: 1rem; font-weight: 400; color: var(--ink-light); }
.plan ul { list-style: none; padding: 0; margin: 20px 0; text-align: left; flex-grow: 1; }
.plan li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.plan li:before { content: "✓ "; color: var(--brand); font-weight: 700; }

/* CTA strip */
.cta-strip {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 60px 0;
  text-align: center;
}
.cta-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.16), transparent 45%);
  pointer-events: none;
}
.cta-strip h2 { color: #fff; position: relative; }
.cta-strip .btn-outline { border-color: #fff; color: #fff; position: relative; }
.cta-strip .btn-outline:hover { background: #fff; color: var(--brand); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.25); }

/* Forms */
.form-card {
  max-width: 480px;
  margin: 40px auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
}
.form-wide { max-width: 720px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 1rem;
  margin-bottom: 18px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
textarea { resize: vertical; min-height: 140px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(76, 52, 251, 0.14);
}
.field-error { color: var(--error); font-size: 0.85rem; margin-top: -12px; margin-bottom: 14px; }

/* Tables / ticket lists */
table.tickets, table.data-table { width: 100%; border-collapse: collapse; }
table.tickets th, table.tickets td,
table.data-table th, table.data-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
table.tickets th, table.data-table th { color: var(--ink-light); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.tickets tbody tr, table.data-table tbody tr { transition: background 0.2s var(--ease); }
table.tickets tbody tr:hover, table.data-table tbody tr:hover { background: var(--bg-soft); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-open { background: #fdecea; color: #c0392b; }
.badge-in_progress { background: #fff4e0; color: #b5750b; }
.badge-closed, .badge-active { background: var(--success-bg); color: var(--success); }
.badge-cancelled, .badge-pending { background: #eee; color: var(--ink-light); }

/* Ticket thread */
.thread-message {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.thread-message.from-admin { background: var(--bg-soft); }
.thread-meta { font-size: 0.82rem; color: var(--ink-light); margin-bottom: 8px; }

/* Footer */
.site-footer {
  position: relative;
  background: var(--ink);
  color: #ccc;
  margin-top: 60px;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  padding: 48px 24px;
}
.footer-brand p { color: #aaa; margin-top: 12px; }
.footer-links h4, .footer-contact h4 { color: #fff; margin-bottom: 14px; }
.footer-links a, .footer-contact a {
  display: block;
  color: #bbb;
  margin-bottom: 8px;
  transition: color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.footer-links a:hover, .footer-contact a:hover { color: #fff; padding-left: 4px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 18px 24px;
  font-size: 0.85rem;
  color: #999;
}

/* Portfolio */
.portfolio-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--white);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.portfolio-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(76, 52, 251, 0.28);
}
.portfolio-item .tag {
  display: inline-block;
  background: var(--bg-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
}

/* Tech cards (equipment / platforms we work with, accented with the vendor's own brand colour) */
.tech-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--tech-accent, var(--brand));
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.tech-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.tech-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--tech-accent, var(--brand));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.tech-card-icon svg { width: 26px; height: 26px; }
.tech-card h3 { color: var(--tech-accent, var(--brand)); }

/* Client spotlight (brand colours borrowed from each featured client's own site) */
.client-spotlight {
  background: var(--spot-bg, #0f172a);
  color: var(--spot-text, #fff);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.client-spotlight:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.client-spotlight + .client-spotlight { margin-top: 20px; }
.grid-3 + .client-spotlight { margin-top: 24px; }
.client-spotlight-content { flex: 1 1 420px; }
.client-spotlight-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 14px;
}
.client-spotlight-logo {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--spot-accent, #2563eb);
  flex-shrink: 0;
}
.client-spotlight .tag {
  display: inline-block;
  background: var(--spot-tag-bg, rgba(37, 99, 235, 0.18));
  color: var(--spot-accent-light, #60a5fa);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
}
.client-spotlight h3 { color: var(--spot-heading, #fff); }
.client-spotlight p { color: var(--spot-text-muted, #cbd5e1); margin-bottom: 0; }
.client-spotlight-cta { flex-shrink: 0; }
.client-spotlight .btn-spot {
  background: var(--spot-accent, #2563eb);
  color: var(--spot-btn-text, #fff);
}
.client-spotlight .btn-spot:hover { background: var(--spot-accent-dark, #1d4ed8); color: var(--spot-btn-text, #fff); }

/* Light variant, for clients whose own site reads better on a pale card */
.client-spotlight--light {
  border: 1px solid var(--border);
}
.client-spotlight--light h3,
.client-spotlight--light .client-spotlight-brand { color: var(--spot-heading, var(--ink)); }
.client-spotlight--light p { color: var(--spot-text-muted, var(--ink-light)); }

/* Scroll reveal (progressive enhancement, added by main.js) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.grid-3 .reveal:nth-child(2),
.grid-2 .reveal:nth-child(2) { transition-delay: 0.08s; }
.grid-3 .reveal:nth-child(3) { transition-delay: 0.16s; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .plan.featured { transform: none; }
  .plan.featured:hover { transform: translateY(-6px); }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    order: 3;
    gap: 4px;
    padding-top: 12px;
  }
  .site-nav.open { display: flex; }
  .site-header-inner { flex-wrap: wrap; }
  .header-call { order: 2; }
  .topbar-inner span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .portfolio-item, .plan, .client-spotlight, .btn, .brand img { transition: none; }
}
