@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --ink: #2b1c1c;
  --ink-soft: #5c4b4b;
  --muted: #8c7e7e;
  --paper: #ffffff;
  --panel: #fcfaf9;
  --panel-strong: #ffffff;
  --line: rgba(155, 27, 48, 0.12);
  --maroon: #9b1b30;
  --maroon-light: #b82b43;
  --maroon-dark: #701121;
  --gold: #c49a45;
  --charcoal: #1c1112;
  --shadow: 0 24px 60px rgba(155, 27, 48, 0.08);
  --shadow-soft: 0 12px 30px rgba(155, 27, 48, 0.04);
  --radius: 6px;
  --font-main: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--ink);
  background: var(--paper);
  background-image: 
    radial-gradient(circle at 100% 0%, rgba(155, 27, 48, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(196, 154, 69, 0.03) 0%, transparent 40%);
  line-height: 1.6;
  overflow-x: hidden;
}

body.preview-open,
body.menu-open {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

iframe {
  border: 0;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 28px;
  padding: 20px clamp(20px, 4vw, 60px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: padding 300ms ease, background 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.site-header.is-scrolled {
  padding-top: 12px;
  padding-bottom: 12px;
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--line);
  box-shadow: 0 10px 30px rgba(155, 27, 48, 0.05);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  transition: opacity 200ms ease;
}

.brand:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--maroon);
  color: #fff;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  box-shadow: 0 8px 16px rgba(155, 27, 48, 0.2);
}

.brand strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.desktop-nav {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 3vw, 40px);
}

.desktop-nav a {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  position: relative;
  transition: color 200ms ease;
}

.desktop-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--maroon);
  transition: width 300ms ease;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
  color: var(--maroon);
}

.desktop-nav a:hover::after {
  width: 100%;
}

.header-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-weight: 600;
  cursor: pointer;
  transition: all 300ms ease;
  font-size: 0.95rem;
}

.header-cta,
.button.primary {
  background: var(--maroon);
  color: white;
  border-color: var(--maroon);
  box-shadow: 0 8px 20px rgba(155, 27, 48, 0.2);
}

.button.secondary {
  background: transparent;
  color: var(--maroon);
  border-color: var(--maroon);
}

.header-cta:hover,
.button.primary:hover,
.header-cta:focus-visible,
.button.primary:focus-visible {
  background: var(--maroon-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(155, 27, 48, 0.3);
}

.button.secondary:hover {
  background: rgba(155, 27, 48, 0.05);
  transform: translateY(-2px);
}

/* Menu Toggle */
.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 6px auto;
  background: var(--maroon);
  transition: transform 300ms ease, opacity 300ms ease;
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  top: 80px;
  left: 20px;
  right: 20px;
  z-index: 99;
  display: none;
  padding: 20px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.mobile-menu.is-open {
  display: grid;
  gap: 10px;
}

.mobile-menu a {
  padding: 14px;
  border-radius: 6px;
  color: var(--ink);
  font-weight: 600;
  text-align: center;
}

.mobile-menu a:hover {
  background: rgba(155, 27, 48, 0.05);
  color: var(--maroon);
}

/* Hero */
.hero {
  min-height: clamp(680px, 85vh, 900px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding: 140px clamp(20px, 5vw, 72px) 80px;
}

.hero > * {
  min-width: 0;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--maroon);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  position: relative;
}

.eyebrow::after {
  content: '';
  position: absolute;
  top: 50%;
  left: calc(100% + 12px);
  width: 40px;
  height: 1px;
  background: var(--maroon);
}

h1,
h2 {
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(3.2rem, 8vw, 5.5rem);
}

h2 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
}

.hero-lede {
  max-width: 600px;
  color: var(--ink-soft);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-preview {
  position: relative;
  width: 100%;
  min-height: 560px;
  overflow: hidden;
  background: #f8f5f5;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  isolation: isolate;
  transition: transform 400ms ease, box-shadow 400ms ease;
}

.hero-preview:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 80px rgba(155, 27, 48, 0.12);
}

.hero-preview iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1440px;
  height: 920px;
  pointer-events: none;
  transform: scale(var(--hero-preview-scale, 0.54));
  transform-origin: top left;
}

.preview-label {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 2;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--maroon);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
}

.hero-preview::after,
.template-preview::after {
  content: "Open Preview";
  position: absolute;
  inset: auto 20px 20px auto;
  z-index: 2;
  padding: 12px 20px;
  background: var(--maroon);
  color: white;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.hero-preview:hover::after,
.hero-preview:focus-visible::after,
.template-card:hover .template-preview::after,
.template-card:focus-within .template-preview::after {
  opacity: 1;
  transform: translateY(0);
}

/* Stats */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 clamp(20px, 5vw, 72px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.stats-strip div {
  padding: 40px 24px;
  background: var(--panel-strong);
  text-align: center;
  transition: background 300ms ease;
}

.stats-strip div:hover {
  background: var(--panel);
}

.stats-strip strong {
  display: block;
  color: var(--maroon);
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 4rem);
  line-height: 1;
  margin-bottom: 8px;
}

.stats-strip span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Sections */
.section {
  padding: clamp(80px, 10vw, 140px) clamp(20px, 5vw, 72px);
}

.section-heading {
  max-width: 820px;
  margin-bottom: clamp(40px, 6vw, 64px);
}

.section-heading p:not(.eyebrow) {
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

/* Template Grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.template-card {
  position: relative;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

.template-card:hover,
.template-card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(155, 27, 48, 0.3);
  box-shadow: var(--shadow);
}

.template-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #fdfdfd;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.template-preview iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1440px;
  height: 900px;
  pointer-events: none;
  transform: scale(var(--template-preview-scale, 0.255));
  transform-origin: top left;
}

.template-meta {
  padding: 24px;
}

.template-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.template-number {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.template-category {
  padding: 4px 10px;
  background: rgba(155, 27, 48, 0.05);
  color: var(--maroon);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.template-meta h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
  font-family: var(--font-display);
}

.template-meta p {
  min-height: 50px;
  color: var(--muted);
  font-size: 0.95rem;
}

.template-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.mini-button {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease;
}

.mini-button:hover,
.mini-button:focus-visible {
  background: var(--maroon);
  color: white;
  border-color: var(--maroon);
}

/* About Section */
.about-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
  background: var(--charcoal);
  color: white;
  padding: clamp(80px, 10vw, 140px) clamp(20px, 5vw, 72px);
}

.about-panel {
  max-width: 760px;
}

.about-panel .eyebrow {
  color: var(--gold);
}
.about-panel .eyebrow::after {
  background: var(--gold);
}

.about-panel h2 {
  color: white;
}

.about-panel p {
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
}

.about-list {
  display: grid;
  gap: 16px;
}

.about-list article,
.process-card {
  padding: 28px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.about-list article {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.about-list article:hover {
  transform: translateX(8px);
  background: rgba(255, 255, 255, 0.05);
}

.process-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.about-list span,
.process-card span {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.process-card span {
  color: var(--maroon);
}

.about-list h3,
.process-card h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  font-family: var(--font-display);
}

.about-list h3 {
  color: white;
}

.about-list p {
  color: rgba(255, 255, 255, 0.7);
}

.process-card p {
  color: var(--ink-soft);
}

.process-section {
  background: var(--panel);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* Contact Section */
.contact-section {
  padding: clamp(60px, 8vw, 120px) clamp(20px, 5vw, 72px);
}

.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  padding: clamp(32px, 5vw, 64px);
  background: var(--maroon);
  color: white;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(155, 27, 48, 0.2);
}

.contact-card .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}
.contact-card .eyebrow::after {
  background: rgba(255, 255, 255, 0.3);
}

.contact-card h2 {
  color: white;
  max-width: 780px;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
}

.contact-actions {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.contact-card .button.primary {
  background: white;
  color: var(--maroon);
  border-color: white;
}

.contact-card .button.primary:hover {
  background: #f8f5f5;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.contact-email {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 200ms ease;
}

.contact-email:hover,
.contact-email:focus-visible {
  color: white;
}

/* Footer */
.site-footer {
  padding: 40px clamp(20px, 5vw, 72px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--panel-strong);
  font-size: 0.95rem;
  text-align: center;
}

/* Preview Overlay */
.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  background: rgba(28, 17, 18, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.preview-overlay.is-open {
  display: block;
  animation: fadeIn 300ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.preview-toolbar {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 2;
  width: min(760px, calc(100vw - 32px));
  min-height: 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 10px 12px 10px 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  transform: translateX(-50%);
}

.preview-toolbar span {
  display: block;
  color: var(--maroon);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-toolbar strong {
  display: block;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.device-switcher {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
}

.device-switcher button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
}

.device-switcher button:hover {
  color: var(--ink);
}

.device-switcher button.is-active {
  background: white;
  color: var(--maroon);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.close-preview {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: rgba(155, 27, 48, 0.08);
  color: var(--maroon);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: all 200ms ease;
}

.close-preview:hover {
  background: var(--maroon);
  color: white;
}

.preview-stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 90px 24px 24px;
}

.preview-stage iframe {
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  transition: width 300ms ease;
}

.preview-stage.is-tablet iframe {
  width: min(768px, 100%);
}

.preview-stage.is-mobile iframe {
  width: min(390px, 100%);
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 130px;
  }
  
  .hero-preview {
    min-height: 480px;
  }

  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-section,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .contact-actions {
    justify-items: start;
  }
}

@media (max-width: 768px) {
  .desktop-nav,
  .header-cta {
    display: none;
  }
  
  .menu-toggle {
    display: block;
  }

  .template-grid {
    grid-template-columns: 1fr;
  }
  
  .process-grid {
    grid-template-columns: 1fr;
  }

  .stats-strip {
    grid-template-columns: 1fr;
    gap: 1px;
  }
  
  h1 {
    font-size: clamp(2.8rem, 10vw, 3.8rem);
  }
}
