/* =================================================================
   Hank Builds — Homepage & Prose Styles
   ================================================================= */

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

/* Custom Properties */
:root {
  --bg: #faf9f7;
  --card-bg: #ffffff;
  --card-border: #eae8e4;
  --text: #111827;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', monospace;
}

/* Base */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px 48px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #3b82f6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---- HOME PAGE ---- */

/* Hero */
.hero {
  text-align: center;
  padding: 56px 0 64px;
  animation: fadeIn 0.6s ease both;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.hero .brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 8px;
}

.hero p {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 12px;
  letter-spacing: 0.005em;
  line-height: 1.5;
}

.hero-accent {
  width: 64px;
  height: 4px;
  border-radius: 4px;
  margin: 28px auto 0;
  background: linear-gradient(90deg, #f97316, #3b82f6, #10b981, #8b5cf6, #f97316);
  background-size: 200% 100%;
  animation: shimmer 6s linear infinite;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  from { background-position: 0 0; }
  to { background-position: 200% 0; }
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1000px;
  width: 100%;
}

/* Cards */
.card {
  --accent: #6b7280;
  --accent-dark: #4b5563;
  --accent-shadow: rgba(0, 0, 0, 0.08);

  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px 24px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  opacity: 0;
  animation: cardIn 0.5s ease forwards;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px var(--accent-shadow);
  text-decoration: none;
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Card color modifiers */
.card--orange { --accent: #f97316; --accent-dark: #ea580c; --accent-shadow: rgba(249, 115, 22, 0.2); }
.card--purple { --accent: #8b5cf6; --accent-dark: #7c3aed; --accent-shadow: rgba(139, 92, 246, 0.2); }
.card--blue   { --accent: #3b82f6; --accent-dark: #2563eb; --accent-shadow: rgba(59, 130, 246, 0.2); }
.card--green  { --accent: #10b981; --accent-dark: #059669; --accent-shadow: rgba(16, 185, 129, 0.2); }
.card--indigo { --accent: #6366f1; --accent-dark: #4f46e5; --accent-shadow: rgba(99, 102, 241, 0.2); }
.card--rose   { --accent: #f43f5e; --accent-dark: #e11d48; --accent-shadow: rgba(244, 63, 94, 0.2); }
.card--teal   { --accent: #14b8a6; --accent-dark: #0d9488; --accent-shadow: rgba(20, 184, 166, 0.2); }
.card--cyan   { --accent: #06b6d4; --accent-dark: #0891b2; --accent-shadow: rgba(6, 182, 212, 0.2); }
.card--amber  { --accent: #f59e0b; --accent-dark: #d97706; --accent-shadow: rgba(245, 158, 11, 0.2); }
.card--lime   { --accent: #84cc16; --accent-dark: #65a30d; --accent-shadow: rgba(132, 204, 22, 0.2); }
.card--violet { --accent: #7c3aed; --accent-dark: #6d28d9; --accent-shadow: rgba(124, 58, 237, 0.2); }
.card--pink   { --accent: #ec4899; --accent-dark: #db2777; --accent-shadow: rgba(236, 72, 153, 0.2); }
.card--red     { --accent: #ef4444; --accent-dark: #dc2626; --accent-shadow: rgba(239, 68, 68, 0.2); }
.card--fuchsia { --accent: #d946ef; --accent-dark: #c026d3; --accent-shadow: rgba(217, 70, 239, 0.2); }

/* Category headings in grid */
.category-heading {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-top: 12px;
  padding-bottom: 0;
}

.category-heading:first-child {
  margin-top: 0;
}

/* Card entrance animation — staggered */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.card:nth-of-type(1)  { animation-delay: 0.05s; }
.card:nth-of-type(2)  { animation-delay: 0.1s; }
.card:nth-of-type(3)  { animation-delay: 0.15s; }
.card:nth-of-type(4)  { animation-delay: 0.2s; }
.card:nth-of-type(5)  { animation-delay: 0.25s; }
.card:nth-of-type(6)  { animation-delay: 0.3s; }
.card:nth-of-type(7)  { animation-delay: 0.35s; }
.card:nth-of-type(8)  { animation-delay: 0.4s; }
.card:nth-of-type(9)  { animation-delay: 0.45s; }
.card:nth-of-type(10) { animation-delay: 0.5s; }
.card:nth-of-type(11) { animation-delay: 0.55s; }
.card:nth-of-type(12) { animation-delay: 0.6s; }
.card:nth-of-type(13) { animation-delay: 0.65s; }

/* Card icon badge */
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: transform 0.3s ease;
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.card:hover .card-icon {
  transform: scale(1.08) rotate(-3deg);
}

/* Card text */
.card h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.card .url {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: auto;
  padding-top: 16px;
  opacity: 0.7;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card .url::after {
  content: '\2192';
  display: inline-block;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
  font-size: 0.85em;
}

.card:hover .url {
  opacity: 1;
}

.card:hover .url::after {
  opacity: 1;
  transform: translateX(0);
}

/* About section */
.about {
  max-width: 640px;
  text-align: center;
  margin: 56px auto 0;
}

.about h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.about p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  font-family: var(--font-body);
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 10px 18px;
  background: var(--text);
  color: #fff;
  border-radius: 10px;
  z-index: 100;
  font-size: 0.875rem;
  text-decoration: none;
}

/* Footer */
footer {
  margin-top: auto;
  padding-top: 64px;
  font-size: 0.85rem;
  color: var(--text-faint);
}

footer a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--text-muted);
  text-decoration: none;
}

footer .sep {
  margin: 0 8px;
}

/* ---- PROSE PAGES (About, Privacy) ---- */

.back {
  align-self: flex-start;
  max-width: 640px;
  width: 100%;
  margin: 56px auto 32px;
  font-size: 0.875rem;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s;
}

.back:hover {
  color: var(--text-muted);
  text-decoration: none;
}

main {
  max-width: 640px;
  width: 100%;
}

main h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 8px;
}

main h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 40px;
  margin-bottom: 12px;
  line-height: 1.3;
}

main p {
  font-size: 1rem;
  color: #444;
  line-height: 1.7;
  margin-bottom: 16px;
}

main a {
  color: #3b82f6;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 48px;
}

ul {
  list-style: none;
  margin-bottom: 16px;
}

ul li {
  font-size: 1rem;
  color: #444;
  line-height: 1.7;
  padding-left: 20px;
  position: relative;
}

ul li::before {
  content: "\00b7";
  position: absolute;
  left: 4px;
  color: var(--text-faint);
  font-weight: 700;
}

/* ---- RESPONSIVE ---- */

@media (max-width: 820px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 640px;
  }
}

@media (max-width: 520px) {
  .grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .card {
    padding: 20px 16px;
  }

  .hero {
    padding: 32px 0 40px;
  }

  body {
    padding: 16px 16px 32px;
  }
}

/* ---- REDUCED MOTION ---- */

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
    opacity: 1;
  }

  .hero {
    animation: none;
  }

  .hero-accent {
    animation: none;
  }

  .card,
  .card-icon,
  .card .url,
  .card .url::after {
    transition: none;
  }
}
