/* JRS Digital — shared site stylesheet */

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/playfair-display-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/space-grotesk-500.woff2') format('woff2');
}

/* Dark is the primary/default theme — it's the studio's actual product identity
   (matches the real PriceMinder app exactly), not just a media-query override.
   Light stays available for anyone with a light system preference. */
:root {
  color-scheme: dark light;
  --bg: #0B0B11;
  --surface: #14141C;
  --text: #EDEDF2;
  --text-muted: #9797A8;
  --border: rgba(237, 237, 242, 0.1);
  --accent: #C8A96E;
  --accent-strong: #DDC28C;
  --shadow: rgba(0, 0, 0, 0.35);
  --focus-ring: #C8A96E;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #FDFDFB;
    --surface: #F3F1EC;
    --text: #14141C;
    --text-muted: #5A5A6B;
    --border: rgba(20, 20, 28, 0.12);
    --accent: #8a6d3b;
    --accent-strong: #6e5527;
    --shadow: rgba(20, 20, 28, 0.08);
    --focus-ring: #6e5527;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--accent); text-decoration-color: var(--border); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.figure {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  font-weight: 500;
}

.site-header {
  padding: 28px 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.site-header nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}
.site-header nav a:hover { color: var(--text); }
.site-header nav a.active {
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

.hero {
  padding: 56px 0 40px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
}
.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 46ch;
  margin: 0;
}
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* ---------- homepage hero: asymmetric, phone-forward ---------- */
.hero-asym {
  position: relative;
  min-height: 620px;
  padding: 32px 0 24px;
}
.hero-asym .hero-text {
  position: relative;
  z-index: 3;
  max-width: 480px;
  padding-left: 40px;
}
.hero-asym .hero-text h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  max-width: 11ch;
}
.hero-asym .hero-phone-stage {
  position: absolute;
  top: 0;
  right: -20px;
  width: min(34vw, 250px);
  z-index: 2;
}
.hero-asym .hero-phone-stage .phone-frame { --rest: -6deg; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}
.stat .stat-value {
  font-size: 1.5rem;
  display: block;
}
.stat .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Leader-line callout: a visual enhancement layered on the SAME .stat markup
   used elsewhere, not a separate decorative-only element. The connecting line
   is aria-hidden; .stat-value/.stat-label stay real, visible, announced text. */
.stats.stats-callout {
  position: absolute;
  left: 0;
  width: 100%;
  display: block;
  gap: 0;
  margin-top: 0;
}
.stats-callout .stat {
  position: absolute;
  right: 108%;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.stats-callout .stat-value {
  font-size: 0.95rem;
  order: 0;
}
.stats-callout .stat-label {
  order: 1;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  color: var(--text);
}
.stats-callout .callout-line {
  order: 2;
  width: 34px;
  height: 1px;
  background: var(--border);
  flex: none;
}
.stats-callout .callout-dot {
  order: 3;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

section { padding: 40px 0; }
section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ---------- rotated edge label (hero) ---------- */
.rotated-label {
  position: absolute;
  left: 4px;
  top: 140px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Space Grotesk', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.rotated-label::before {
  content: "";
  display: block;
  width: 1px;
  height: 60px;
  background: var(--border);
}

/* ---------- asymmetric pull-quote (About) ---------- */
.pull-quote {
  display: grid;
  grid-template-columns: 0.8fr 2fr;
  gap: 32px;
  align-items: start;
}
.pull-quote .label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.pull-quote blockquote {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.25;
}
.pull-quote .note {
  margin: 22px 0 0;
  max-width: 48ch;
  color: var(--text-muted);
}

/* ---------- phone-frame: real screenshot or CSS-drawn content, same shell ---------- */
.phone-frame {
  width: 100%;
  aspect-ratio: 9 / 19.3;
  border-radius: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 40px 80px -28px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 14px 10px;
  position: relative;
}
/* Neutral device bezel detail — a plain speaker slit rather than an
   iPhone-specific notch/Dynamic-Island shape, so the mockup reads as
   "a phone" rather than one specific brand's phone. */
.phone-frame__notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--text);
  opacity: 0.16;
  z-index: 1;
}
.phone-screen {
  position: relative;
  margin-top: 24px;
  height: calc(100% - 32px);
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg);
}
.phone-screen-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.phone-screen-content {
  padding: 16px 14px;
  height: 100%;
  box-sizing: border-box;
}
.phone-screen-media + .phone-screen-content { display: none; }

.phone-frame--tilt {
  transform: rotate(var(--rest, -6deg)) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg));
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
  will-change: transform;
}
.phone-frame--tilt.tilting {
  box-shadow: 0 60px 100px -26px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
@media (prefers-reduced-motion: reduce) {
  .phone-frame--tilt {
    transform: rotate(var(--rest, -6deg));
    transition: none;
  }
}

/* Touch/no-hover fallback for the 3D tilt: since there's no pointer to
   drive rotation from, loop a gentle auto-tilt instead of showing a static
   phone. Applied by hero-effects.js when (hover: hover)/(pointer: fine)
   doesn't match. */
.phone-frame--auto {
  animation: phone-auto-tilt 6s ease-in-out infinite;
}
@keyframes phone-auto-tilt {
  0%   { transform: rotate(var(--rest, -6deg)) rotateX(-3deg) rotateY(-5deg); }
  50%  { transform: rotate(var(--rest, -6deg)) rotateX(3deg) rotateY(5deg); }
  100% { transform: rotate(var(--rest, -6deg)) rotateX(-3deg) rotateY(-5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .phone-frame--auto {
    animation: none;
    transform: rotate(var(--rest, -6deg));
  }
}
.phone-stage {
  position: relative;
  perspective: 1600px;
}
.phone-stage--solo {
  max-width: 280px;
  margin: 0 auto;
}

.phone-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ---------- phone-gallery (Work page cascade) ---------- */
.phone-gallery {
  position: relative;
  height: 600px;
  perspective: 1600px;
}
.phone-gallery .phone-stage {
  position: absolute;
  width: 190px;
}
.phone-gallery .p-back { top: 0; left: 8%; z-index: 1; }
.phone-gallery .p-back .phone-frame { --rest: -10deg; opacity: 0.92; }
.phone-gallery .p-front { top: 64px; left: 40%; z-index: 2; width: 210px; }
.phone-gallery .p-front .phone-frame { --rest: 5deg; }

.app-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.app-list-item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.app-list-item:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--shadow);
}
.app-list-item .app-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
  margin-right: 0.75rem;
}
.app-list-item .app-desc {
  color: var(--text-muted);
  flex: 1 1 320px;
  margin: 0;
}
.app-list-item .app-link {
  font-weight: 600;
  white-space: nowrap;
}

.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 8px 24px var(--shadow);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.feature h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.feature p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}
.feature-icon {
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.feature-icon svg { display: block; width: 26px; height: 26px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #0B0B11;
}
.btn-primary:hover { background: var(--accent-strong); color: #0B0B11; }
.btn-large {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}
.btn-disabled {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  cursor: default;
  pointer-events: none;
}

.cta {
  text-align: center;
  padding: 48px 24px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.cta h2 { margin-bottom: 0.5rem; }
.cta p { color: var(--text-muted); margin-top: 0; }
.cta .btn { margin-top: 1rem; }

.mockup-caption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.site-footer {
  margin-top: 48px;
  padding: 32px 0 64px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

.contact-card {
  text-align: center;
  padding: 56px 24px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.contact-card p {
  color: var(--text-muted);
  max-width: 46ch;
  margin: 0.5rem auto 1.5rem;
}

.note-muted {
  color: var(--text-muted);
  margin-top: 24px;
}

.prose { max-width: 680px; padding-top: 32px; padding-bottom: 64px; }
.prose h1 { font-size: 1.6rem; margin-bottom: 0.1rem; }
.prose p.meta { color: var(--text-muted); margin-top: 0; font-size: 0.9rem; }
.prose h2 { font-size: 1.1rem; margin-top: 2.2rem; }
.prose code {
  background: rgba(127, 127, 127, 0.15);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Tablet: the hero phone stops bleeding past the container, the rotated edge
   label and leader-line callouts (which assume a lot of open side margin)
   step aside, and the Work page's phone cascade tightens up. */
@media (max-width: 900px) {
  .rotated-label { display: none; }
  .hero-asym .hero-text { padding-left: 0; max-width: 100%; }
  .hero-asym .hero-phone-stage {
    position: static;
    width: 220px;
    margin: 32px auto 0;
  }
  .hero-asym .hero-phone-stage .phone-frame { --rest: -3deg; }
  .stats.stats-callout { position: static; left: auto; width: auto; display: flex; flex-wrap: wrap; gap: 2rem; }
  .stats-callout .stat {
    position: static;
    display: block;
    white-space: normal;
  }
  .stats-callout .stat-value { display: block; order: 0; }
  .stats-callout .stat-label {
    order: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.78rem;
    color: var(--text-muted);
  }
  .stats-callout .callout-line, .stats-callout .callout-dot { display: none; }
  .pull-quote { grid-template-columns: 1fr; }
  .phone-gallery {
    height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: center;
  }
  .phone-gallery .phone-stage { position: static; width: 200px; }
  .phone-gallery .p-back .phone-frame,
  .phone-gallery .p-front .phone-frame { --rest: -3deg; }
}

@media (max-width: 560px) {
  .site-header .container { flex-direction: column; align-items: flex-start; gap: 8px; }
  .app-list-item { flex-direction: column; align-items: flex-start; }
  .app-list-item .app-desc { flex: 0 0 auto; }
  .footer-grid { flex-direction: column; align-items: flex-start; }
}
