/* PageSight Marketing — shared tokens, type, nav, footer */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --paper:        #f6f2ea;
  --paper-deep:   #ebe4d4;
  --paper-deeper: #e1d8c4;
  --card:         #fbf8f1;
  --ink:          #19170f;
  --ink-2:        #2c2820;
  --ink-soft:     #5c554a;
  --ink-mute:     #8a8273;
  --rule:         rgba(25, 23, 15, 0.10);
  --rule-strong:  rgba(25, 23, 15, 0.22);

  --terracotta:   #c4623d;
  --terracotta-d: #9c4b2c;
  --forest:       #3d6b3d;
  --forest-d:     #2d4f2d;
  --ochre:        #b8860b;
  --ochre-d:      #8a6308;
  --crimson:      #8b3a3a;
  --crimson-d:    #6b2828;

  --accent:       var(--terracotta);
  --accent-d:     var(--terracotta-d);

  --maxw:         1240px;

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11", "cv02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  accent-color: var(--accent);
}

/* paper grain via two-tone overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(196,98,61,0.05), transparent 60%),
    radial-gradient(1000px 700px at -5% 110%, rgba(61,107,61,0.04), transparent 60%);
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* type */
.h-display {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.96;
  font-size: clamp(48px, 7.4vw, 112px);
}
.h-1 {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
  font-size: clamp(40px, 5.2vw, 76px);
}
.h-2 {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: clamp(28px, 3.4vw, 48px);
}
.h-3 {
  font-weight: 500;
  letter-spacing: -0.012em;
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.2;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
.mono { font-family: var(--mono); }
.serif-italic { font-family: var(--serif); font-style: italic; font-weight: 400; }

.lede {
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
}

.body-large {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* layout */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 max(32px, env(safe-area-inset-right)) 0 max(32px, env(safe-area-inset-left));
  position: relative;
  z-index: 1;
}

.section { padding: clamp(72px, 9vw, 140px) 0; position: relative; z-index: 1; }
.section-tight { padding: clamp(48px, 6vw, 88px) 0; position: relative; z-index: 1; }

.hr {
  height: 1px; background: var(--rule); border: 0; margin: 0;
}

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 242, 234, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px max(32px, env(safe-area-inset-right)) 14px max(32px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 28px;
}
.nav-burger {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--rule-strong);
  background: var(--card);
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}
.nav-burger span {
  display: block; width: 16px; height: 1.5px;
  background: var(--ink);
  position: relative;
}
.nav-burger span::before, .nav-burger span::after {
  content: ""; position: absolute;
  left: 0; width: 16px; height: 1.5px;
  background: var(--ink);
}
.nav-burger span::before { top: -5px; }
.nav-burger span::after  { top: 5px; }
.nav-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; margin-left: 8px; }
.nav-link {
  position: relative;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--ink-2);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  font-weight: 450;
}
.nav-link:hover { color: var(--ink); background: rgba(25,23,15,0.04); }
.nav-link.has-sub::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  margin-left: 6px;
  opacity: 0.5;
}
.nav-cta {
  display: flex; align-items: center; gap: 10px;
}
.nav-current { color: var(--accent) !important; }

/* dropdown */
.nav-dd-wrap { position: relative; }
.nav-dd-wrap > .nav-link.has-sub { cursor: default; }

.nav-dd {
  position: absolute;
  top: calc(100% + 6px);
  left: -8px;
  min-width: 260px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 14px 40px -10px rgba(25,23,15,0.18), 0 2px 6px rgba(25,23,15,0.04);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
  z-index: 60;
}
.nav-dd-wrap:hover .nav-dd { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dd-item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.nav-dd-item:hover { background: var(--paper-deep); color: var(--ink); }
.nav-dd-item .sub {
  display: block;
  font-size: 11.5px;
  color: var(--ink-mute);
  font-family: var(--mono);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* logo wordmark */
.wordmark {
  display: inline-flex; align-items: baseline; gap: 0;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.025em;
  font-size: 19px;
  color: var(--ink);
  cursor: pointer;
}
/* P-monogram + sight: structural P via mask painted in currentColor (ink),
   accent "pupil" as a pseudo-element. Scales with font-size (em units). */
.wordmark .mark {
  display: inline-block;
  width: 0.62em; height: 0.95em;
  margin-right: 0.36em;
  position: relative;
  align-self: center;
  transform: translateY(0.02em);
  background-color: currentColor;
  border-radius: 0;
  box-shadow: none !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='28%2012%2052%2080'%3E%3Cline%20x1='34'%20y1='38'%20x2='34'%20y2='86'%20stroke='black'%20stroke-width='8.4'%20stroke-linecap='round'/%3E%3Ccircle%20cx='54'%20cy='38'%20r='20'%20fill='none'%20stroke='black'%20stroke-width='8.4'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='28%2012%2052%2080'%3E%3Cline%20x1='34'%20y1='38'%20x2='34'%20y2='86'%20stroke='black'%20stroke-width='8.4'%20stroke-linecap='round'/%3E%3Ccircle%20cx='54'%20cy='38'%20r='20'%20fill='none'%20stroke='black'%20stroke-width='8.4'/%3E%3C/svg%3E") no-repeat center / contain;
}
.wordmark .mark::before { content: none; }
.wordmark .mark::after {
  content: "";
  position: absolute;
  left: 50%; top: 32.5%;
  width: 0.205em; height: 0.205em;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: #000; }
.btn-ghost {
  color: var(--ink);
  border-color: var(--rule-strong);
  background: transparent;
}
.btn-ghost:hover { background: rgba(25,23,15,0.04); border-color: var(--ink); }
.btn-accent {
  background: var(--accent);
  color: var(--paper);
}
.btn-accent:hover { background: var(--accent-d); }
.btn-link {
  background: transparent;
  color: var(--ink);
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding: 4px 0;
  gap: 6px;
}
.btn-link:hover { color: var(--accent); border-color: var(--accent); }
.arrow {
  display: inline-block;
  width: 14px; height: 1.4px;
  background: currentColor;
  position: relative;
}
.arrow::after {
  content: "";
  position: absolute; right: 0; top: 50%;
  width: 7px; height: 7px;
  border-top: 1.4px solid currentColor;
  border-right: 1.4px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

/* chips & badges — "registration tag": bracket-framed monospace label
   (deliberately not the generic dot-in-a-pill) */
.chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 15px;
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.chip::before, .chip::after {
  content: "";
  position: absolute; top: 0; bottom: 0;
  width: 6px;
  border: 1.5px solid var(--accent);
}
.chip::before { left: 0;  border-right: 0; }
.chip::after  { right: 0; border-left: 0; }
.chip .dot {
  width: 6px; height: 6px; border-radius: 1.5px;
  background: var(--accent);
}
.chip.live .dot { background: var(--forest); animation: pulse 1.6s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.4); }
}

/* iridescent border card */
.iri {
  position: relative;
  background: var(--card);
  border-radius: 18px;
  padding: 1.5px;
  isolation: isolate;
  overflow: hidden;
}
.iri::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 0deg,
    #c4623d 0%,
    #d6a93f 14%,
    #6ea36e 28%,
    #4f8caf 42%,
    #9c6cb6 56%,
    #c4623d 72%,
    #d6a93f 86%,
    #c4623d 100%
  );
  animation: spin 9s linear infinite;
  z-index: -1;
  opacity: 0.85;
}
.iri-inner {
  background: var(--card);
  border-radius: 16.5px;
  padding: 24px;
  position: relative;
  z-index: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* plain card */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
}

/* tiny ticking caret */
.caret {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--accent);
  vertical-align: -0.06em;
  margin-left: 2px;
  animation: blink 1.05s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* FOOTER */
.footer {
  margin-top: 60px;
  background: var(--paper-deep);
  border-top: 1px solid var(--rule);
  padding: 64px 0 28px;
  position: relative;
  z-index: 1;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 56px;
}
.footer-col-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 16px;
}
.footer-link {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  color: var(--ink-2);
}
.footer-link:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.footer-bottom .meta { display: flex; gap: 24px; }

/* accent palette swap */
[data-accent="terracotta"] { --accent: #c4623d; --accent-d: #9c4b2c; }
[data-accent="forest"]     { --accent: #3d6b3d; --accent-d: #2d4f2d; }
[data-accent="ochre"]      { --accent: #b8860b; --accent-d: #8a6308; }
[data-accent="crimson"]    { --accent: #8b3a3a; --accent-d: #6b2828; }

/* MOBILE NAV DRAWER */
.mobile-drawer {
  position: fixed;
  inset: 0;
  background: rgba(25, 23, 15, 0.45);
  backdrop-filter: blur(6px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.mobile-drawer.open {
  opacity: 1;
  visibility: visible;
}
.mobile-drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(88vw, 380px);
  background: var(--paper);
  padding: 24px 24px calc(40px + env(safe-area-inset-bottom, 0));
  padding-top: calc(20px + env(safe-area-inset-top, 0));
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,.0,.2,1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.mobile-drawer.open .mobile-drawer-panel { transform: translateX(0); }
.mobile-drawer-close {
  align-self: flex-end;
  width: 40px; height: 40px;
  border: 1px solid var(--rule-strong);
  background: var(--card);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-family: var(--mono); font-size: 18px; color: var(--ink);
  line-height: 1;
}
.mobile-drawer-section { display: flex; flex-direction: column; gap: 2px; }
.mobile-drawer-section h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 14px 0 6px;
  font-weight: 500;
}
.mobile-drawer-link {
  display: block;
  padding: 14px 12px;
  font-size: 16px;
  color: var(--ink);
  border-radius: 8px;
  font-weight: 450;
  letter-spacing: -0.005em;
}
.mobile-drawer-link.sub { font-size: 14px; color: var(--ink-2); padding: 12px 12px; }
.mobile-drawer-link:active { background: var(--paper-deep); }
.mobile-drawer-cta {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.mobile-drawer-cta .btn { width: 100%; justify-content: center; padding: 14px 16px; }
body.drawer-open { overflow: hidden; }

/* utility */
.flex { display: flex; }
.col { display: flex; flex-direction: column; }
.center { align-items: center; justify-content: center; }
.between { justify-content: space-between; }
.gap-xs { gap: 6px; }
.gap-s { gap: 10px; }
.gap-m { gap: 16px; }
.gap-l { gap: 24px; }
.gap-xl { gap: 40px; }
.mt-s { margin-top: 12px; }
.mt-m { margin-top: 20px; }
.mt-l { margin-top: 36px; }
.mt-xl { margin-top: 64px; }
.mb-s { margin-bottom: 12px; }
.mb-m { margin-bottom: 20px; }
.mb-l { margin-bottom: 36px; }
.mb-xl { margin-bottom: 64px; }
.muted { color: var(--ink-soft); }
.mute2 { color: var(--ink-mute); }
.accent-text { color: var(--accent); }

@media (max-width: 980px) {
  :root { --maxw: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .nav-links { display: none; }
  .nav-cta .btn-ghost { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-inner { padding: 12px max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); gap: 12px; }
  .nav-cta { gap: 8px; }
  .wrap { padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
  .footer { padding: 48px 0 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-bottom .meta { flex-direction: column; gap: 6px; }
  .footer-link { padding: 9px 0; }
  .btn { padding: 11px 14px; min-height: 44px; }
  .h-display { font-size: clamp(40px, 11vw, 64px); }
  .h-1 { font-size: clamp(34px, 9vw, 56px); }
  .h-2 { font-size: clamp(26px, 6vw, 36px); }
  .lede { font-size: 16px; }
  .section { padding: 56px 0; }
  .section-tight { padding: 40px 0; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .nav-inner { padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
  .wrap { padding: 0 max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .iri-inner { padding: 18px !important; border-radius: 14px; }
  .iri { border-radius: 16px; }
}
