/* ============================================
   Nuno Barreto — Personal Author Website
   Design system: Outfit + Lato, warm naturals
   ============================================ */

/* --- Reset & Base --- */

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

:root {
  --bg: #f5f5f0;
  --text: #1a1a1a;
  --text-light: #4a4a4a;
  --sand: #E8DCC8;
  --terracotta: #C4745A;
  --sage: #A8B99C;
  --sand-dark: #d4c8b0;
  --terracotta-dark: #a85e46;
  --sage-dark: #8fa388;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Lato', sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 2rem;
}

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

a:hover {
  color: var(--terracotta-dark);
}


/* --- Hero --- */

.hero {
  padding: 3.5rem 0 3rem;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-symbol {
  flex-shrink: 0;
  opacity: 0.85;
  line-height: 0;
}

.hero-symbol img {
  display: block;
  width: 160px;
  height: auto;
}

.hero-text {
  flex: 1 1 320px;
  min-width: 0;
}

.hero-name {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.hero-tagline {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 420px;
  line-height: 1.6;
}


/* --- About --- */

.about {
  padding: 4rem 0;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
}

.about-content {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.about-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.about-text {
  max-width: 640px;
}

.about-text p {
  margin-bottom: 1.2rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}


/* --- Books --- */

.books {
  padding: 4rem 0;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
}

.books-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.book-card {
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.book-card-inner {
  padding: 2.5rem 2rem;
}

.book-title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.book-subtitle {
  font-family: var(--font-body);
  font-weight: 300;
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
  opacity: 0.85;
  line-height: 1.5;
}

.book-description {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
}

/* Book card colour variants */

.book-card--sand {
  background-color: var(--sand);
  color: var(--text);
}

.book-card--terracotta {
  background-color: var(--terracotta);
  color: #fff;
}

.book-card--terracotta .book-subtitle {
  opacity: 0.9;
}

.book-card--terracotta .book-description {
  opacity: 0.92;
}

.book-card--sage {
  background-color: var(--sage);
  color: var(--text);
}

.books-more {
  margin-top: 2rem;
  font-size: 0.95rem;
  color: var(--text-light);
  font-style: italic;
}

.book-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.25);
  margin-bottom: 0.8rem;
}

.book-card--sand .book-badge {
  background: rgba(26, 26, 26, 0.08);
}

.book-card--sage .book-badge {
  background: rgba(26, 26, 26, 0.08);
}

.book-card--upcoming {
  opacity: 0.75;
}

.book-link {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--text);
  border: 1px solid rgba(26, 26, 26, 0.2);
  border-radius: 6px;
  padding: 0.5rem 1.2rem;
  margin-top: 1.2rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}

.book-link:hover {
  background-color: rgba(26, 26, 26, 0.06);
  border-color: rgba(26, 26, 26, 0.35);
  color: var(--text);
}


/* --- Connect --- */

.connect {
  padding: 4rem 0;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
}

.connect-text {
  margin-bottom: 2rem;
  max-width: 480px;
}

.connect-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.contact-form {
  max-width: 480px;
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
  transition: opacity 0.25s ease, max-height 0.3s ease;
  overflow: hidden;
}

.contact-form--hidden {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  pointer-events: none;
}

/* Honeypot: hide from sighted users and assistive tech, but keep available to bots */
.form-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
  border: 1px solid rgba(26, 26, 26, 0.15);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--terracotta);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  color: #fff;
  background-color: var(--terracotta);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.form-submit:hover {
  background-color: var(--terracotta-dark);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.4em;
}

.form-status--success {
  color: #4a7a4a;
}

.form-status--error {
  color: var(--terracotta);
}

.connect-social {
  margin-top: 0;
}

.connect-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  color: var(--text);
  padding: 0.6rem 1.2rem;
  border: 1px solid rgba(26, 26, 26, 0.15);
  border-radius: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.connect-link:hover {
  border-color: var(--terracotta);
  background-color: rgba(196, 116, 90, 0.06);
  color: var(--terracotta);
}

.connect-icon {
  flex-shrink: 0;
}


/* --- Footer --- */

.footer {
  padding: 3rem 0;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
}

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

.footer-symbol {
  opacity: 0.4;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.footer-nav a {
  font-size: 0.85rem;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.footer-nav a:hover {
  color: var(--terracotta);
}


/* --- Legal pages (privacy, etc.) --- */

.legal {
  padding: 4rem 0;
}

.legal .container {
  max-width: 640px;
}

.legal-title {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.legal-lead {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 2rem;
}

.legal h2 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

.legal p {
  margin-bottom: 1rem;
  color: var(--text);
}

.legal-meta {
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
}


/* --- Responsive: Tablet and up --- */

@media (max-width: 639px) {
  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }

  .hero-symbol img {
    width: 120px;
  }

  .hero-tagline {
    margin: 0 auto;
  }

  .about-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-photo {
    width: 120px;
    height: 120px;
    margin-bottom: 0.5rem;
  }
}

@media (min-width: 640px) {
  .hero {
    padding: 4rem 0 3.5rem;
  }

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

  .book-card-inner {
    padding: 2rem 1.5rem;
    min-height: 280px;
    display: flex;
    flex-direction: column;
  }

  .book-description {
    margin-top: auto;
  }

  .book-title {
    font-size: 1.35rem;
  }
}

@media (min-width: 960px) {
  .hero {
    padding: 5rem 0 4rem;
  }

  .books-grid {
    gap: 1.5rem;
  }

  .book-card-inner {
    padding: 2.5rem 2rem;
    min-height: 320px;
  }

  .book-title {
    font-size: 1.5rem;
  }
}


/* --- Accessibility: Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .book-card {
    transition: none;
  }

  .connect-link {
    transition: none;
  }
}


/* --- Print --- */

@media print {
  body {
    background: #fff;
    font-size: 12pt;
  }

  .hero-symbol,
  .footer-symbol {
    display: none;
  }

  .book-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  .book-card--terracotta {
    color: #1a1a1a;
  }
}
