:root {
  --bg: #faf7f0;
  --paper: #fcfaf6;
  --ink: #141210;
  --muted: #5f5a54;
  --accent: #d46b2c; /* physalis orange */
  --border: rgba(20, 18, 16, 0.12);

  --container: 1120px;
  --radius: 14px;

  --pad: 22px;
  --pad-sm: 16px;
  --gap: 16px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.6;
}

body {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px;
}

/* Paper cards/sections */
.paper {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.paper > *:first-child {
  margin-top: 0;
}

.paper > *:last-child {
  margin-bottom: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
}

/* Color buttons in hero for better visibility (keeps site palette) */
.hero-text-bg .actions .button {
  border-color: rgba(20, 18, 16, 0.5);
  background: rgba(212, 107, 44, 0.5);
}

.hero-text-bg .actions .button:hover {
  border-color: rgba(20, 18, 16, 0.8);
  background: rgba(212, 107, 44, 0.8);
}

.hero-text-bg .actions .button:focus-visible {
  outline: 2px solid rgba(212, 107, 44, 0.55);
  outline-offset: 2px;
}

.hero-text-bg .actions .button:nth-child(1) {
  background: rgba(212, 107, 44, 0.5);
}

.hero-text-bg .actions .button:nth-child(1):hover {
  background: rgba(212, 107, 44, 0.8);
}

.button:hover {
  text-decoration: none;
  border-color: rgba(20, 18, 16, 0.3);
}

.grid {
  display: grid;
  gap: var(--gap);
}

@media (min-width: 800px) {
  .grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  overflow: hidden;
}

.card {
  text-decoration: none;
}

.card:hover {
  text-decoration: none;
  border-color: rgba(20, 18, 16, 0.22);
  box-shadow: 0 10px 30px rgba(20, 18, 16, 0.06);
}

.card img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* Use for any grid preview image that must be cropped consistently */
.thumb {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.card img {
  width: 100%;
  height: auto;
  display: block;
}

/* Home page helpers */
.hero {
  padding: calc(var(--pad) + 6px);
  display: grid;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

/* Home hero: auto cross-fade featured image (no controls) */
.hero-fade {
  grid-template-columns: 1fr;
}

.hero-text {
  display: flex;
  flex-direction: column;  
  position: relative;
  z-index: 2;
  min-height: 350px;
}

.hero-text-bg {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: calc(var(--radius) - 4px);
  background:
    linear-gradient(
      90deg,
      rgba(252, 250, 246, 0.95) 0%,
      rgba(252, 250, 246, 0.6) 30%,
      rgba(252, 250, 246, 0.1) 60%,
      rgba(252, 250, 246, 0) 100%
    ),
    var(--hero-bg);
  background-size: 100%;
  background-position: 90% 19%;
  padding: 18px 18px 16px;
}

.hero-kicker {
  margin: 0;
  font-family: ui-serif, Georgia, "Cormorant Garamond", "Noto Serif", serif;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.hero-lead {
  margin: 6px 0 0;
}

@media (min-width: 800px) {
  .hero p {
      margin: 10px 0 0;
  }
}

/* Mobile hero typography */
@media (max-width: 799px) {
  .hero-kicker {    
    font-size: 25px;
    line-height: 1.1;
  }

}

.hero-text-bg .actions {
  margin-top: auto;
}

.hero-image {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 12%;
}

/* Smooth image appearance (avoid “pop in” on slower connections) */
.thumb,
.hero-image,
.cover img,
.post-body img,
.post-cover img,
.gallery img,
.about-photo img {
  opacity: 0;
  transition: opacity 1000ms ease;
}

.thumb.is-loaded,
.hero-image.is-loaded,
.cover img.is-loaded,
.post-body img.is-loaded,
.post-cover img.is-loaded,
.gallery img.is-loaded,
.about-photo img.is-loaded {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .thumb,
  .hero-image,
  .cover img,
  .post-body img,
  .post-cover img,
  .gallery img,
  .about-photo img {
    transition: none;
  }
}

.hero-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(252, 250, 246, 0.86);
  border: 1px solid rgba(20, 18, 16, 0.10);
  backdrop-filter: blur(6px);
}

.hero-caption-title {
  font-family: ui-serif, Georgia, "Cormorant Garamond", "Noto Serif", serif;
  letter-spacing: 0.01em;
}

@media (min-width: 900px) {
  .hero-fade {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }

  .hero-text-bg {
    padding: 22px 22px 18px;
  }
}

@media (min-width: 400px) and (max-width: 500px) {
  .hero-text-bg {
    background:
      linear-gradient(
        90deg,
        rgba(252, 250, 246, 0.95) 0%,
        rgba(252, 250, 246, 0.5) 40%,
        rgba(252, 250, 246, 0.1) 70%,
        rgba(252, 250, 246, 0) 100%
      ),
      var(--hero-bg);
    background-size: 100%;
    background-position: 90% 50%;      
  }  
}

@media (max-width: 399px) {
  .hero-text-bg {
    background:
      linear-gradient(
        90deg,
        rgba(252, 250, 246, 0.95) 0%,
        rgba(252, 250, 246, 0.6) 50%,
        rgba(252, 250, 246, 0.1) 70%,
        rgba(252, 250, 246, 0) 100%
      ),
      var(--hero-bg);
    background-size: 112%;
    background-position: 90% 70%;      
  }  
}


.hero h1 {
  margin: 0;
  font-family: ui-serif, Georgia, "Cormorant Garamond", "Noto Serif", serif;
  font-size: 42px;
  letter-spacing: 0.02em;
}

.hero p {
  max-width: 60ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.stamp {
  position: absolute;
  right: -18px;
  bottom: -14px;
  font-family: ui-serif, Georgia, "Cormorant Garamond", "Noto Serif", serif;
  letter-spacing: 0.2em;
  font-size: 48px;
  color: rgba(212, 107, 44, 0.14);
  transform: rotate(-8deg);
  user-select: none;
}

.section {
  padding: var(--pad);
}

.section h2 {
  margin: 0 0 6px;
  font-family: ui-serif, Georgia, "Cormorant Garamond", "Noto Serif", serif;
}

/* shared */
h1 {
  font-family: ui-serif, Georgia, "Cormorant Garamond", "Noto Serif", serif;
  letter-spacing: 0.01em;
}

.meta {
  padding: 12px var(--pad-sm);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.title {
  font-family: ui-serif, Georgia, "Cormorant Garamond", "Noto Serif", serif;
  letter-spacing: 0.01em;
}

.placeholder {
  background: rgba(20, 18, 16, 0.04);
}

/* Blog post body (rendered HTML) */
.post-body {
  line-height: 1.7;
}

.post-body p {
  margin: 0 0 16px;
}

.post-body h2,
.post-body h3 {
  margin: 26px 0 12px;
  font-family: ui-serif, Georgia, "Cormorant Garamond", "Noto Serif", serif;
}

.post-body figure {
  margin: 22px 0;
}

.post-body img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(20, 18, 16, 0.08);
  background: rgba(20, 18, 16, 0.02);
}

.post-body figure img {
  max-height: 520px;
  object-fit: contain;
}

@media (min-width: 800px) {
  .post-body figure img {
    max-height: 560px;
  }
}

.post-body figcaption,
.post-body .pt-caption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* (legacy .prose styles removed; blog now uses .post-body) */

.cover {
  overflow: hidden;
}

.cover img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 640px;
  object-fit: cover;
}

.box {
  padding: 22px;
}

form {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

input,
textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
}

ul {
  margin: 0;
  padding-left: 18px;
}

/* Toast (used for contact success message on home) */
.toast {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(560px, calc(100% - 32px));
  pointer-events: none;
}

.toast-inner {
  background: rgba(252, 250, 246, 0.92);
  border: 1px solid rgba(20, 18, 16, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(20, 18, 16, 0.08);
  display: grid;
  gap: 2px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.is-showing .toast-inner {
  opacity: 1;
  transform: translateY(0);
}

.toast-title {
  font-family: ui-serif, Georgia, "Cormorant Garamond", "Noto Serif", serif;
  letter-spacing: 0.01em;
}

.toast-text {
  color: var(--muted);
  font-size: 13px;
}
