:root {
  /* Design System - Corporate Rubber Stamp Theme */
  --stamp-blue: #1a365d;
  --stamp-red: #8b0000;
  --paper-bg: #fdfdfb;
  --paper-texture: #f0ede6;
  --ink-opacity: 0.85;
  
  --wf-font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --wf-font-display: 'Georgia', serif;
  
  --wf-space-xs: 4px;
  --wf-space-sm: 8px;
  --wf-space-md: 16px;
  --wf-space-lg: 24px;
  --wf-space-xl: 48px;
  --wf-space-2xl: 64px;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--wf-font-main);
  background-color: var(--paper-bg);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(var(--paper-texture) 1px, transparent 0),
    radial-gradient(var(--paper-texture) 1px, transparent 0);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 4rem);
}

header {
  padding: var(--wf-space-lg) 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  background: white;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-text {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--stamp-blue);
  text-transform: uppercase;
  letter-spacing: 1px;
}

main {
  width: 100%;
}

section {
  margin-top: var(--wf-space-xl);
  padding: var(--wf-space-lg) 0;
}

main > :first-child {
  margin-top: 0;
}

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--wf-space-2xl) 0;
  background: radial-gradient(circle at center, #ffffff 0%, var(--paper-bg) 100%);
}

.hero-title {
  font-family: var(--wf-font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: var(--wf-space-md);
  color: var(--stamp-blue);
}

/* Stamp Component */
.stamp-container {
  position: relative;
  width: 400px;
  height: 400px;
  margin: var(--wf-space-xl) auto;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1));
}

.stamp {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 8px double var(--stamp-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: white;
  opacity: var(--ink-opacity);
  transform: rotate(-5deg); /* Natural stamp angle */
}

/* Distressing effect */
.stamp::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.2'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: 50%;
}

.stamp-inner-border {
  width: 90%;
  height: 90%;
  border: 3px solid var(--stamp-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.stamp-logo-wrapper {
  width: 65%;
  height: 65%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  z-index: 2;
  /* Make the logo look like it's part of the stamp ink */
  mix-blend-mode: multiply;
  filter: grayscale(100%) contrast(150%);
}

.stamp-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stamp-text-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: none;
}

.stamp-text-circle svg {
  width: 100%;
  height: 100%;
  fill: var(--stamp-blue);
  font-family: var(--wf-font-main);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Action Section */
.controls {
  background: white;
  padding: var(--wf-space-xl) 0;
  border-top: 1px solid #eee;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--wf-space-lg);
}

.card {
  background: var(--paper-bg);
  padding: var(--wf-space-lg);
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-4px);
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--stamp-blue);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.btn-outline {
  background: transparent;
  color: var(--stamp-blue);
  border: 2px solid var(--stamp-blue);
}

footer {
  margin-top: var(--wf-space-2xl);
  padding: var(--wf-space-xl) 0;
  background: #111;
  color: white;
  text-align: center;
}

.footer-logo {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--wf-space-md);
  display: block;
}

/* Utility */
.text-center { text-align: center; }
.mt-md { margin-top: var(--wf-space-md); }
.italic-muted { font-style: italic; opacity: 0.6; }

/* Document Preview Styles */
.document-view {
  background: white;
  box-shadow: 0 0 50px rgba(0,0,0,0.1);
  max-width: 800px;
  margin: 40px auto;
  padding: 80px;
  min-height: 1000px;
  position: relative;
  border: 1px solid #ddd;
}

.doc-header {
  border-bottom: 2px solid #333;
  padding-bottom: 20px;
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.doc-header-left h1 { margin: 0; color: var(--stamp-blue); }
.doc-header-left p { margin: 5px 0 0 0; color: #666; }
.doc-header-right { text-align: right; color: #999; }

.doc-content h2 { text-transform: uppercase; letter-spacing: 2px; }
.doc-body { margin-top: 40px; }
.doc-line { border-bottom: 1px solid #eee; margin-bottom: 15px; height: 1.2em; }

.doc-stamp-area {
  position: absolute;
  bottom: 150px;
  right: 80px;
  pointer-events: none;
}

.doc-stamp-area .stamp {
  width: 180px;
  height: 180px;
  border-width: 4px;
  border-style: double;
  opacity: 0.8;
  transform: rotate(-15deg);
}

.doc-stamp-area .stamp-inner-border { border-width: 1px; }
.doc-stamp-area .stamp-logo-wrapper { width: 60%; height: 60%; }
.doc-stamp-area .stamp-text-circle svg { font-size: 8px; }

.signature-line {
  width: 250px;
  border-top: 1px solid #333;
  margin-top: 100px;
  text-align: center;
  font-size: 0.8rem;
  color: #666;
}

.print-actions { margin-bottom: 40px; display: flex; justify-content: center; gap: 10px; }

@keyframes stamp-press {
  0% { transform: scale(1.5) rotate(-15deg); opacity: 0; }
  100% { transform: scale(1) rotate(-5deg); opacity: var(--ink-opacity); }
}

.stamp-animate {
  animation: stamp-press 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
