/* ============================================================
   Webworx Studio — Coming Soon
   Palette drawn from the WX brand mark
   ============================================================ */

:root {
  --bg: #f2f7f4;
  --surface: #ffffff;
  --line: rgba(14, 33, 28, 0.09);
  --line-strong: rgba(14, 33, 28, 0.18);
  --brand: #00a97c;
  --green-text: #007a59;
  --blue-text: #1d5f74;
  --text: #0e211c;
  --muted: #51665e;
  --red: #ff5f56;
  --yellow: #ffbd2e;
  --radius: 14px;
  --font-sans: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

/* the code editor and terminal form deliberately stay dark —
   their scoped tokens override the light page palette */
.editor, .terminal-form {
  --text: #e8f2ee;
  --muted: #9db5ac;
  --line: rgba(232, 242, 238, 0.08);
  --line-strong: rgba(232, 242, 238, 0.16);
  --green-text: #2bd79a;
  --blue-text: #3fa3bd;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--font-mono); }

.container {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- background décor ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 40%, transparent 100%);
}

.bg-glow {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
}
.bg-glow--1 {
  width: 560px; height: 560px;
  top: -180px; right: -120px;
  background: radial-gradient(circle, rgba(0, 169, 124, 0.28), transparent 70%);
}
.bg-glow--2 {
  width: 480px; height: 480px;
  bottom: -160px; left: -140px;
  background: radial-gradient(circle, rgba(63, 163, 189, 0.2), transparent 70%);
}

/* ---------- tokens / text colours ---------- */
.tok-green { color: var(--green-text); }
.tok-blue  { color: var(--blue-text); }
.tok-white { color: var(--text); }

/* ---------- nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  position: relative;
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  padding: 7px 12px;
  border: 3px solid var(--text);
  line-height: 1;
  white-space: nowrap;
}
.logo-chip {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 13px;
  height: 13px;
  background: var(--brand);
}
.logo-mark--sm { font-size: 0.9rem; padding: 6px 10px; border-width: 2.5px; }
.logo-mark--sm .logo-chip { width: 11px; height: 11px; top: -6px; right: -6px; }

.logo-text {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
}
.logo-text em {
  font-style: normal;
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.42em;
  color: var(--green-text);
}

.nav-right { display: flex; align-items: center; gap: 18px; }

.nav-cta {
  color: var(--green-text);
  text-decoration: none;
  font-size: 0.85rem;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s;
}
.nav-cta:hover { border-color: var(--green-text); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 56px;
  padding: 72px 0 40px;
  min-height: 72vh;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.caret {
  display: inline-block;
  width: 9px;
  height: 1.05em;
  margin-left: 6px;
  vertical-align: text-bottom;
  background: var(--green-text);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

h1 {
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}

.grad {
  background: linear-gradient(92deg, #007a59 0%, #009068 55%, #1d5f74 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.h1-cursor {
  color: var(--green-text);
  animation: blink 1.1s steps(1) infinite;
  font-weight: 500;
}

.lead {
  color: var(--muted);
  max-width: 54ch;
  margin-bottom: 30px;
}
.lead strong { color: var(--text); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }

.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--brand);
  color: #04110c;
  box-shadow: 0 8px 24px rgba(0, 169, 124, 0.3);
}
.btn-primary:hover {
  background: #00b487;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 169, 124, 0.4);
}
.btn-ghost {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.65);
}
.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--green-text);
  transform: translateY(-2px);
}

/* build progress bar */
.buildbar {
  max-width: 430px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
}
.buildbar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.buildbar-track {
  height: 7px;
  border-radius: 99px;
  background: rgba(14, 33, 28, 0.1);
  overflow: hidden;
}
.buildbar-fill {
  height: 100%;
  width: 87%;
  border-radius: 99px;
  background: linear-gradient(90deg, #007a59, var(--brand));
  position: relative;
  transition: width 0.6s ease;
}
.buildbar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.8s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.buildbar-msg {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--green-text);
  min-height: 1.2em;
}

/* ---------- code editor ---------- */
.hero-editor { perspective: 1200px; }

.editor {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #132a23, #0e1f1a);
  box-shadow: 0 26px 60px rgba(13, 31, 26, 0.3), 0 0 0 1px rgba(0, 169, 124, 0.1);
  overflow: hidden;
  transform: rotateY(-4deg) rotateX(2deg);
  transition: transform 0.4s ease;
}
.editor:hover { transform: rotateY(0deg) rotateX(0deg); }

.editor-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 21, 18, 0.65);
}
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-r { background: var(--red); }
.dot-y { background: var(--yellow); }
.dot-g { background: #27c93f; }
.editor-tab {
  margin-left: 12px;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(232, 242, 238, 0.06);
}

.editor-body {
  padding: 20px 22px 24px;
  font-size: 0.83rem;
  line-height: 1.75;
  overflow-x: auto;
  color: var(--muted);
}
.editor-body code { display: block; white-space: normal; }
.editor-body .line { display: block; white-space: pre; }

/* syntax colours */
.editor-body .c { color: #5e7a70; font-style: italic; }
.editor-body .k { color: var(--blue-text); }
.editor-body .s { color: var(--green-text); }
.editor-body .v { color: #e6c07b; }
.editor-body .f { color: #7ab8f5; }
.editor-body .o { color: var(--text); }

/* typing effect (applied by JS) */
.editor.typing .line {
  visibility: hidden;
}
.editor.typing .line.typed {
  visibility: visible;
  overflow: hidden;
  animation: typeline 0.5s steps(28, end);
}
@keyframes typeline {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

/* ---------- sections ---------- */
.section { padding: 72px 0; }

h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
}

/* ---------- services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 20px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 26px 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 169, 124, 0.5);
  box-shadow: 0 18px 40px rgba(13, 31, 26, 0.12);
}
.card-icon {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  margin-bottom: 18px;
  color: var(--green-text);
  background: rgba(0, 169, 124, 0.1);
  border: 1px solid rgba(0, 169, 124, 0.28);
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green-text);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}
.card p { color: var(--muted); font-size: 0.95rem; }

.card-cta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
}
.card-link {
  margin-top: 14px;
  color: var(--green-text);
  text-decoration: none;
  font-size: 0.85rem;
}
.card-link:hover { text-decoration: underline; }

/* ---------- clients ---------- */
.clients {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.client {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  padding: 16px 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.client:hover {
  border-color: rgba(0, 169, 124, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(13, 31, 26, 0.1);
}
.client img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.75;
  transition: filter 0.2s ease, opacity 0.2s ease;
}
.client:hover img { filter: none; opacity: 1; }
.client img.tall { height: 58px; }
/* white-artwork logo, recoloured to ink for the light background */
.client img.invert { filter: invert(0.88) grayscale(1); }
.client:hover img.invert { filter: invert(0.88) grayscale(1); opacity: 1; }

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: start;
}
.contact-copy h2 { margin-bottom: 20px; }
.contact-hint { margin-top: 26px; color: var(--muted); font-size: 0.85rem; }

.terminal-form {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #132a23, #0e1f1a);
  box-shadow: 0 24px 56px rgba(13, 31, 26, 0.32);
  overflow: hidden;
}
.form-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 21, 18, 0.65);
  color: var(--muted);
  font-size: 0.75rem;
}
.form-head span:last-child { margin-left: 10px; }
.form-body { padding: 24px; display: grid; gap: 18px; }

.field { display: grid; gap: 8px; }
.field label {
  font-size: 0.8rem;
  color: var(--muted);
}
.req { color: var(--green-text); }

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 21, 18, 0.65);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: rgba(157, 181, 172, 0.65); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 169, 124, 0.18);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239db5ac' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
textarea { resize: vertical; min-height: 110px; }

.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

.terminal-form .btn { width: 100%; border: none; font-family: var(--font-mono); }

.form-status { font-size: 0.82rem; min-height: 1.2em; color: var(--muted); }
.form-status.ok { color: var(--green-text); }
.form-status.err { color: var(--red); }
.form-status a { color: var(--green-text); }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.footer-note { color: var(--muted); font-size: 0.8rem; }
.footer-joke { color: var(--muted); font-size: 0.75rem; }

/* ---------- focus visibility ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--green-text);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
    padding-top: 48px;
    min-height: 0;
  }
  .hero-editor { order: 2; }
  .editor { transform: none; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  /* 16px controls prevent iOS Safari zoom-on-focus */
  input, select, textarea { font-size: 1rem; }
  .nav { flex-wrap: wrap; }
  .logo-text { letter-spacing: 0.1em; }
  .section { padding: 52px 0; }
  .clients { gap: 12px; }
  .client { padding: 13px 20px; font-size: 0.85rem; }
  .form-body { padding: 18px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .editor.typing .line { visibility: visible; }
}
