/* ============================================================
   JHASWIKA'S GROWTH JOURNAL — STYLESHEET
   Palette: ivory / blush / plum / rose / sage / gold
   Display: Fraunces · Body: Work Sans · Utility: IBM Plex Mono
   ============================================================ */

:root {
  --ivory: #FBF6F0;
  --blush: #F3E1D8;
  --plum:  #362724;
  --plum-soft: #6B5450;
  --rose:  #C98F7F;
  --rose-deep: #B06E5E;
  --sage:  #7C8B6A;
  --sage-deep: #5F6E4F;
  --gold:  #B3872F;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --shadow-soft: 0 12px 32px rgba(54, 39, 36, 0.10);
  --shadow-lift: 0 20px 48px rgba(54, 39, 36, 0.16);

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Work Sans", -apple-system, sans-serif;
  --font-utility: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--plum);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.eyebrow {
  font-family: var(--font-utility);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-deep);
}

/* ---------------- Background texture ---------------- */
.grain-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% 20%, rgba(179,135,47,0.05), transparent 40%),
                     radial-gradient(circle at 85% 75%, rgba(124,139,106,0.06), transparent 45%);
}

/* ================= LOGIN PAGE ================= */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 48px 36px;
  text-align: center;
  border: 1px solid rgba(179,135,47,0.12);
}

.login-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 24px;
  font-style: italic;
}

.login-card h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  margin: 0 0 6px;
  color: var(--plum);
}

.login-card p.sub {
  color: var(--plum-soft);
  font-size: 14px;
  margin: 0 0 28px;
}

.login-card input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--blush);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--ivory);
}

.login-card input[type="password"]:focus {
  border-color: var(--rose);
}

.login-card button,
.btn-primary {
  margin-top: 16px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--plum);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s;
}

.login-card button:hover,
.btn-primary:hover {
  background: var(--rose-deep);
  transform: translateY(-1px);
}

.error-msg {
  background: #fbeae6;
  color: var(--rose-deep);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}

/* ================= SITE HEADER ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 246, 240, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(179,135,47,0.12);
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--plum);
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--plum);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--plum);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { background: var(--plum); color: #fff; }

.btn-solid {
  padding: 9px 20px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  cursor: pointer;
  transition: transform 0.15s;
}
.btn-solid:hover { transform: translateY(-1px); }

/* ================= TIMELINE (HOME) ================= */
.hero {
  max-width: 720px;
  margin: 56px auto 8px;
  padding: 0 28px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 500;
  font-style: italic;
  margin: 10px 0 12px;
  color: var(--plum);
}

.hero p {
  color: var(--plum-soft);
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto;
}

.vine-wrap {
  position: relative;
  max-width: 720px;
  margin: 40px auto 100px;
  padding: 0 28px 40px;
  z-index: 1;
}

.vine-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 40px;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, var(--sage), rgba(124,139,106,0.15));
  border-radius: 3px;
}

.month-node {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 64px;
}

.month-node:nth-child(even) .node-card { margin-left: auto; margin-right: calc(50% + 44px); text-align: right; }
.month-node:nth-child(odd) .node-card { margin-right: auto; margin-left: calc(50% + 44px); text-align: left; }

.node-bud {
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--sage);
  background: var(--ivory);
  z-index: 2;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.node-bud.bloomed {
  border-color: var(--gold);
}

.node-bud img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.node-card {
  width: calc(50% - 44px);
  background: #fff;
  border-radius: var(--radius-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(179,135,47,0.10);
  transition: transform 0.2s, box-shadow 0.2s;
}

.node-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.node-card .m-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--plum);
}

.node-card .m-range {
  font-family: var(--font-utility);
  font-size: 11px;
  color: var(--sage-deep);
  letter-spacing: 0.06em;
  margin: 4px 0 10px;
}

.node-card .m-count {
  font-size: 13px;
  color: var(--plum-soft);
}

.node-card .m-empty {
  font-size: 13px;
  color: var(--plum-soft);
  font-style: italic;
}

@media (max-width: 640px) {
  .vine-line { left: 20px; }
  .node-bud { left: 20px; }
  .month-node:nth-child(even) .node-card,
  .month-node:nth-child(odd) .node-card {
    margin-left: 52px;
    margin-right: 0;
    width: calc(100% - 52px);
    text-align: left;
  }
}

/* ================= MONTH GALLERY ================= */
.gallery-header {
  max-width: 1000px;
  margin: 44px auto 20px;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

.back-link {
  font-family: var(--font-utility);
  font-size: 12px;
  color: var(--sage-deep);
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}

.gallery-header h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 36px;
  margin: 0 0 4px;
  color: var(--plum);
}

.gallery-grid {
  max-width: 1000px;
  margin: 0 auto 80px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  position: relative;
  z-index: 1;
}

.photo-tile {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  background: var(--blush);
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.photo-tile:hover img { transform: scale(1.06); }

.photo-tile .milestone-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, var(--gold), #d9ad5c);
  color: #fff;
  font-family: var(--font-utility);
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(179,135,47,0.35);
}

.empty-state {
  max-width: 1000px;
  margin: 0 auto 80px;
  padding: 60px 28px;
  text-align: center;
  color: var(--plum-soft);
}

.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

/* ================= LIGHTBOX ================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(54, 39, 36, 0.92);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open { display: flex; }

.lightbox-inner {
  max-width: 900px;
  width: 100%;
  text-align: center;
}

.lightbox-inner img {
  max-height: 75vh;
  margin: 0 auto;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.lightbox-caption {
  color: var(--ivory);
  margin-top: 18px;
  font-family: var(--font-body);
  font-size: 15px;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  color: var(--ivory);
  font-size: 28px;
  cursor: pointer;
  background: none;
  border: none;
}

.lightbox-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.btn-on-dark {
  border-color: rgba(251, 246, 240, 0.5);
  color: var(--ivory);
}
.btn-on-dark:hover { background: var(--ivory); color: var(--plum); }

.btn-danger.btn-on-dark:hover {
  background: #d96a5a;
  border-color: #d96a5a;
  color: #fff;
}

.lightbox-edit {
  display: none;
  max-width: 380px;
  margin: 20px auto 0;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: left;
  box-shadow: var(--shadow-lift);
}

.lightbox-edit.open { display: block; }

.lightbox-edit .field { margin-bottom: 16px; }
.lightbox-edit .field:last-of-type { margin-bottom: 18px; }

.lightbox-edit .btn-solid {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

/* ================= UPLOAD PAGE ================= */
.upload-wrap {
  max-width: 620px;
  margin: 44px auto 100px;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

.upload-wrap h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 32px;
  margin-bottom: 8px;
}

.upload-wrap p.sub {
  color: var(--plum-soft);
  font-size: 14px;
  margin-bottom: 32px;
}

.form-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 32px;
  border: 1px solid rgba(179,135,47,0.10);
}

.field { margin-bottom: 22px; }

.field label {
  display: block;
  font-family: var(--font-utility);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 8px;
}

.field select,
.field input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--blush);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--ivory);
  outline: none;
}

.field select:focus,
.field input[type="text"]:focus { border-color: var(--rose); }

.dropzone {
  border: 2px dashed var(--blush);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--ivory);
}

.dropzone.dragover {
  border-color: var(--rose);
  background: #fdf1ee;
}

.dropzone .dz-icon { font-size: 30px; margin-bottom: 8px; }
.dropzone p { margin: 0; font-size: 14px; color: var(--plum-soft); }
.dropzone p.small { font-size: 12px; margin-top: 4px; }

#file-input { display: none; }

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

.preview-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-soft);
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }

.success-msg {
  background: #eef3ea;
  color: var(--sage-deep);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 20px;
}
