/* Suncraft Studios — Custom CSS */
/* Supplement to Tailwind CDN. Component layer for repeated patterns. */
/* See /DESIGN-SYSTEM.md for the full token + component reference. */

/* ─── Tokens (CSS variables for non-Tailwind use) ─────────────── */
:root {
  /* Surfaces & text */
  --color-dark:       #0F172A;   /* slate-900 — headings, hero bg */
  --color-dark-hover: #1E293B;   /* slate-800 — bg-dark hover */
  --color-prose:      #334155;   /* slate-700 — long-form body copy */
  --color-prose-soft: #475569;   /* slate-600 — blockquote, secondary prose */
  --color-muted:      #64748B;   /* slate-500 — captions, metadata */
  --color-light:      #F8FAFC;   /* slate-50 — page background */

  /* Brand */
  --color-accent:      #F97316;
  --color-accent-dark: #EA580C;
  --color-amber:       #FBBF24;

  /* Motion */
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.22, 1, 0.36, 1);  /* ease-out-quart, no overshoot */
  --duration-fast:     200ms;
  --duration-base:     300ms;
  --duration-entrance: 750ms;
}

/* ─── Base ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', sans-serif; overflow-x: hidden; }
h1, h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-variation-settings: 'SOFT' 30, 'WONK' 0;
  letter-spacing: -0.015em;
}
h3, h4 { font-family: 'Plus Jakarta Sans', sans-serif; }

[x-cloak] { display: none !important; }

/* ─── Focus ──────────────────────────────────────────────────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 0.75rem;
}

/* ─── Animation: legacy fade-in ──────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* ─── Utility: orange glow + testimonial accent stripe ────────── */
.orange-glow {
  box-shadow: 0 0 40px rgba(249, 115, 22, 0.15);
}

.testimonial-card {
  background-image: linear-gradient(to bottom right, rgba(249,115,22,0.05), transparent 60%);
}

/* ─── Header nav: sliding underline ──────────────────────────── */
.nav-header-link {
  position: relative;
  padding-bottom: 3px;
}
.nav-header-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s var(--ease-standard);
}
.nav-header-link:hover::after {
  transform: scaleX(1);
}

/* ─── Footer nav: lift + accent glow ─────────────────────────── */
.nav-footer-link {
  display: inline-block;
  transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
}
.nav-footer-link:hover {
  color: var(--color-accent) !important;
  transform: translateY(-3px);
  text-shadow: 0 4px 14px rgba(249,115,22,0.45);
}

/* ─── Eyebrow label ──────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  color: var(--color-accent);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn,
.btn-primary,
.btn-outline-light,
.btn-outline-dark,
.btn-footer-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;          /* py-3 px-8 */
  font-weight: 600;
  font-size: 1rem;                /* text-base */
  border-radius: 0.75rem;         /* rounded-xl */
  transition: background-color var(--duration-fast) ease,
              color           var(--duration-fast) ease,
              border-color    var(--duration-fast) ease,
              box-shadow      var(--duration-fast) ease;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

/* Sizes */
.btn-sm { padding: 0.5rem  1.25rem; font-size: 0.875rem; }   /* py-2 px-5 text-sm */
.btn-lg { padding: 1rem    2.5rem;  font-size: 1.125rem; font-weight: 700; }  /* py-4 px-10 text-lg */

/* Primary — solid orange */
.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background-color: var(--color-accent-dark); }

/* Outline on light background */
.btn-outline-light {
  background-color: transparent;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}
.btn-outline-light:hover {
  background-color: var(--color-accent);
  color: #fff;
}

/* Outline on dark background */
.btn-outline-dark {
  background-color: transparent;
  border: 1px solid rgba(255,255,255,0.30);
  color: #fff;
}
.btn-outline-dark:hover {
  background-color: rgba(255,255,255,0.10);
}

/* Footer CTA — dark pill on the orange/amber bar */
.btn-footer-cta {
  background-color: var(--color-dark);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.875rem 1.75rem;      /* px-7 py-3.5 */
  flex-shrink: 0;
}
.btn-footer-cta:hover { background-color: var(--color-dark-hover); }

/* Mobile floating call button (fixed bottom-right) */
.floating-call {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  background-color: var(--color-accent);
  color: #fff;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  transition: background-color var(--duration-fast) ease;
  text-decoration: none;
}
.floating-call:hover { background-color: var(--color-accent-dark); }

/* ─── Pills / Tags ───────────────────────────────────────────── */
.pill {
  display: inline-block;
  font-size: 0.75rem;             /* text-xs */
  font-weight: 700;
  padding: 0.25rem 0.75rem;       /* py-1 px-3 */
  border-radius: 9999px;          /* rounded-full */
  letter-spacing: 0.01em;
}
.pill-accent { background-color: rgba(249,115,22,0.10); color: var(--color-accent); }
.pill-amber  { background-color: rgba(251,191,36,0.20); color: var(--color-amber); }
.pill-muted  { background-color: rgba(100,116,139,0.10); color: var(--color-muted); }

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background-color: #fff;
  border: 1px solid #f3f4f6;       /* border-gray-100 */
  border-radius: 1rem;             /* rounded-2xl */
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);  /* shadow-sm */
  overflow: hidden;
  transition: border-color var(--duration-base) ease,
              box-shadow   var(--duration-base) ease;
}
.card-hover-accent:hover {
  border-color: rgba(249,115,22,0.30);
  box-shadow:
    0 0 0 4px rgba(249,115,22,0.06),
    0 20px 45px -10px rgba(249,115,22,0.18);
}

/* ─── Form fields ────────────────────────────────────────────── */
.field {
  width: 100%;
  border: 1px solid #e5e7eb;       /* border-gray-200 */
  border-radius: 0.75rem;          /* rounded-xl */
  padding: 0.75rem 1rem;           /* py-3 px-4 */
  font-size: 0.875rem;             /* text-sm */
  color: var(--color-dark);
  background-color: #fff;
  transition: border-color var(--duration-fast) ease,
              box-shadow   var(--duration-fast) ease;
}
.field::placeholder { color: rgba(100,116,139,0.50); }
.field:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(249,115,22,0.30);
}
textarea.field { resize: none; }

/* ─── Spacing utilities ──────────────────────────────────────── */
.space-section    { padding-top: 5rem;  padding-bottom: 5rem;  }   /* py-20 */
.space-section-sm { padding-top: 4rem;  padding-bottom: 4rem;  }   /* py-16 */
.space-card       { padding: 2rem; }
.space-card-sm    { padding: 1.25rem; }
@media (min-width: 768px) {
  .space-section    { padding-top: 7rem; padding-bottom: 7rem; }   /* md:py-28 */
  .space-section-sm { padding-top: 5rem; padding-bottom: 5rem; }   /* md:py-20 */
  .space-card       { padding: 2.5rem; }
  .space-card-sm    { padding: 1.5rem; }
}

/* ─── Heading scale ─────────────────────────────────────────── */
/* Use these instead of ad-hoc text-Nxl on H1/H2. */
.h1-hero,
.h1-page,
.h1-blog,
.h2-section {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-variation-settings: 'SOFT' 30, 'WONK' 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.h3-card {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  line-height: 1.15;
}

/* Homepage hero only */
.h1-hero { font-size: 3rem; }                     /* text-5xl */
@media (min-width: 768px) { .h1-hero { font-size: 3.75rem; } }   /* md:text-6xl */
@media (min-width: 1024px) { .h1-hero { font-size: 4.5rem; } }   /* lg:text-7xl */

/* Inner-page heroes (services, about, contact, portfolio, 404) */
.h1-page { font-size: 2.25rem; }                   /* text-4xl */
@media (min-width: 768px) { .h1-page { font-size: 3.75rem; } }   /* md:text-6xl */

/* Blog post + blog index */
.h1-blog { font-size: 2.25rem; }                   /* text-4xl */
@media (min-width: 768px) { .h1-blog { font-size: 3rem; } }      /* md:text-5xl */

/* Section headings within a page */
.h2-section { font-size: 1.875rem; line-height: 1.2; }   /* text-3xl */
@media (min-width: 768px) { .h2-section { font-size: 3rem; } }   /* md:text-5xl */

/* Card / sub-section headings */
.h3-card { font-size: 1.5rem; line-height: 1.25; }       /* text-2xl */
@media (min-width: 768px) { .h3-card { font-size: 1.875rem; } }  /* md:text-3xl */

/* ─── Scroll Progress Bar ───────────────────────────────────── */
#scroll-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-amber) 60%, var(--color-accent) 100%);
  background-size: 200% 100%;
  z-index: 9999;
  transition: transform 0.08s linear;
  animation: shimmer 2.5s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ─── Animation system: data-animate + data-delay ───────────── */
[data-animate] {
  opacity: 0;
  will-change: opacity, transform;
}
[data-animate="fade-up"] {
  transform: translateY(44px);
  transition: opacity   var(--duration-entrance) var(--ease-standard),
              transform var(--duration-entrance) var(--ease-standard);
}
[data-animate="fade-right"] {
  transform: translateX(-56px);
  transition: opacity   var(--duration-entrance) var(--ease-standard),
              transform var(--duration-entrance) var(--ease-standard);
}
[data-animate="fade-left"] {
  transform: translateX(56px);
  transition: opacity   var(--duration-entrance) var(--ease-standard),
              transform var(--duration-entrance) var(--ease-standard);
}
[data-animate="scale"] {
  transform: scale(0.82) translateY(52px);
  transition: opacity   600ms var(--ease-spring),
              transform 600ms var(--ease-spring);
}
[data-animate="float-in"] {
  transform: translateY(32px) scale(0.96);
  transition: opacity   900ms var(--ease-standard),
              transform 900ms var(--ease-standard);
}
[data-animate].in-view {
  opacity: 1;
  transform: none;
}
[data-animate]:not(.in-view) {
  transition-delay: 0ms !important;
}

[data-delay="75"]  { transition-delay:  75ms; }
[data-delay="100"] { transition-delay: 100ms; }
[data-delay="150"] { transition-delay: 150ms; }
[data-delay="225"] { transition-delay: 225ms; }
[data-delay="300"] { transition-delay: 300ms; }
[data-delay="375"] { transition-delay: 375ms; }
[data-delay="450"] { transition-delay: 450ms; }
[data-delay="525"] { transition-delay: 525ms; }

@media (prefers-reduced-motion: reduce) {
  [data-animate],
  [data-animate].in-view {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  #scroll-bar { animation: none; }
}

/* Generic card lift hover (used on blog index cards) */
.card-hover {
  transition: transform var(--duration-base) ease, box-shadow var(--duration-base) ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px rgba(15,23,42,0.18);
}

/* Eyebrow tag-pill (used on blog cards — same intent as .pill-accent
   but with wider letter-spacing + uppercase, kept as legacy alias) */
.tag-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(249,115,22,0.10);
  color: var(--color-accent);
}

/* ─── Long-form prose (blog articles) ───────────────────────── */
/* :where() keeps specificity at 0 so Tailwind utilities on opt-out
   blocks (.not-prose CTA) still win. */
.prose-article {
  max-width: 68ch;
}
:where(.prose-article) h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-dark);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.25;
}
:where(.prose-article) h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
:where(.prose-article) p {
  color: var(--color-prose);
  line-height: 1.75;
  margin-bottom: 1.25rem;
  font-size: 1.0625rem;
}
:where(.prose-article) p:first-of-type { font-size: 1.125rem; }
:where(.prose-article) ul {
  margin: 1rem 0 1.5rem 1.25rem;
  list-style: disc;
  color: var(--color-prose);
}
:where(.prose-article) li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}
:where(.prose-article) blockquote {
  position: relative;
  padding: 1.5rem 1.75rem 1.5rem 3rem;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--color-prose);
  margin: 2.25rem 0;
  background: rgba(249,115,22,0.05);
  border-radius: 0.75rem;
}
:where(.prose-article) blockquote::before {
  content: '\201C';
  position: absolute;
  top: 0.25rem; left: 0.75rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 3rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.55;
}
:where(.prose-article) a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
:where(.prose-article) a:hover { color: var(--color-accent-dark); }
:where(.prose-article) strong {
  color: var(--color-dark);
  font-weight: 700;
}
