/* ============================================================
   Pereira Digital — design tokens
   Palette/type carried forward from the established "Pereira Digital"
   brand system already used across client proposals — cream/navy/terracotta,
   Newsreader + Manrope. Kept faithful to brand rather than reinvented.
   ============================================================ */
:root {
  --bg: #F6F2EA;
  --ink: #1C2233;
  --accent: #C1652F;
  --accent-light: #E08A4F;
  --muted: #5B5F6B;
  --border: #D9D2C2;
  --headline: #33384A;
  --panel: #FDFBF7;
  --panel-alt: #EFE8DA;

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', 'Segoe UI', Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.25s;
  --dur: 0.6s;
  --dur-slow: 0.9s;

  --header-h: 76px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 12px 20px;
}
.skip-link:focus { left: 12px; top: 12px; }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 600; }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: 0.1px; }
h3 { font-size: 19px; margin-bottom: 8px; }
.lead {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(16px, 1.9vw, 19px); line-height: 1.55; color: var(--headline);
  max-width: 62ch;
}
p { color: var(--muted); font-size: 15.5px; }

.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 2.6px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px; display: block;
}
.accent-rule {
  width: 46px; height: 3px; background: var(--accent); margin: 16px 0 22px;
  transform-origin: left center; transform: scaleX(0);
}
.reveal-on-scroll.in-view .accent-rule,
.accent-rule.drawn { transform: scaleX(1); transition: transform var(--dur-slow) var(--ease); }

/* ---------- roundel / brand ---------- */
.roundel {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.roundel span { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--bg); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 18.5px; color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 14.5px;
  padding: 15px 26px; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--headline); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(28,34,51,0.22); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-small { padding: 10px 20px; font-size: 13px; }

/* ---------- pills ---------- */
.pill-row { display: flex; gap: 12px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; font-size: 13px; font-weight: 600;
  padding: 8px 18px; border: 1.5px solid var(--border); border-radius: 999px; color: var(--headline);
  background: var(--panel); transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.pill:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: transparent; transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), backdrop-filter var(--dur-fast) var(--ease);
}
.site-header.scrolled {
  background: rgba(246, 242, 234, 0.88); backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--border);
}
.headbar { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a:not(.btn) {
  font-size: 14.5px; font-weight: 600; position: relative; padding: 4px 0;
}
.main-nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--accent);
  transition: width var(--dur-fast) var(--ease);
}
.main-nav a:not(.btn):hover::after { width: 100%; }

.menu-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: none; cursor: pointer;
}
.menu-toggle span { width: 22px; height: 2px; background: var(--ink); transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; flex-direction: column; gap: 2px;
  background: var(--panel); border-top: 1px solid var(--border);
  max-height: 0; overflow: hidden; transition: max-height var(--dur) var(--ease);
}
.mobile-nav.open { max-height: 420px; }
.mobile-nav a { padding: 16px 28px; font-weight: 600; border-bottom: 1px solid var(--border); }
.mobile-nav .btn { margin: 16px 28px; justify-content: center; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding-top: var(--header-h); overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-blob {
  position: absolute; top: 8%; right: -12%; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(193,101,47,0.22), rgba(193,101,47,0.03) 70%);
  filter: blur(10px);
  animation: drift 22s ease-in-out infinite;
}
.hero-grain {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(28,34,51,0.035) 1px, transparent 1px);
  background-size: 22px 22px;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 26px) scale(1.06); }
}

.hero-inner { position: relative; z-index: 1; padding: 60px 28px 90px; }
.hero-headline { margin-bottom: 22px; }
.hero-headline .line {
  display: block; font-size: clamp(40px, 7vw, 78px); line-height: 1.04; letter-spacing: -0.5px;
}
.hero-headline .accent { color: var(--accent); font-style: italic; }
.hero-lead { margin-bottom: 30px; font-size: clamp(16.5px, 2vw, 19px); }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }
.pill-row { margin-top: 4px; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 1;
}
.scroll-cue span {
  display: block; width: 1px; height: 44px; background: linear-gradient(var(--muted), transparent);
  animation: scrolldown 1.8s ease-in-out infinite;
}
@keyframes scrolldown {
  0% { opacity: 0; transform: scaleY(0.2); transform-origin: top; }
  40% { opacity: 1; transform: scaleY(1); transform-origin: top; }
  100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; }
}

/* hero entrance (page-load) */
.reveal-item {
  opacity: 0; transform: translateY(18px);
  animation: revealUp var(--dur-slow) var(--ease) forwards;
  animation-delay: calc(var(--d) * 0.12s + 0.15s);
}
@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

/* scroll-triggered reveals */
.reveal-on-scroll {
  opacity: 0; transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal-on-scroll.in-view { opacity: 1; transform: translateY(0); }

/* ============================================================
   Sections — shared chrome
   ============================================================ */
section { padding: 96px 0; position: relative; }
.intro { text-align: left; }
.intro h2 { max-width: 18ch; }
.intro .lead { margin-top: 4px; }

/* ---------- service blocks ---------- */
.service-block { background: var(--bg); }
.service-block.alt { background: var(--panel-alt); }
.service-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 60px; align-items: center;
}
.service-grid.reverse { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
.service-grid.reverse .service-visual { order: -1; }
.service-copy h2 { max-width: 14ch; margin-bottom: 4px; }
.service-list { margin: 26px 0 30px; }
.service-list li {
  padding: 13px 0 13px 26px; border-bottom: 1px solid var(--border); position: relative;
  font-size: 14.5px; color: var(--muted); line-height: 1.6;
}
.service-list li:last-child { border-bottom: none; }
.service-list li::before {
  content: ""; position: absolute; left: 0; top: 21px; width: 10px; height: 2.5px; background: var(--accent);
}
.service-list li strong { color: var(--ink); font-weight: 700; }

/* browser-frame decorative graphic (Web Design visual) */
.browser-frame {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(28,34,51,0.25);
  transition: transform var(--dur) var(--ease);
}
.service-visual:hover .browser-frame { transform: translateY(-6px); }
.browser-chrome { display: flex; gap: 6px; padding: 12px 14px; background: var(--panel-alt); }
.browser-chrome span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.browser-body { padding: 22px; }
.bf-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.bf-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.bf-line { height: 8px; border-radius: 4px; background: var(--border); }
.bf-line.w60 { width: 60%; }
.bf-line.w40 { width: 40%; margin-bottom: 10px; }
.bf-line.w80 { width: 80%; }
.bf-hero { height: 90px; border-radius: 8px; background: linear-gradient(135deg, var(--accent-light), var(--accent)); margin-bottom: 18px; opacity: 0.85; }
.bf-row { margin-bottom: 12px; }
.bf-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.bf-card { height: 54px; border-radius: 8px; background: var(--panel-alt); border: 1px solid var(--border); }

/* signal-panel decorative graphic (AI visual) */
.signal-panel {
  background: var(--ink); border-radius: 14px; padding: 34px 30px;
  box-shadow: 0 30px 60px -20px rgba(28,34,51,0.35);
  transition: transform var(--dur) var(--ease);
}
.service-visual:hover .signal-panel { transform: translateY(-6px); }
.signal-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.signal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-light); flex-shrink: 0; }
.signal-bar {
  height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-light));
  width: 0%; transition: width 1.1s var(--ease);
}
.in-view .signal-bar { width: var(--w); }
.signal-caption { font-family: var(--serif); font-style: italic; color: #C7CBD8; font-size: 14px; margin-top: 24px; line-height: 1.5; }

/* ---------- process ---------- */
.process-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; margin-top: 40px; }
.process-step {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 26px 22px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.process-step:hover { transform: translateY(-6px); box-shadow: 0 20px 40px -18px rgba(28,34,51,0.2); }
.step-mark {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent);
  font-family: var(--serif); font-weight: 600; font-size: 15px; margin-bottom: 16px;
}
.process-step p { font-size: 14px; }

/* ---------- work / concept cards ---------- */
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; margin-top: 40px; }
.work-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.work-card:hover { transform: translateY(-6px); box-shadow: 0 24px 44px -20px rgba(28,34,51,0.25); }
.work-thumb { overflow: hidden; aspect-ratio: 7/8; }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.7s var(--ease); }
.work-card:hover .work-thumb img { transform: scale(1.06); }
.work-meta { padding: 20px 22px 24px; }
.work-meta h3 { margin-bottom: 4px; }
.work-meta p { font-size: 13.5px; margin-bottom: 12px; }
.work-tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
}

/* ---------- about ---------- */
.about { background: var(--panel-alt); }
.about-grid h2 { max-width: 16ch; }
.about-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin-top: 44px; }
.about-col p { font-size: 14.5px; }

/* ---------- cta band ---------- */
.cta-band { text-align: center; }
.cta-band .eyebrow, .cta-band h2, .cta-band .lead { margin-left: auto; margin-right: auto; }
.cta-band h2 { max-width: 16ch; }
.cta-band .lead { margin-top: 6px; margin-bottom: 30px; }
.contact-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--ink); color: #B9BECF; padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.site-footer .roundel { background: var(--accent); }
.site-footer .brand-name { color: var(--bg); }
.footer-tagline { margin-top: 14px; font-size: 14px; color: #9BA1B3; }
.site-footer nav { display: flex; flex-direction: column; gap: 12px; }
.site-footer nav a, .footer-contact a { font-size: 14.5px; color: #C7CBD8; transition: color var(--dur-fast) var(--ease); }
.site-footer nav a:hover, .footer-contact a:hover { color: var(--bg); }
.footer-contact { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.footer-bottom { display: flex; justify-content: space-between; padding: 22px 0; font-size: 12.5px; color: #7B8194; flex-wrap: wrap; gap: 8px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .mobile-nav { display: flex; }
  .service-grid, .service-grid.reverse { grid-template-columns: 1fr; gap: 40px; }
  .service-grid.reverse .service-visual { order: 0; }
  .process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .about-cols { grid-template-columns: 1fr; gap: 26px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 640px) {
  section { padding: 68px 0; }
  .hero { min-height: 92vh; }
  .hero-inner { padding: 40px 28px 70px; }
  .hero-blob { width: 380px; height: 380px; right: -20%; }
  .work-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .contact-actions { flex-direction: column; align-items: stretch; }
  .contact-actions .btn { justify-content: center; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-contact { align-items: center; }
  .footer-grid { text-align: center; }
  .site-footer .brand { justify-content: center; }
  .site-footer nav { align-items: center; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-item, .reveal-on-scroll { opacity: 1; transform: none; animation: none; transition: none; }
  .hero-blob { animation: none; }
  .scroll-cue span { animation: none; }
  .accent-rule { transform: scaleX(1); }
  .signal-bar { width: var(--w); }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
