:root{
  --paper:#f7f3e9;
  --ink:#2c2a28;
  --ink-muted:#554f48;
  --accent:#8b6f47;
  --paper-edge:#e6dec9;
}

html{ box-sizing:border-box; }
*, *:before, *:after{ box-sizing:inherit; }

body {
  margin: 0;
  padding: 16px;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(1000px 600px at 10% -20%, rgba(0,0,0,0.03), transparent 50%),
    radial-gradient(800px 500px at 110% 120%, rgba(0,0,0,0.03), transparent 50%);
  font-family: 'EB Garamond', Garamond, Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  font-size: 18px; /* mobile-first readable */
}

.page{
  max-width: 740px;
  margin: 0 auto;
  padding: 18px 16px;
  background: #fbf8f1;
  border: 1px solid var(--paper-edge);
  border-radius: 6px;
  box-shadow:
    0 1px 0 rgba(0,0,0,0.03),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

h1, h2, h3{
  margin: 0.6em 0 0.4em;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.3px;
}
h1{ font-size: 1.6rem; }
h2{ font-size: 1.3rem; }

/* Brand */
.brand{ display:flex; align-items:center; gap:12px; margin: 4px 0 14px; color: var(--ink); }
.brand .logo{ width:36px; height:auto; color: var(--accent); }
.brand .wordmark{ font-size:1.4rem; font-weight:700; letter-spacing:0.4px; }
.brand .tag{ font-size:0.9rem; color: var(--ink-muted); margin-top:2px; }

.nav{
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--paper-edge);
  color: var(--ink-muted);
}

a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }

form { margin: 10px 0 16px; }
input, textarea, button {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
}
input, textarea{
  background: #faf6ee;
  color: var(--ink);
  border: 1px solid var(--paper-edge);
  padding: 10px 12px;
  margin: 6px 0 10px;
  border-radius: 4px;
  outline: none;
}
input:focus, textarea:focus{
  border-color: #d2c4a7;
  box-shadow: 0 0 0 2px rgba(210,196,167,0.25);
}
button{
  display: inline-block;
  width: auto;
  background: #e3d6ba;
  color: var(--ink);
  border: 1px solid #ccb890;
  padding: 10px 14px;
  border-radius: 4px;
  cursor: pointer;
}
button:hover{ filter: brightness(0.98); }

.photo{
  border: 1px solid var(--paper-edge);
  padding: 14px;
  margin: 16px 0;
  border-radius: 6px;
  background: #fffdf7;
}
.photo > div{ color: var(--ink-muted); font-size: 0.95rem; margin-bottom: 8px; }
.photo-actions{ display:flex; justify-content:flex-end; margin-top:8px; }
.photo-actions .delete{
  background:#f0d6cf;
  border-color:#d7b1a7;
  color:#5a2a22;
}

/* Make every image use the full available width, mobile-first */
img{ width: 100%; height: auto; display: block; border-radius: 6px; }
.photo img{ cursor: zoom-in; }

/* Subtle typography touches */
p{ margin: 10px 0; }
.loader, .end-note{ text-align:center; color: var(--ink-muted); margin: 12px 0; font-size: 0.95rem; }
.loader::before{
  content: '';
  display: inline-block;
  width: 16px; height:16px;
  margin-right:8px;
  border: 2px solid #ccb890;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Image modal overlay */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10000;
}
.modal.open{ display: flex; }
.modal-img{
  max-width: 96vw;
  max-height: 96vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.modal-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  user-select: none;
}
.modal-nav:hover{ background: rgba(255,255,255,0.18); }
.modal-nav:focus{ outline: 2px solid rgba(255,255,255,0.6); outline-offset: 2px; }
.modal-nav.prev{ left: 12px; }
.modal-nav.next{ right: 12px; }
.modal-close{
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
}
