/* ==========================================================================
   ToonMark App Showcase Redesign - Minimalist Bento Grid & Editorial Stack
   ========================================================================== */

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

/* --- Design Tokens / CSS Variables --- */
:root {
  --font-body: 'Inter', sans-serif;
  --font-serif: 'Instrument Serif', serif;
  
  /* Color Palette (Carbon & Vermilion) */
  --color-bg: #090a0c;
  --color-surface: #111317;
  --color-surface-card: #0f1013;
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-bright: rgba(255, 255, 255, 0.15);
  
  --color-primary: #ff4f2b;      /* Vibrant Vermilion */
  --color-primary-dim: rgba(255, 79, 43, 0.08);
  --color-primary-bright: #ff6849;
  
  --color-text-title: #f5f5f7;
  --color-text-body: #a1a1aa;
  --color-text-muted: #6b6b76;
  
  /* Layout */
  --max-width: 1100px;
  --navbar-height: 72px;
  
  /* Transitions */
  --transition: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--color-bg);
  color: var(--color-text-body);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

/* --- Fine Wireframe Grid Overlay (Background) --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: 100%;
  border-left: 1px dashed rgba(255, 255, 255, 0.03);
  border-right: 1px dashed rgba(255, 255, 255, 0.03);
  pointer-events: none;
  z-index: 99;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  color: var(--color-text-title);
  font-weight: normal;
  letter-spacing: -0.01em;
}

.serif-title {
  font-family: var(--font-serif);
  font-style: italic;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* --- Layout Utilities --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.line-divider {
  width: 100%;
  height: 1px;
  background-color: var(--color-border);
}

/* --- Header / Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--navbar-height);
  z-index: 100;
  background-color: rgba(9, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--color-text-title);
}

.logo-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-primary);
  border-radius: 50%;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-text-title);
}

.nav-cta {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  padding: 6px 14px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  transition: var(--transition-fast);
}

.nav-cta:hover {
  background-color: var(--color-primary);
  color: var(--color-text-title);
}

/* --- Hero Section --- */
.hero {
  padding-top: calc(var(--navbar-height) + 100px);
  padding-bottom: 100px;
  border-bottom: 1px solid var(--color-border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

.hero-title {
  font-size: 4.8rem;
  line-height: 0.95;
  margin-bottom: 28px;
  letter-spacing: -0.03em;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--color-text-body);
  margin-bottom: 36px;
  font-weight: 300;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}

.btn {
  padding: 12px 24px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--color-text-title);
  color: var(--color-bg);
}

.btn-primary:hover {
  background-color: var(--color-primary);
  color: var(--color-text-title);
}

.btn-secondary {
  border: 1px solid var(--color-border);
  color: var(--color-text-title);
}

.btn-secondary:hover {
  border-color: var(--color-border-bright);
}

.hero-visual {
  display: flex;
  justify-content: flex-end;
  position: relative;
}

/* --- Interactive Hero Card Stack (No device bezels) --- */
.hero-stack {
  position: relative;
  width: 100%;
  height: 480px;
  max-width: 320px;
  margin-left: auto;
  margin-right: 0;
}

.stack-card {
  position: absolute;
  width: 220px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.stack-card img {
  width: 100%;
  height: auto;
  display: block;
}

.card-back {
  top: 40px;
  left: 0;
  transform: rotate(-6deg);
  z-index: 1;
  opacity: 0.5;
}

.card-front {
  top: 0;
  right: 0;
  transform: rotate(4deg);
  z-index: 2;
}

/* Hover Parallax fan out */
.hero-stack:hover .card-back {
  transform: translate(-32px, -8px) rotate(-10deg);
  opacity: 0.95;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.7);
}

.hero-stack:hover .card-front {
  transform: translate(24px, 12px) rotate(8deg);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.7);
}

/* --- Bento Grid Section --- */
.bento-section {
  padding: 100px 0;
  border-bottom: 1px solid var(--color-border);
}

.bento-header {
  margin-bottom: 60px;
  max-width: 600px;
}

.bento-tag {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  display: block;
}

.bento-title {
  font-size: 3.2rem;
  line-height: 1.1;
  margin-bottom: 20px;
}

.bento-desc {
  font-size: 1.1rem;
  color: var(--color-text-body);
  font-weight: 300;
}

/* The Bento Grid Layout */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(280px, auto);
  gap: 24px;
}

/* Bento Card Base */
.bento-card {
  background-color: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-bright);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Card Column/Row Spans */
.bento-card.span-2 {
  grid-column: span 2;
}

.bento-card.span-3 {
  grid-column: span 3;
}

.bento-card.row-2 {
  grid-row: span 2;
}

/* Card Info Header */
.card-info {
  margin-bottom: 24px;
  z-index: 2;
}

.card-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: 10px;
  display: block;
  font-weight: 600;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--color-text-title);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--color-text-body);
  font-weight: 300;
  line-height: 1.5;
  max-width: 380px;
}

/* Card Media Container (Displays screenshot) */
.card-media {
  position: relative;
  width: 100%;
  margin-top: auto;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  z-index: 1;
}

.card-media img {
  width: 100%;
  height: auto;
  display: block;
}

/* Custom positioning adjustments for screenshots to look aligned */
.card-media.landscape {
  max-width: 100%;
  aspect-ratio: 1794/876;
}

.card-media.portrait {
  max-width: 190px;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 941/1672;
}

/* Tall Card Media Alignment */
.bento-card.row-2 .card-media.portrait {
  max-width: 230px;
  margin-top: 24px;
  margin-bottom: -50px;
  transition: transform var(--transition);
}

.bento-card.row-2:hover .card-media.portrait {
  transform: translateY(-8px);
}

/* Feature Bullets inside Tall Card */
.feature-bullets {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bullet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--color-text-body);
}

.bullet-icon {
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary-dim);
  border: 1px solid rgba(255, 79, 43, 0.2);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}


/* --- Moments Canvas Interactive Sandbox (Tile 4) --- */
.bento-card.moments-sandbox {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.canvas-wrapper {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.canvas-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.canvas-title {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.canvas-close {
  display: flex;
  gap: 4px;
}

.canvas-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-border-bright);
}

.canvas-screen {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background-size: cover;
  background-position: center;
  transition: filter var(--transition);
}

.canvas-crop-box {
  position: absolute;
  top: 12%;
  left: 12%;
  width: 76%;
  height: 76%;
  border: 1px solid var(--color-primary);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transition: opacity var(--transition);
}

.canvas-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: #fff;
  border: 1px solid var(--color-primary);
}
.handle-tl { top: -4px; left: -4px; }
.handle-tr { top: -4px; right: -4px; }
.handle-bl { bottom: -4px; left: -4px; }
.handle-br { bottom: -4px; right: -4px; }

.canvas-doodle-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.doodle-path {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.canvas-screen.doodle-active .doodle-path {
  stroke-dashoffset: 0;
}

.canvas-quote-bubble {
  position: absolute;
  top: 25%;
  left: 20%;
  width: 60%;
  background-color: #ffffff;
  color: #1a1a1a;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 6;
  pointer-events: none;
}

.canvas-quote-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 20px;
  width: 10px;
  height: 10px;
  background-color: #ffffff;
  transform: rotate(45deg);
}

.canvas-screen.quote-active .canvas-quote-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.canvas-share-toast {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(255, 79, 43, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  pointer-events: none;
  transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
}

.canvas-screen.share-active .canvas-share-toast {
  bottom: 16px;
}

.canvas-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.canvas-btn {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  padding: 6px;
  font-size: 0.75rem;
  text-align: center;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.canvas-btn:hover, .canvas-btn.active {
  background-color: var(--color-primary-dim);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.sandbox-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sandbox-steps {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  gap: 12px;
  transition: opacity var(--transition);
}

.step-marker {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--color-primary);
  line-height: 1.2;
}

.step-details h4 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.step-details p {
  font-size: 0.85rem;
  color: var(--color-text-body);
  font-weight: 300;
}

/* --- Footer --- */
.footer {
  padding: 80px 0 40px;
  background-color: #060708;
  border-top: 1px solid var(--color-border);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer-brand {
  max-width: 360px;
}

.footer-logo {
  margin-bottom: 20px;
}

.footer-brand-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 300;
}

.footer-col-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-title);
  margin-bottom: 20px;
  font-weight: 600;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link-item a {
  font-size: 0.9rem;
  color: var(--color-text-body);
}

.footer-link-item a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* --- Responsive Media Queries --- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 60px;
    text-align: center;
  }
  
  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-visual {
    justify-content: center;
  }
  
  .hero-stack {
    margin: 0 auto;
  }

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

  .bento-card.moments-sandbox {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 3.4rem;
  }
  
  .bento-title {
    font-size: 2.4rem;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .bento-card.span-2,
  .bento-card.span-3,
  .bento-card.row-2 {
    grid-column: span 1;
    grid-row: span 1;
  }

  .bento-card.row-2 .card-media.portrait {
    margin-bottom: 0;
    max-width: 190px;
    margin-top: 24px;
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .nav-menu {
    display: none;
  }
}
