/* A Cons Apart - Cons Cell Inspired Design */

/* New Computer Modern Font */
@import url('https://cdn.jsdelivr.net/gh/aaaakshat/cm-web-fonts@latest/fonts.css');

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

:root {
  --color-bg: #fafafa;
  --color-text: #1a1a1a;
  --color-text-muted: #555;
  --color-accent: #0aa99b;
  --color-accent-alt: #ff3b30;
  --color-border: #1a1a1a;
  --color-cell-bg: #fff;
  --font-serif: 'Computer Modern Serif', serif;
  --font-mono: 'JetBrains Mono', 'Computer Modern Typewriter', monospace;
  --border-width: 2px;
  --cell-gap: 0;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

p {
  margin-bottom: 1rem;
  max-width: 65ch;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

a:hover {
  border-bottom-color: var(--color-accent);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
header {
  border-bottom: var(--border-width) solid var(--color-border);
  padding: 1.5rem 0;
}

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

.logo {
  height: 56px;
  width: auto;
}

nav {
  display: flex;
  gap: 2rem;
}

nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text);
  text-transform: lowercase;
  border-bottom: none;
  padding: 0.25rem 0;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: var(--border-width);
  background: var(--color-accent);
  transition: width 0.2s;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

/* Cons Cell Component */
.cons-cell {
  display: inline-flex;
  border: var(--border-width) solid var(--color-border);
  background: var(--color-cell-bg);
}

.cons-cell .car,
.cons-cell .cdr {
  padding: 1.5rem 2rem;
}

.cons-cell .car {
  border-right: var(--border-width) solid var(--color-border);
  min-width: 120px;
}

.cons-cell .cdr {
  min-width: 120px;
}

.cons-cell .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.5rem;
}

/* Cons List (Linked Cells) */
.cons-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cons-list .cons-cell {
  margin-left: 0;
}

.cons-list .cons-cell:not(:last-child) {
  border-bottom: none;
}

/* Product Cards as Cons Cells */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.product-card {
  border: var(--border-width) solid var(--color-border);
  background: var(--color-cell-bg);
  display: flex;
  flex-direction: column;
}

.product-card .card-header {
  padding: 1.5rem;
  border-bottom: var(--border-width) solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.product-card .card-dot {
  width: 12px;
  height: 12px;
  background: var(--color-accent);
}

.product-card .card-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  margin: 0;
}

.product-card .card-body {
  padding: 1.5rem;
  flex: 1;
}

.product-card .card-body p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.product-card .card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #eee;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.product-card .card-footer a {
  color: var(--color-text);
}

/* Hero Section */
.hero {
  padding: 6rem 0;
  border-bottom: var(--border-width) solid var(--color-border);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 50ch;
}

.hero .cons-notation {
  font-family: var(--font-mono);
  font-size: 1rem;
  margin-top: 2rem;
  color: var(--color-text-muted);
}

.hero .cons-notation .paren {
  color: var(--color-accent-alt);
}

.hero .cons-notation .keyword {
  color: var(--color-accent);
}

/* Sections */
section {
  padding: 4rem 0;
}

section.bordered {
  border-bottom: var(--border-width) solid var(--color-border);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-header::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--color-border);
}

/* About Page */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.about-content .etymology {
  font-family: var(--font-mono);
  background: var(--color-cell-bg);
  border: var(--border-width) solid var(--color-border);
  padding: 2rem;
}

.about-content .etymology pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.8;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: var(--border-width) solid var(--color-border);
  max-width: 500px;
}

.contact-grid .cell {
  padding: 1.5rem;
  background: var(--color-cell-bg);
}

.contact-grid .cell:nth-child(1) {
  border-right: var(--border-width) solid var(--color-border);
  border-bottom: var(--border-width) solid var(--color-border);
}

.contact-grid .cell:nth-child(2) {
  border-bottom: var(--border-width) solid var(--color-border);
}

.contact-grid .cell:nth-child(3) {
  border-right: var(--border-width) solid var(--color-border);
}

.contact-grid .cell-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

/* Footer */
footer {
  border-top: var(--border-width) solid var(--color-border);
  padding: 2rem 0;
  margin-top: auto;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

footer .footer-cons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

footer .footer-cons span {
  color: var(--color-accent-alt);
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.5rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .about-content {
    gap: 2rem;
  }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .container {
    padding: 0 1.25rem;
  }

  /* Header */
  header {
    padding: 1rem 0;
  }

  header .container {
    flex-direction: column;
    gap: 1.25rem;
  }

  .logo {
    height: 44px;
  }

  nav {
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  nav a {
    font-size: 0.8rem;
  }

  /* Hero */
  .hero {
    padding: 3rem 0;
  }

  .hero h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero .tagline {
    font-size: 1.1rem;
  }

  .hero .cons-notation {
    font-size: 0.85rem;
    word-break: break-word;
  }

  /* Sections */
  section {
    padding: 3rem 0;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  /* Product Grid */
  .product-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
  }

  .product-card .card-header {
    padding: 1rem;
  }

  .product-card .card-body {
    padding: 1rem;
  }

  .product-card .card-footer {
    padding: 0.75rem 1rem;
  }

  /* About */
  .about-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about-content .etymology {
    padding: 1.25rem;
  }

  .about-content .etymology pre {
    font-size: 0.75rem;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .contact-grid .cell {
    border-right: none !important;
    border-bottom: var(--border-width) solid var(--color-border);
  }

  .contact-grid .cell:last-child {
    border-bottom: none;
  }

  /* Cons Cell */
  .cons-cell {
    flex-direction: column;
  }

  .cons-cell .car {
    border-right: none;
    border-bottom: var(--border-width) solid var(--color-border);
  }

  .cons-cell .car,
  .cons-cell .cdr {
    padding: 1rem 1.25rem;
    min-width: auto;
  }

  /* Footer */
  footer {
    padding: 1.5rem 0;
  }

  footer .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 1rem;
  }

  .hero {
    padding: 2.5rem 0;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero .tagline {
    font-size: 1rem;
  }

  .hero .cons-notation {
    font-size: 0.75rem;
  }

  nav {
    gap: 0.75rem;
  }

  nav a {
    font-size: 0.7rem;
  }

  section {
    padding: 2rem 0;
  }

  .section-header h2 {
    font-size: 1.3rem;
  }

  .product-card .card-title {
    font-size: 0.9rem;
  }

  .product-card .card-body p {
    font-size: 0.85rem;
  }

  footer .container {
    font-size: 0.7rem;
  }
}

/* Utility Classes */
.text-muted { color: var(--color-text-muted); }
.text-mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* Smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
