/* ===========================
   lorenlarsen.com
   Clean minimal with personality
   =========================== */

:root {
  --text: #1a1a1a;
  --text-secondary: #555;
  --bg: #fdfdfd;
  --accent: #2a5a8a;
  --accent-hover: #1d4268;
  --border: #e0e0e0;
  --max-width: 660px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  padding: 0 1.5rem;
}

/* Layout */
.site {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header / Nav */
header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.site-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.site-name a {
  color: var(--text);
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--text);
}

/* Main content */
main {
  flex: 1;
}

/* Typography */
h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-bottom: 1.2rem;
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2.2rem;
  margin-bottom: 0.8rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.1rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

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

/* Intro / Hero */
.intro {
  margin-bottom: 2rem;
}

.intro p:first-child {
  font-size: 1.1rem;
}

/* Project cards (about page) */
.project {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--border);
}

.project:first-of-type {
  border-top: 1px solid var(--border);
}

.project h3 {
  margin-top: 0;
  margin-bottom: 0.3rem;
}

.project .role {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.project p {
  margin-bottom: 0;
}

/* Writing list */
.writing-list {
  list-style: none;
}

.writing-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.writing-list li:first-child {
  border-top: 1px solid var(--border);
}

.writing-list a {
  font-weight: 500;
  text-decoration: none;
}

.writing-list a:hover {
  text-decoration: underline;
}

.writing-list .date {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* Book section */
.book-hero {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.book-hero h1 {
  margin-bottom: 0.5rem;
}

.book-status {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(42, 90, 138, 0.08);
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* Email signup */
.signup {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 1.8rem 2rem;
  margin: 2rem 0;
}

.signup h3 {
  margin-top: 0;
}

.signup-form {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.signup-form input[type="email"] {
  flex: 1;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.9rem;
  font-family: inherit;
}

.signup-form button {
  padding: 0.55rem 1.2rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.signup-form button:hover {
  background: var(--accent-hover);
}

/* Contact */
.contact-methods {
  margin-top: 1rem;
}

.contact-methods p {
  margin-bottom: 0.6rem;
}

/* Footer */
footer {
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Utility */
.muted {
  color: var(--text-secondary);
}

.small {
  font-size: 0.85rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Era / product entries for "Things We Built" */
.era {
  margin-bottom: 3.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.era:last-of-type {
  border-bottom: none;
}

.era-header {
  margin-bottom: 1.2rem;
}

.era-header h2 {
  margin-top: 0;
  margin-bottom: 0.2rem;
}

.era-header h2 a {
  text-decoration: none;
}

.era-header h2 a:hover {
  text-decoration: underline;
}

.era-header .era-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

/* Era hero images */
.era-image {
  margin: 0.8rem 0 1.2rem;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
  border: 1px solid var(--border);
}

.era-image img,
.era-image picture img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  object-position: center top;
}

.era-image picture {
  display: block;
}

/* Hide broken images gracefully */
.era-image img[src=""],
.era-image img:not([src]) {
  display: none;
}

.era-image:has(img[src=""]),
.era-image:has(img:not([src])) {
  display: none;
}

/* Fallback: hide the container if the image fails to load */
.era-image img {
  min-height: 0;
}

.era-intro {
  margin-bottom: 1rem;
}

.product-entry {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.product-entry:first-of-type {
  border-top: 1px solid var(--border);
}

.product-entry h3 {
  margin-top: 0;
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.product-entry .product-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.product-entry p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.collab-note {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 2rem;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--border);
}

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

  header {
    padding: 1.8rem 0 1.2rem;
  }

  nav {
    gap: 1.1rem;
  }

  h1 {
    font-size: 1.4rem;
  }

  .book-hero,
  .signup {
    padding: 1.4rem;
  }

  .signup-form {
    flex-direction: column;
  }
}
