/*
Theme Name: Canvas Agency
Theme URI: https://example.com
Author: Your Studio
Author URI: https://example.com
Description: A fast, bold, dark-themed WordPress theme built for design & digital marketing agencies. Custom post types for Services, Portfolio, Team, Pricing and Testimonials, wired into Advanced Custom Fields. Zero external font/script requests by default for maximum speed.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
Tested up to: 6.6
Text Domain: canvas-agency
*/

/* ============================================
   1. RESET
============================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* ============================================
   2. DESIGN TOKENS
============================================ */
:root {
  /* color */
  --canvas: #0a0a0c;
  --panel: #141417;
  --panel-2: #1b1b20;
  --ink: #f2f2f0;
  --mist: #8e8e97;
  --signal: #c9ff3d;   /* primary accent — lime */
  --pulse: #8b6cff;    /* secondary accent — violet */
  --line: rgba(242, 242, 240, 0.1);
  --line-strong: rgba(242, 242, 240, 0.18);

  /* type */
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Roboto Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --fs-h1: clamp(2.5rem, 6vw, 5.25rem);
  --fs-h2: clamp(2rem, 4vw, 3.1rem);
  --fs-h3: clamp(1.3rem, 2.2vw, 1.7rem);
  --fs-lead: clamp(1.05rem, 1.4vw, 1.25rem);
  --fs-body: 1.05rem;
  --fs-small: 0.85rem;
  --fs-eyebrow: 0.78rem;

  /* layout */
  --container: 1240px;
  --radius: 8px;
  --section-pad: clamp(64px, 10vw, 128px);
  --gap: clamp(20px, 3vw, 40px);
}

/* ============================================
   3. BASE
============================================ */
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p.lead { font-size: var(--fs-lead); color: var(--mist); }

::selection { background: var(--signal); color: #0a0a0c; }

a.inline-link { color: var(--signal); border-bottom: 1px solid currentColor; }
a.inline-link:hover { color: var(--pulse); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--section-pad) 0; position: relative; }
.section--tight { padding: clamp(40px, 6vw, 80px) 0; }
.section--panel { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

/* ============================================
   4. SIGNATURE: EYEBROW / INSPECT LABELS / CROSSHAIRS
============================================ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 18px;
}
.eyebrow::before { content: "//"; color: var(--pulse); }

.spec-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--mist);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 8px;
  display: inline-block;
}

.crosshair { position: absolute; width: 14px; height: 14px; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: var(--signal); }
.crosshair::before { width: 100%; height: 1px; top: 50%; left: 0; }
.crosshair::after { width: 1px; height: 100%; left: 50%; top: 0; }
.crosshair--tl { top: -7px; left: -7px; }
.crosshair--tr { top: -7px; right: -7px; }
.crosshair--bl { bottom: -7px; left: -7px; }
.crosshair--br { bottom: -7px; right: -7px; }
.has-crosshairs { position: relative; }
.has-crosshairs:hover .crosshair, .has-crosshairs:focus-within .crosshair { opacity: 1; }

/* ============================================
   5. BUTTONS
============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn--solid { background: var(--signal); color: #0a0a0c; }
.btn--solid:hover { background: var(--ink); transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--signal); color: var(--signal); transform: translateY(-2px); }
.btn--block { width: 100%; justify-content: center; }

/* ============================================
   6. HEADER / NAV
============================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,12,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; max-width: var(--container); margin: 0 auto;
}
.site-logo { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.site-logo span { color: var(--signal); }

.main-nav ul { display: flex; gap: 32px; }
.main-nav a {
  font-size: 0.92rem; font-weight: 600; color: var(--mist);
  position: relative; padding: 4px 0; transition: color .2s ease;
}
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--ink); }
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: var(--signal); transition: width .2s ease;
}
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 16px; }
.nav-toggle { display: none; width: 28px; height: 20px; position: relative; }
.nav-toggle span { position: absolute; left: 0; width: 100%; height: 2px; background: var(--ink); transition: all .25s ease; }
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 18px; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ============================================
   7. HERO
============================================ */
.hero { padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 80px); }
.hero__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--gap); align-items: center; }
.hero__copy h1 { margin-bottom: 22px; }
.hero__copy p.lead { max-width: 46ch; margin-bottom: 34px; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero__frame {
  position: relative;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  aspect-ratio: 4 / 3.2;
  overflow: hidden;
}
.hero__frame::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
}
.hero__frame .blob {
  position: absolute; width: 65%; height: 65%; left: 18%; top: 16%;
  background: radial-gradient(circle at 30% 30%, var(--pulse), transparent 60%),
              radial-gradient(circle at 70% 75%, var(--signal), transparent 55%);
  filter: blur(40px); opacity: 0.55; border-radius: 40%;
}
.hero__frame img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.hero__tag { position: absolute; font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink); background: var(--canvas); border: 1px solid var(--line-strong); border-radius: 4px; padding: 4px 8px; z-index: 2; }
.hero__tag--1 { top: 16px; left: 16px; }
.hero__tag--2 { bottom: 16px; right: 16px; }
.hero__tag--3 { top: 16px; right: 16px; color: var(--signal); border-color: var(--signal); }
.hero__corner { position: absolute; width: 18px; height: 18px; }
.hero__corner::before, .hero__corner::after { content: ""; position: absolute; background: var(--mist); }
.hero__corner::before { width: 100%; height: 1px; top: 0; }
.hero__corner::after { width: 1px; height: 100%; left: 0; }
.hero__corner--tl { top: -1px; left: -1px; }
.hero__corner--tr { top: -1px; right: -1px; transform: scaleX(-1); }
.hero__corner--bl { bottom: -1px; left: -1px; transform: scaleY(-1); }
.hero__corner--br { bottom: -1px; right: -1px; transform: scale(-1); }

/* ============================================
   8. SECTION HEAD
============================================ */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--gap); margin-bottom: clamp(32px, 5vw, 56px); flex-wrap: wrap; }
.section-head h2 { max-width: 18ch; }
.section-head p { color: var(--mist); max-width: 40ch; }

/* ============================================
   9. GRIDS & CARDS
============================================ */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); }

.card--service .card__icon { font-family: var(--font-mono); color: var(--signal); font-size: 0.8rem; margin-bottom: 18px; }
.card--service h3 { margin-bottom: 10px; }
.card--service p { color: var(--mist); font-size: 0.95rem; }
.card--service .card__num { position: absolute; top: 24px; right: 24px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--line-strong); }

.card--portfolio { padding: 0; overflow: hidden; }
.card--portfolio .thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--panel-2); }
.card--portfolio .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card--portfolio:hover .thumb img { transform: scale(1.05); }
.card--portfolio .body { padding: 22px 24px; }
.card--portfolio .meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card--portfolio .tag { font-family: var(--font-mono); font-size: 0.72rem; color: var(--signal); text-transform: uppercase; letter-spacing: 0.05em; }
.card--portfolio .stat { font-family: var(--font-mono); font-size: 0.72rem; color: var(--mist); }
.card--portfolio h3 { font-size: 1.2rem; }

.card--pricing { display: flex; flex-direction: column; }
.card--pricing.is-featured { border-color: var(--signal); background: linear-gradient(160deg, var(--panel), var(--panel-2)); }
.card--pricing .badge { font-family: var(--font-mono); font-size: 0.7rem; color: var(--signal); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.card--pricing .price { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; letter-spacing: -0.02em; margin: 6px 0 2px; }
.card--pricing .price small { font-family: var(--font-body); font-weight: 500; font-size: 0.85rem; color: var(--mist); }
.card--pricing ul { margin: 24px 0; display: flex; flex-direction: column; gap: 10px; }
.card--pricing li { font-size: 0.92rem; color: var(--ink); display: flex; gap: 10px; align-items: flex-start; }
.card--pricing li::before { content: "+"; color: var(--signal); font-family: var(--font-mono); font-weight: 700; }
.card--pricing .btn { margin-top: auto; }

.card--testimonial { display: flex; flex-direction: column; gap: 16px; }
.card--testimonial .stars { color: var(--signal); font-family: var(--font-mono); font-size: 0.85rem; }
.card--testimonial .quote { font-size: 1rem; color: var(--ink); }
.card--testimonial .person { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.card--testimonial .person img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.card--testimonial .person strong { display: block; font-size: 0.9rem; }
.card--testimonial .person span { font-size: 0.8rem; color: var(--mist); }

.card--team { text-align: left; padding: 0; overflow: hidden; }
.card--team .photo { aspect-ratio: 1/1; background: var(--panel-2); overflow: hidden; }
.card--team .photo img { width: 100%; height: 100%; object-fit: cover; }
.card--team .body { padding: 20px; }
.card--team .role { font-family: var(--font-mono); font-size: 0.78rem; color: var(--signal); margin-bottom: 8px; display: block; }

/* ============================================
   10. STATS
============================================ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); border-top: 1px solid var(--line); padding-top: var(--gap); }
.stat__num { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 4vw, 3.2rem); color: var(--signal); letter-spacing: -0.02em; }
.stat__label { font-family: var(--font-mono); font-size: 0.8rem; color: var(--mist); margin-top: 6px; }

/* ============================================
   11. CTA BAND
============================================ */
.cta-band {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(40px, 6vw, 72px);
  text-align: center;
  position: relative;
  background: var(--panel);
}
.cta-band h2 { max-width: 26ch; margin: 0 auto 16px; }
.cta-band p { color: var(--mist); max-width: 42ch; margin: 0 auto 32px; }
.cta-band__actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* ============================================
   12. FOOTER
============================================ */
.site-footer { border-top: 1px solid var(--line); padding: clamp(48px, 6vw, 80px) 0 32px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--gap); margin-bottom: 48px; }
.footer__brand p { color: var(--mist); margin-top: 14px; max-width: 32ch; font-size: 0.92rem; }
.footer__col h4 { font-size: 0.85rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--mist); margin-bottom: 16px; font-weight: 600; }
.footer__col ul { display: flex; flex-direction: column; gap: 10px; }
.footer__col a { font-size: 0.92rem; color: var(--ink); }
.footer__col a:hover { color: var(--signal); }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--mist); flex-wrap: wrap; gap: 12px; }

/* ============================================
   13. FORMS / CONTACT
============================================ */
.form-field { margin-bottom: 20px; }
.form-field label { display: block; font-size: 0.85rem; font-family: var(--font-mono); color: var(--mist); margin-bottom: 8px; }
.form-field input, .form-field textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 16px; font-size: 0.95rem; transition: border-color .2s ease;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--signal); outline: none; }
.form-message { padding: 14px 18px; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 20px; }
.form-message--success { background: rgba(201,255,61,0.1); border: 1px solid var(--signal); color: var(--signal); }
.form-message--error { background: rgba(255,90,90,0.1); border: 1px solid #ff5a5a; color: #ff8a8a; }

.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--gap); }
.contact-info .spec-tag { margin-bottom: 24px; }
.contact-info dl { display: flex; flex-direction: column; gap: 18px; margin-top: 24px; }
.contact-info dt { font-family: var(--font-mono); font-size: 0.78rem; color: var(--mist); margin-bottom: 4px; }
.contact-info dd { font-size: 1.05rem; }

/* ============================================
   14. BLOG / SINGLE
============================================ */
.post-list { display: grid; gap: 32px; }
.post-card { display: grid; grid-template-columns: 280px 1fr; gap: 28px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.post-card .thumb { aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius); background: var(--panel); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--signal); text-transform: uppercase; margin-bottom: 10px; }
.post-card h2 { font-size: 1.5rem; margin-bottom: 10px; }
.post-card p { color: var(--mist); }

.single-article { max-width: 760px; margin: 0 auto; }
.single-article .entry-meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--signal); margin-bottom: 18px; text-transform: uppercase; }
.single-article .entry-title { margin-bottom: 24px; }
.single-article .entry-thumb { margin-bottom: 40px; border-radius: var(--radius); overflow: hidden; }
.single-article .entry-content { font-size: 1.05rem; color: #d8d8da; }
.single-article .entry-content > * + * { margin-top: 1.3em; }
.single-article .entry-content h2 { font-size: 1.6rem; margin-top: 2em; }
.single-article .entry-content h3 { font-size: 1.3rem; margin-top: 1.6em; }
.single-article .entry-content img { border-radius: var(--radius); }
.single-article .entry-content a { color: var(--signal); border-bottom: 1px solid currentColor; }
.single-article .entry-content blockquote { border-left: 3px solid var(--signal); padding-left: 20px; color: var(--mist); font-style: italic; }
.single-article .entry-content ul, .single-article .entry-content ol { padding-left: 1.4em; list-style: disc; }
.single-article .entry-content ol { list-style: decimal; }

.pagination { display: flex; gap: 12px; margin-top: 48px; }
.pagination a, .pagination span { padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.85rem; }
.pagination .current { background: var(--signal); color: var(--canvas); border-color: var(--signal); }

/* ============================================
   15. 404 / SEARCH
============================================ */
.error-404 { text-align: center; padding: clamp(80px, 12vw, 140px) 0; }
.error-404 .code { font-family: var(--font-mono); font-size: clamp(4rem, 12vw, 8rem); color: var(--panel-2); font-weight: 800; line-height: 1; -webkit-text-stroke: 1px var(--line-strong); }

/* ============================================
   16. SCROLL REVEAL (progressive enhancement)
============================================ */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================
   17. RESPONSIVE
============================================ */
@media (max-width: 980px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__frame { order: -1; max-height: 360px; }
  .contact-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .post-card { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .main-nav { position: fixed; inset: 64px 0 0 0; background: var(--canvas); padding: 32px 24px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
  .main-nav ul { flex-direction: column; gap: 24px; }
  .nav-open .main-nav { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-toggle { display: block; }
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero__actions { flex-direction: column; align-items: stretch; }
}
