/*
  Components, page layouts and responsive rules.
  Loaded after base.css. See base.css for tokens and base styles.
*/

/* Reading column for long form writing */
.reading {
  max-width: 44rem;
}

.reading p {
  margin: 0 0 1.4rem;
}

.reading .salutation,
.reading .signoff {
  color: var(--ink);
  font-weight: 600;
}

.byline {
  color: var(--muted-soft);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lift);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--muted-soft);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.card-head .icon {
  width: 22px;
  height: 22px;
  color: var(--ink);
}

.card-head h2,
.card-head h3 {
  margin: 0;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--ink);
}

.link-arrow .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.link-arrow:hover {
  text-decoration: none;
}

.link-arrow:hover .icon {
  transform: translateX(3px);
}

.tags {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags li {
  font-size: 0.82rem;
  color: var(--muted-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Pages */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 3rem;
  align-items: center;
  padding: 5rem 0 3rem;
}

.hero p.lead {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--muted);
  max-width: 34rem;
  margin: 1.25rem 0 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.avatar {
  width: min(280px, 70%);
  aspect-ratio: 1;
  border-radius: 50%;
  margin-left: auto;
  box-shadow: var(--shadow-lift);
}

.prose h2 {
  margin-top: 2.5rem;
}

.entry {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line-soft);
}

.entry:first-of-type {
  border-top: none;
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  align-items: baseline;
}

.entry-head h3 {
  margin: 0;
}

.entry-meta {
  color: var(--muted-soft);
  font-size: 0.95rem;
  white-space: nowrap;
}

.entry ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.entry ul li {
  margin-bottom: 0.4rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Responsive */
@media (max-width: 820px) {
  body {
    font-size: 17px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 0 1rem;
  }

  .avatar {
    grid-row: 1;
    width: 180px;
    margin: 0 0 1rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .nav {
    position: fixed;
    inset: 76px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1.5rem;
    display: none;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0;
    width: 100%;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-toggle {
    display: inline-flex;
  }
}

@media print {
  .site-header,
  .site-footer,
  .hero-actions,
  .nav-toggle {
    display: none;
  }
}
