/* --- 1. Global Styles & Theming (Copied from Flexbox page) --- */
:root {
   /* Color Palette */
   --color-primary: #3498db;
   --color-secondary: #2c3e50;
   --color-danger: #e74c3c;
   --color-success: #1abc9c;
   --color-warning: #f1c40f;
   --color-info: #9b59b6;
   --color-special: #e67e22;

   /* Light Theme */
   --bg-page: #ffffff;
   --bg-controls: #f8f9fa; /* Re-using for cards */
   --bg-visualizer: #ecf0f1;
   --bg-code: #f1f1f1;
   --bg-code-inline: rgba(0, 0, 0, 0.05);
   --bg-tooltip: var(--color-secondary);
   --bg-input: #ffffff;

   --text-body: #333333;
   --text-heading: var(--color-secondary);
   --text-code: #333333;
   --text-tooltip: #ffffff;
   --text-input: #000000;
   --text-label-selected: var(--color-danger);

   --border-main: #dee2e6;
   --border-visualizer: var(--color-primary);
   --border-input: #cccccc;

   --shadow-main: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
   :root {
      /* Dark Theme */
      --bg-page: #1a202c;
      --bg-controls: #2d3748; /* Re-using for cards */
      --bg-visualizer: #2a2a33;
      --bg-code: #1e1e1e;
      --bg-code-inline: rgba(255, 255, 255, 0.1);
      --bg-tooltip: #4a5568;
      --bg-input: #2d3748;

      --text-body: #e2e8f0;
      --text-heading: #f7fafc;
      --text-code: #d4d4d4;
      --text-tooltip: #f7fafc;
      --text-input: #e2e8f0;
      --text-label-selected: #ff7575;

      --border-main: #4a5568;
      --border-input: #4a5568;

      --shadow-main: 0 4px 12px rgba(0, 0, 0, 0.2);
   }
}

/* --- 2. Base Styles --- */
* {
   box-sizing: border-box;
   margin: 0;
   padding: 0;
}

body {
   font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
   line-height: 1.7;
   background-color: var(--bg-page);
   color: var(--text-body);
   transition: background-color 0.2s ease, color 0.2s ease;
   padding-bottom: 50px;
}

.container {
   max-width: 1200px;
   margin: 0 auto;
   padding: 20px;
}

h1,
h2,
h3 {
   color: var(--text-heading);
   margin-bottom: 15px;
   line-height: 1.3;
}

h2 {
   font-size: 2rem;
   border-bottom: 2px solid var(--color-primary);
   padding-bottom: 10px;
   margin-top: 40px;
}

p {
   margin-bottom: 15px;
}

code {
   font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
   background-color: var(--bg-code-inline);
   color: var(--text-code);
   padding: 2px 5px;
   border-radius: 4px;
}

button {
   cursor: pointer;
   padding: 12px 20px; /* Larger buttons for a landing page */
   border: none;
   border-radius: 5px;
   background-color: var(--color-primary);
   color: white;
   font-size: 1rem;
   font-weight: bold;
   transition: background-color 0.2s ease, transform 0.2s ease;
}

button:hover {
   opacity: 0.85;
   transform: translateY(-2px);
}

/* --- 3. Landing Page Specific Styles --- */

/* --- Header --- */
.hero-header {
   text-align: center;
   padding: 50px 20px;
   border-bottom: 1px solid var(--border-main);
   margin-bottom: 40px;
}

.hero-header h1 {
   font-size: 3rem;
   margin-bottom: 10px;
}

.hero-header .subtitle {
   font-size: 1.25rem;
   color: var(--text-body);
   opacity: 0.9;
   max-width: 800px;
   margin: 0 auto;
}

/* --- Intro Section --- */
#intro {
   max-width: 900px;
   margin: 0 auto 50px auto;
   text-align: center;
   font-size: 1.1rem;
}

#intro h2 {
   border: none;
   font-size: 2.25rem;
}

/* --- Layout Methods Grid --- */
.layout-grid {
   display: grid;
   /* Creates a responsive grid that fits as many 300px cards as it can */
   grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
   gap: 25px;
   margin-top: 30px;
}

.layout-card {
   background: var(--bg-controls); /* Using the same as the controls panel */
   border: 1px solid var(--border-main);
   border-radius: 8px;
   padding: 25px;
   box-shadow: var(--shadow-main);
   transition: transform 0.2s ease, box-shadow 0.2s ease;
   display: flex;
   flex-direction: column; /* Ensures content stacks and button is at bottom */
}

.layout-card:hover {
   transform: translateY(-5px);
   /* A slightly stronger shadow on hover */
   box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Dark mode hover shadow */
@media (prefers-color-scheme: dark) {
   .layout-card:hover {
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
   }
}

.layout-card h3 {
   color: var(--color-primary); /* Make the title stand out */
   margin-top: 0;
   font-size: 1.5rem;
}

.layout-card .era-tag {
   font-size: 0.8rem;
   font-weight: bold;
   color: var(--color-special);
   background-color: var(--bg-code-inline);
   padding: 3px 8px;
   border-radius: 4px;
   display: inline-block;
   margin-bottom: 15px;
}

.layout-card .era-tag.modern {
   color: var(--color-success);
}
.layout-card .era-tag.legacy {
   color: var(--color-warning);
   color: #333;
}
.layout-card .era-tag.ancient {
   color: var(--color-danger);
}

.layout-card p {
   font-size: 0.95rem;
   margin-bottom: 20px;
   flex-grow: 1; /* Pushes the button to the bottom */
}

.layout-card a {
   text-decoration: none;
   display: inline-block;
   width: 100%;
   text-align: center;
}

.layout-card a button {
   width: 100%;
}

/* --- Footer --- */
footer {
   text-align: center;
   margin-top: 60px;
   padding-top: 20px;
   border-top: 1px solid var(--border-main);
   color: var(--text-body);
   opacity: 0.7;
   font-size: 0.9rem;
}

/* --- Responsive Tweaks --- */
@media (max-width: 768px) {
   .hero-header h1 {
      font-size: 2.25rem;
   }
   .hero-header .subtitle {
      font-size: 1.1rem;
   }
   #intro h2 {
      font-size: 1.75rem;
   }
}
