:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --card: #f5f2ed;
  --tint: #f3f0ea;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #1a1a1a;
  --accent-hover: #555555;
  --pop: #c45d3e;
  --pop-hover: #a84e34;
  --pop-light: rgba(196, 93, 62, 0.08);
  --border: #e0e0e0;
  --max-width: 1120px;
}

html:not(.fonts-ready) body {
  opacity: 0;
}

html.fonts-ready body {
  transition: opacity 0.1s ease;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

img {
  display: block;
  max-width: 100%;
}

/* ---------- Container ---------- */

.container {
  width: min(var(--max-width), calc(100% - 3rem));
  margin: 0 auto;
}

/* ---------- Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: block;
  height: 36px;
  width: auto;
}

.brand-wordmark {
  display: block;
  height: 22px;
  width: auto;
}

.menu {
  display: flex;
  gap: 1.5rem;
}

.menu a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.menu a:hover {
  color: var(--text);
}

/* ---------- Hero ---------- */

.hero {
  padding: 8rem 0 5rem;
}

h1 {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  max-width: 20ch;
  letter-spacing: -0.015em;
}

.lead {
  color: var(--muted);
  max-width: 52ch;
  margin: 1.2rem 0 0;
  font-size: 1.1rem;
  line-height: 1.65;
}

.hero-cta {
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--pop);
  color: #fff;
  border: 1px solid var(--pop);
  border-radius: 4px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: var(--pop-hover);
  border-color: var(--pop-hover);
  color: #fff;
  text-decoration: none;
}

/* ---------- Sections ---------- */

.section {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}

.section-tinted {
  background: var(--tint);
}

.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pop);
  margin: 0 0 2.5rem;
}

.section h2 {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.section p {
  max-width: 60ch;
  line-height: 1.7;
}

/* ---------- Journal list ---------- */

.journal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.journal-item {
  border-bottom: 1px solid var(--border);
}

.journal-item:first-child {
  border-top: 1px solid var(--border);
}

.journal-link {
  display: block;
  padding: 1.6rem 0;
  transition: background 0.12s ease;
}

.journal-link:hover {
  background: var(--pop-light);
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 4px;
}

.journal-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.journal-date {
  white-space: nowrap;
}

.journal-author::before {
  content: "·";
  margin-right: 0.6rem;
}

.journal-title {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.journal-excerpt {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
  max-width: 65ch;
  line-height: 1.55;
}

.view-all {
  display: inline-block;
  margin-top: 2rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--pop);
}

.view-all:hover {
  color: var(--pop-hover);
}

.view-all::after {
  content: " \2192";
}

/* ---------- Products teaser ---------- */

.products-teaser {
  max-width: 50ch;
}

.products-teaser p {
  color: var(--muted);
}

.product-hint {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--pop);
  background: var(--pop-light);
  border: 1px solid rgba(196, 93, 62, 0.18);
  border-radius: 3px;
  padding: 0.2rem 0.55rem;
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}

/* ---------- About ---------- */

.about-text {
  max-width: 55ch;
  font-size: 1.05rem;
  line-height: 1.75;
}

/* ---------- Contact ---------- */

.contact-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.contact-links a {
  font-weight: 500;
  color: var(--pop);
}

.contact-links a:hover {
  color: var(--pop-hover);
}

.contact-actions {
  margin-bottom: 1.2rem;
}

/* ---------- Modal ---------- */

.modal {
  border: none;
  border-radius: 8px;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  max-width: min(480px, calc(100vw - 3rem));
  width: 480px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-inner {
  padding: 2rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 0.2rem;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text);
}

/* ---------- Contact form ---------- */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--pop);
}

.contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

.contact-form .btn {
  align-self: flex-start;
  cursor: pointer;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.4rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Journal page (listing + post) ---------- */

.page-title {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
}

.page-subtitle {
  color: var(--muted);
  max-width: 50ch;
  margin: 0 0 3rem;
  font-size: 1.05rem;
}

.page-hero {
  padding: 5rem 0 2rem;
}

/* ---------- Individual post ---------- */

.post-header {
  padding: 5rem 0 2rem;
}

.post-meta {
  display: flex;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.post-title {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  max-width: 22ch;
  letter-spacing: -0.015em;
}

.post-body {
  max-width: calc(680px + 3rem);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.post-body p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 0 0 1.4rem;
}

.post-body h2 {
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.5rem 0 0.8rem;
}

.post-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.6rem;
}

.post-body ul,
.post-body ol {
  padding-left: 1.4rem;
  margin: 0 0 1.4rem;
}

.post-body li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.post-body blockquote {
  border-left: 3px solid var(--border);
  margin: 1.5rem 0;
  padding: 0.5rem 1.2rem;
  color: var(--muted);
  font-style: italic;
}

.post-nav {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  max-width: calc(680px + 3rem);
  margin: 0 auto;
}

.post-nav a {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--pop);
}

.post-nav a:hover {
  color: var(--pop-hover);
}

.post-nav a::before {
  content: "\2190 ";
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .hero {
    padding: 5rem 0 3rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .page-hero {
    padding: 3.5rem 0 1.5rem;
  }

  .post-header {
    padding: 3.5rem 0 1.5rem;
  }
}

@media (max-width: 560px) {
  html {
    font-size: 16px;
  }

  .container {
    width: min(var(--max-width), calc(100% - 1.5rem));
  }

  .menu {
    gap: 0.8rem;
  }

  .menu a {
    font-size: 0.82rem;
  }

  .brand-wordmark.logo-dark,
  .brand-wordmark.logo-light {
    display: none;
  }

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

  .journal-link:hover {
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .post-body {
    padding: 0 0.75rem 3rem;
  }

  .post-nav {
    padding: 2rem 0.75rem;
  }

  .contact-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ---------- Logo theme swap ---------- */

.logo-light {
  display: none;
}

/* ---------- Dark mode ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --surface: #1c1c1c;
    --card: #1e1e1a;
    --tint: #1a1a17;
    --text: #e8e8e4;
    --muted: #999996;
    --accent: #e8e8e4;
    --accent-hover: #cccccc;
    --pop: #d4785e;
    --pop-hover: #e08c72;
    --pop-light: rgba(212, 120, 94, 0.1);
    --border: #2a2a28;
  }

  .logo-dark {
    display: none;
  }

  .logo-light {
    display: block;
  }

  .product-hint {
    border-color: rgba(212, 120, 94, 0.22);
  }

  .post-body blockquote {
    border-left-color: var(--pop);
  }
}
