@layer reset, layout, base, components, patterns, pages, themes, utilities;

@import "./layers/reset.css" layer(reset);
@import "./layers/layouts.css" layer(layout);

@layer base {
  :root {
    --brand-red: hsl(3.73, 99.05%, 58.63%);
    --brand-yellow-light: hsl(37.98, 92.16%, 60%);
    --brand-yellow-dark: hsl(37.24, 91.34%, 49.8%);
    --brand-green-light: hsl(155, 63.16%, 29.8%);
    --brand-green-dark: hsl(154.62, 55.56%, 45.88%);
    --brand-blue-light: hsl(216.43, 44.44%, 24.71%);
    --brand-blue-dark: hsl(182.09, 71.43%, 31.57%);

    --brand-neutral-0: hsl(42.86, 100%, 98.63%);
    --brand-neutral-1: hsl(36.92, 10.08%, 74.71%);
    --brand-neutral-2: hsl(30, 4.1%, 52.16%);
    --brand-neutral-3: hsl(290, 5.08%, 23.14%);
    --brand-neutral-4: hsl(267.27, 12.94%, 16.67%);
    --brand-neutral-5: hsl(290, 9.38%, 12.55%);

    /* Typography */
    --font-size-base: 1rem;
    --line-height-base: 1.5;
  }

  body {
    --bg-color: var(--brand-neutral-0);
    --font-color: var(--brand-neutral-5);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--font-color);
    background-color: var(--bg-color, black);
    overflow-y: hidden;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-block-start: 0;
    margin-block-end: 0.5em;
    font-weight: 800;
    font-family: "Jost", sans-serif;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  /* Make layout areas visible */
  .layout-primary>* {
    padding-block: 2rem;
  }

  /* Visual separation for sections */
  section {
    /* border-radius: 0.5rem; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    */
    padding: 2rem;
  }

  /* Header styling */
  header {
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  header h1 {
    color: var(--color-neutral-900);
    margin-bottom: 0.25em;
  }

  header p {
    color: var(--color-neutral-600);
    font-size: 1.125rem;
  }

  /* List styling for demos */
  ul:not([class]) {
    margin-block-start: 0;
  }

  ul:not([class]) li {
    margin-block-end: 0.25em;
  }
}

@layer components {

  /* Demo grid cards */
  .grid-auto-fit>div {
    background-color: var(--color-neutral-100);
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid var(--color-neutral-300);
  }

  .with-sidebar {
    display: grid;
    gap: var(--sidebar-gap, 1rem);
    grid-template-columns: var(--sidebar-width, 250px) 1fr;
  }

  /* Sidebar demo styling
  .with-sidebar {
    min-height: 200px;
    background: var(--color-neutral-100);
    border-radius: 0.5rem;
    overflow: hidden;
  } */

  .with-sidebar>* {
    padding: 1rem;
  }

  .with-sidebar>aside {
    background: var(--color-neutral-200);
    border-radius: 0.5rem;
  }

  .with-sidebar>main {
    background: var(--color-neutral-50, #fafafa);
    border-radius: 0.5rem;
  }

  /* Cluster demo (tags) */
  .cluster>span {
    padding: 0.5rem 1rem;
    background: var(--color-neutral-200);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
  }

  .cluster>span:hover {
    background: var(--color-neutral-300);
  }

  /* Example content boxes */
  .example-box {
    background: var(--color-neutral-100);
    border: 1px solid var(--color-neutral-300);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@layer patterns {

  /* Feature grid pattern */
  .feature-grid {
    --grid-min-width: 250px;
    --grid-gap: 2rem;
  }

  .feature-grid h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--color-neutral-800);
  }

  .feature-grid ul {
    color: var(--color-neutral-600);
  }
}

@layer utilities {

  .header-logo {
    display: grid;
    width: clamp(1.5rem, 6rem + 30.62vw, 40.25rem);
    white-space: nowrap;
    margin-inline: auto;
    padding-inline: 0 !important;
    text-align: center;

  }

  /* Full viewport centering utility */
  .center-screen {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* Centered with max-width constraint */
  .center-content {
    display: grid;
    place-items: center;
    min-height: inherit;
  }

  .center-content>* {
    max-width: 65ch;
    width: 100%;
    padding-inline: var(--content-padding, 1rem);
  }

  /* Spacing utilities */
  .mt-0 {
    margin-top: 0;
  }

  .mb-1 {
    margin-bottom: 0.5rem;
  }

  .mb-2 {
    margin-bottom: 1rem;
  }

  .mb-3 {
    margin-bottom: 1.5rem;
  }

  .mb-4 {
    margin-bottom: 2rem;
  }

  /* Text utilities */
  .text-muted {
    color: var(--color-neutral-600);
  }

  .text-small {
    font-size: 0.875rem;
  }

  /* Background utilities */
  .bg-light {
    background-color: var(--color-neutral-100);
  }

  .bg-white {
    background-color: white;
  }

  /* Border radius utilities */
  .rounded {
    border-radius: 0.5rem;
  }

  .rounded-sm {
    border-radius: 0.25rem;
  }

  /* Shadow utilities */
  .shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .shadow-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  /* Temporary: visualize layout areas (remove when not needed) */
  .debug-layout .content {
    background-color: rgba(0, 255, 0, 0.05);
    outline: 2px dashed rgba(0, 255, 0, 0.3);
  }

  .debug-layout .narrow {
    background-color: rgba(0, 0, 255, 0.05);
    outline: 2px dashed rgba(0, 0, 255, 0.3);
  }

  .debug-layout .popout {
    background-color: rgba(255, 0, 0, 0.05);
    outline: 2px dashed rgba(255, 0, 0, 0.3);
  }

  .debug-layout .full-width {
    background-color: rgba(255, 255, 0, 0.05);
    outline: 2px dashed rgba(255, 255, 0, 0.3);
  }

  .sr-only:not(:focus):not(:active) {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  .hero-text {
    font-family: "Jost", sans-serif;
    font-weight: 800;
    font-size: clamp(1.5rem, -0.653rem + 8.13vw, 9.25rem);
    line-height: 1;
    white-space: nowrap;
    width: max-content;
    margin-inline: auto;
    padding-inline: 0 !important;
    text-align: center;
    color: var(--brand-blue-light);
  }

  .hero-email {
    font-family: "Jost", sans-serif;
    font-weight: 200;
    font-size: clamp(1.5rem, -0.653rem + 4.13vw, 5.25rem);
    line-height: 1;
    white-space: nowrap;
    width: max-content;
    margin-inline: auto;
    padding-inline: 0 !important;
    text-align: center;
    color: var(--brand-blue-light);
  }


  .subhero-text {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 200;
    font-size: clamp(1.125rem, 0.75rem + 1.875vw, 3rem);
    line-height: 1;
    white-space: nowrap;
    width: max-content;
    margin-inline: auto;
    padding-inline: 0 !important;
    text-align: center;
  }
}
