/* ==========================================================================
   MECHLY - Design System & Styles
   Total: ~350 lines
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --bg-primary: #0A0A0A;
  --bg-elevated: #1A1A1A;
  --text-primary: #E8E8E8;
  --text-secondary: #888888;
  --accent-primary: #C4A052;
  --accent-hover: #D4B062;
  --border-default: #333333;
  --border-focus: #555555;

  /* Typography Scale */
  --font-family: 'JetBrains Mono', monospace;
  --fs-xs: 0.75rem;    /* 12px */
  --fs-sm: 0.875rem;   /* 14px */
  --fs-base: 1rem;     /* 16px */
  --fs-md: 1.125rem;   /* 18px */
  --fs-lg: 1.5rem;     /* 24px */
  --fs-xl: 1.875rem;   /* 30px */
  --fs-2xl: 3rem;      /* 48px */

  /* Font Weights */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;

  /* Line Heights */
  --lh-tight: 1.2;
  --lh-normal: 1.5;

  /* Spacing (4px base) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-24: 6rem;    /* 96px */

  /* Layout */
  --max-width: 1120px;
  --border-radius: 2px;

  /* Transitions */
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 250ms var(--ease-out);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

h1, h2, h3, h4 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
}

h1 {
  font-size: var(--fs-2xl);
}

h2 {
  font-size: var(--fs-xl);
}

h3 {
  font-size: var(--fs-lg);
}

p {
  color: var(--text-secondary);
}

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

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

.section {
  padding: var(--space-24) 0;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-default);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.05em;
}

.header__clock {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-family);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

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

.btn--secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border-default);
}

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

/* --------------------------------------------------------------------------
   Form Elements
   -------------------------------------------------------------------------- */
.form {
  display: flex;
  gap: var(--space-3);
  max-width: 440px;
}

.form__input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-family);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius);
  transition: border-color var(--transition-fast);
}

.form__input::placeholder {
  color: var(--text-secondary);
}

.form__input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.form__submit {
  flex-shrink: 0;
}

.form__success {
  display: none;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  color: var(--accent-primary);
  background-color: var(--bg-elevated);
  border: 1px solid var(--accent-primary);
  border-radius: var(--border-radius);
}

.form.is-submitted .form__fields {
  display: none;
}

.form.is-submitted .form__success {
  display: block;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  padding-top: calc(64px + var(--space-24));
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero__content {
  max-width: 640px;
}

.hero__title {
  margin-bottom: var(--space-6);
}

.hero__description {
  font-size: var(--fs-md);
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  max-width: 400px;
}

.hero__actions .btn--primary {
  grid-column: 1;
  text-align: center;
}

.hero__actions .form {
  grid-column: 1 / -1;
  display: contents;
}

.hero__actions .form__fields {
  display: contents;
}

.hero__actions .form__input {
  grid-column: 1;
}

.hero__actions .form__submit {
  grid-column: 2;
}

/* --------------------------------------------------------------------------
   Problem Section
   -------------------------------------------------------------------------- */
.problem {
  border-top: 1px solid var(--border-default);
}

.problem__content {
  max-width: 640px;
}

.problem__title {
  margin-bottom: var(--space-6);
}

.problem__text {
  font-size: var(--fs-base);
}

/* --------------------------------------------------------------------------
   How It Works Section
   -------------------------------------------------------------------------- */
.how-it-works {
  border-top: 1px solid var(--border-default);
}

.how-it-works__title {
  margin-bottom: var(--space-12);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.feature {
  padding: var(--space-6);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius);
}

.feature__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  margin-bottom: var(--space-3);
}

.feature__description {
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   CTA Section
   -------------------------------------------------------------------------- */
.cta {
  border-top: 1px solid var(--border-default);
}

.cta__content {
  max-width: 640px;
}

.cta__title {
  margin-bottom: var(--space-6);
}

.cta__text {
  margin-bottom: var(--space-8);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border-default);
  padding: var(--space-12) 0;
}

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

.footer__logo {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.05em;
}

.footer__copyright {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --fs-2xl: 2rem;
    --fs-xl: 1.5rem;
  }

  .section {
    padding: var(--space-16) 0;
  }

  .hero {
    padding-top: calc(64px + var(--space-16));
    min-height: auto;
    padding-bottom: var(--space-16);
  }

  .hero__actions {
    max-width: 100%;
  }

  .hero__actions .form__fields {
    flex-direction: column;
  }

  .hero__actions .form__submit {
    width: 100%;
  }

  .footer__inner {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
