/* Sean's Journey — warm editorial blog.
   Display: Fraunces · Reading: Newsreader · Accent: sunrise amber. */

:root {
  --paper:   #fcfbf7;
  --paper-2: #f6f2ea;
  --ink:     #211c15;
  --soft:    #4a4438;
  --muted:   #837a6b;
  --faint:   #b6ad9c;
  --line:    #e9e2d4;
  --accent:  #c2762f;
  --accent-d:#a6601f;
  --glow:    #ffe6c2;
  --maxw:    40rem;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  line-height: 1.72;
  font-weight: 380;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--glow); color: var(--ink); }

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

/* --- dawn glow ----------------------------------------------------------- */
.dawn {
  position: fixed;
  top: 0; left: 50%;
  width: 120vw; height: 56vh;
  transform: translateX(-50%);
  background:
    radial-gradient(60% 80% at 50% -8%, var(--glow) 0%, rgba(255,230,194,0.35) 32%, rgba(252,251,247,0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* --- masthead ------------------------------------------------------------ */
.masthead {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 5.5rem 1.5rem 2.2rem;
  animation: rise 0.9s cubic-bezier(.2,.7,.2,1) both;
}
.masthead--post { padding: 2.4rem 1.5rem 1rem; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: "Fraunces", serif;
}
.wordmark-text {
  font-size: 2.9rem;
  font-weight: 500;
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1;
}
.wordmark--small .wordmark-text {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--soft);
  transition: color .25s ease;
}
.wordmark--small:hover .wordmark-text { color: var(--accent-d); }

.sun {
  width: 0.85rem; height: 0.85rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd28a, var(--accent) 70%);
  box-shadow: 0 0 0 0 rgba(194,118,47,.45);
  animation: pulse 4.5s ease-in-out infinite;
  flex: none;
}
.wordmark--small .sun { width: 0.6rem; height: 0.6rem; }
.sun--lg {
  width: 2.2rem; height: 2.2rem; display: block; margin: 0 auto 1.4rem;
}

.tagline {
  margin-top: 0.9rem;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* --- page shell ---------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  flex: 1 0 auto;
}

/* --- feed / index -------------------------------------------------------- */
.feed { padding-top: 1.5rem; }
.empty { color: var(--muted); font-style: italic; text-align: center; padding: 3rem 0; }

.entry {
  border-top: 1px solid var(--line);
  animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both;
  animation-delay: calc(0.07s * var(--i) + 0.1s);
}
.entry:first-child { border-top: none; }

.entry-link {
  display: block;
  padding: 2.1rem 0;
  transition: transform .28s cubic-bezier(.2,.7,.2,1);
}
.entry-link:hover { transform: translateX(6px); }

.entry-meta {
  font-family: "Fraunces", serif;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.55rem;
}
.entry-meta .dot { color: var(--line); }

.entry-title {
  font-family: "Fraunces", serif;
  font-size: 1.95rem;
  font-weight: 480;
  letter-spacing: -0.012em;
  line-height: 1.16;
  color: var(--ink);
  transition: color .25s ease;
}
.entry-link:hover .entry-title { color: var(--accent-d); }

.entry-excerpt {
  margin-top: 0.55rem;
  color: var(--soft);
  font-size: 1.12rem;
  max-width: 34rem;
}

.entry-more {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-top: 0.9rem;
  font-family: "Fraunces", serif;
  font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  opacity: 0; transform: translateY(4px);
  transition: opacity .25s ease, transform .25s ease;
}
.entry-link:hover .entry-more { opacity: 1; transform: translateY(0); }
.entry-more .arrow { transition: transform .25s ease; }
.entry-link:hover .arrow { transform: translateX(3px); }

/* --- reading progress ---------------------------------------------------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: transparent; z-index: 5;
}
.progress #bar {
  display: block; height: 100%; width: 100%;
  transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), #e6a85a);
}

/* --- post ---------------------------------------------------------------- */
.post { animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.post-head { text-align: center; padding: 1.5rem 0 2.4rem; }
.entry-meta--post { justify-content: center; margin-bottom: 1rem; }
.post-title {
  font-family: "Fraunces", serif;
  font-size: clamp(2.1rem, 5.5vw, 3.1rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.018em;
  color: var(--ink);
  max-width: 22ch; margin: 0 auto;
}

.prose { font-size: 1.2rem; }
.prose > p { margin: 0 0 1.5rem; }
.prose > p:first-of-type::first-letter {
  font-family: "Fraunces", serif;
  float: left;
  font-size: 3.6rem;
  line-height: 0.82;
  font-weight: 500;
  padding: 0.18rem 0.6rem 0 0;
  color: var(--accent-d);
}
.prose h2, .prose h3 {
  font-family: "Fraunces", serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 2.6rem 0 0.9rem;
  color: var(--ink);
}
.prose h2 { font-size: 1.7rem; }
.prose h3 { font-size: 1.35rem; }
.prose a {
  color: var(--accent-d);
  text-decoration: underline;
  text-decoration-color: var(--glow);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: text-decoration-color .2s ease;
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-style: italic; }
.prose blockquote {
  margin: 1.8rem 0;
  padding: 0.3rem 0 0.3rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--soft);
}
.prose ul, .prose ol { margin: 0 0 1.5rem 1.4rem; }
.prose li { margin: 0.35rem 0; }
.prose hr {
  border: none; height: 1px; background: var(--line);
  margin: 2.6rem auto; width: 40%;
}
.prose img { max-width: 100%; height: auto; border-radius: 6px; margin: 1.6rem 0; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  background: var(--paper-2);
  padding: 0.12em 0.4em; border-radius: 4px;
}
.prose pre {
  background: var(--paper-2); padding: 1.1rem 1.3rem;
  border-radius: 8px; overflow-x: auto; margin: 1.6rem 0;
  border: 1px solid var(--line);
}
.prose pre code { background: none; padding: 0; font-size: 0.9rem; }

.post-foot {
  margin-top: 3.5rem; padding-top: 1.8rem;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.sign { font-family: "Fraunces", serif; font-style: italic; color: var(--muted); }
.back {
  font-family: "Fraunces", serif; font-size: 0.85rem; font-weight: 500;
  color: var(--accent); letter-spacing: 0.02em;
  transition: color .2s ease;
}
.back:hover { color: var(--accent-d); }

/* --- gate ---------------------------------------------------------------- */
.gate { text-align: center; padding: 5rem 1rem; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.gate-title { font-family: "Fraunces", serif; font-weight: 500; font-size: 2.2rem; letter-spacing: -0.01em; }
.gate-sub { color: var(--muted); margin-top: 0.5rem; font-style: italic; }
.gate-error { color: var(--accent-d); margin-top: 1rem; font-size: 0.95rem; }
.gate-form { margin-top: 2rem; display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

input, textarea, button { font-family: inherit; font-size: 1rem; }
.gate-form input {
  padding: 0.7rem 1rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); width: 16rem; outline: none;
  transition: border-color .2s ease;
}
.gate-form input:focus { border-color: var(--accent); }

button[type="submit"] {
  padding: 0.7rem 1.5rem; border: none; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: #fff; font-family: "Fraunces", serif;
  font-weight: 500; letter-spacing: 0.02em;
  transition: background .2s ease, transform .15s ease;
}
button[type="submit"]:hover { background: var(--accent-d); }
button[type="submit"]:active { transform: translateY(1px); }

/* --- compose ------------------------------------------------------------- */
.compose { display: flex; flex-direction: column; gap: 1rem; padding-top: 1.5rem; animation: rise 0.7s cubic-bezier(.2,.7,.2,1) both; }
.c-title {
  font-family: "Fraunces", serif; font-size: 2rem; font-weight: 500;
  border: none; border-bottom: 1px solid var(--line); background: transparent;
  padding: 0.4rem 0; outline: none; color: var(--ink); letter-spacing: -0.01em;
}
.c-title::placeholder { color: var(--faint); }
.c-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.c-date, .c-excerpt {
  border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.8rem;
  background: #fff; outline: none; color: var(--soft);
}
.c-date { width: 11rem; }
.c-excerpt { flex: 1; min-width: 14rem; }
.c-date:focus, .c-excerpt:focus, .c-body:focus { border-color: var(--accent); }
.c-body {
  min-height: 50vh; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem 1.2rem;
  background: #fff; outline: none; color: var(--ink);
  font-size: 1.1rem; line-height: 1.7;
}
.c-actions { display: flex; align-items: center; justify-content: space-between; }
.c-hint { color: var(--faint); font-size: 0.85rem; font-style: italic; }

/* --- admin / edit affordances (only shown when logged in) ---------------- */
.admin-bar { display: flex; justify-content: flex-end; padding: 0 0 0.5rem; }
.admin-link, .edit {
  font-family: "Fraunces", serif; font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.03em; color: var(--accent);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.32rem 0.9rem; transition: border-color .2s ease, color .2s ease;
}
.admin-link:hover, .edit:hover { color: var(--accent-d); border-color: var(--accent); }
.foot-links { display: inline-flex; align-items: center; gap: 1rem; }
.danger { margin-top: 2.5rem; text-align: center; }
.delete-btn {
  background: none; border: none; cursor: pointer;
  font-family: "Newsreader", serif; font-size: 0.85rem; font-style: italic;
  color: var(--faint); text-decoration: underline; text-underline-offset: 3px;
  transition: color .2s ease;
}
.delete-btn:hover { color: #b4452e; }

/* --- footer -------------------------------------------------------------- */
.site-foot {
  position: relative; z-index: 1;
  flex-shrink: 0;
  text-align: center; padding: 2.5rem 1rem 3rem;
  color: var(--faint);
  font-family: "Fraunces", serif; font-size: 0.78rem;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.site-foot .rule { display: block; width: 2rem; height: 1px; background: var(--accent); margin: 0 auto 1.4rem; opacity: 0.6; }

/* --- motion -------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(194,118,47,.35); }
  50%      { box-shadow: 0 0 0 7px rgba(194,118,47,0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* --- responsive ---------------------------------------------------------- */
@media (max-width: 640px) {
  body { font-size: 1.1rem; }
  .masthead { padding-top: 3.8rem; }
  .wordmark-text { font-size: 2.3rem; }
  .entry-title { font-size: 1.7rem; }
  .prose { font-size: 1.12rem; }
  .prose > p:first-of-type::first-letter { font-size: 3rem; }
}
