/* Devin Faoláin — site styles
   Palette: warm ivory ground, forest green anchor, charcoal text, candlelight accent. */

:root {
  --ivory: #f5efe2;
  --parchment: #ebe2cf;
  --forest: #1d3529;
  --forest-deep: #13241b;
  --ink: #0b1512;
  --charcoal: #2b2b28;
  --muted: #5d5a52;
  --brass: #7a5c22;          /* accent text on ivory (AA contrast) */
  --candle: #c8a15a;         /* accent on dark, and decoration */
  --candle-bright: #e6c98c;
  --rule: rgba(43, 43, 40, 0.16);
  --rule-dark: rgba(245, 239, 226, 0.18);

  --display: "Cormorant Garamond", "EB Garamond", Garamond, "Times New Roman", serif;
  --body: "EB Garamond", Garamond, "Iowan Old Style", "Times New Roman", serif;

  --measure: 34rem;
  --wrap: 68rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --slow: 900ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--body);
  font-size: 1.1875rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 7vw, 4.25rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 5vw, 2.9rem); }
h3 { font-size: 1.6rem; }

p { margin: 0 0 1.1em; }

a { color: inherit; text-decoration-color: var(--candle); text-underline-offset: 0.2em; text-decoration-thickness: 1px; transition: color 300ms ease, text-decoration-color 300ms ease; }
a:hover { color: var(--brass); }

:focus-visible { outline: 2px solid var(--candle); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--forest); color: var(--ivory); padding: 0.6rem 1rem; z-index: 10;
}
.skip:focus { left: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }
.prose-center { max-width: var(--measure); margin-left: auto; margin-right: auto; }

.eyebrow {
  font-family: var(--body);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1.2rem;
}

.lede { font-size: 1.3rem; line-height: 1.55; }
.quiet { color: var(--muted); }
.italic { font-style: italic; }

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

.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.4rem 2rem;
  padding: 1.25rem max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))) 1rem;
  background: rgba(245, 239, 226, 0.94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background 600ms ease, color 600ms ease, box-shadow 600ms ease, padding 600ms ease;
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--rule); padding-top: 0.85rem; padding-bottom: 0.7rem; }

/* Home: the header floats over the opening image, then settles into ivory as you scroll */
.home .site-header { position: fixed; left: 0; right: 0; background: transparent; color: var(--ivory); -webkit-backdrop-filter: none; backdrop-filter: none; }
.home .site-header .site-nav a:hover, .home .site-header .site-nav a[aria-current="page"] { color: var(--candle-bright); }
.home .site-header.is-scrolled { background: rgba(245, 239, 226, 0.96); color: var(--charcoal); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.home .site-header.is-scrolled .site-nav a:hover { color: var(--charcoal); }
.wordmark {
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.6rem; }
.site-nav a {
  font-size: 0.92rem; letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; padding: 0.35rem 0; border-bottom: 1px solid transparent;
  transition: border-color 400ms ease, color 300ms ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--candle); color: var(--charcoal); }
@media (max-width: 30rem) {
  .wordmark { font-size: 1.4rem; }
  .site-nav { gap: 0.25rem 1.1rem; }
  .site-nav a { font-size: 0.82rem; letter-spacing: 0.14em; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--body);
  font-size: 0.95rem; letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; text-align: center;
  padding: 0.95rem 1.7rem;
  border: 1px solid var(--forest);
  background: var(--forest); color: var(--ivory);
  cursor: pointer;
  transition: background 500ms ease, color 500ms ease, border-color 500ms ease, box-shadow 500ms ease;
}
.btn:hover { background: var(--forest-deep); color: var(--candle-bright); box-shadow: 0 0 0 1px var(--candle); }
.btn-ghost { background: transparent; color: var(--forest); }
.btn-ghost:hover { background: var(--forest); color: var(--ivory); }
.btn-candle { background: var(--candle); border-color: var(--candle); color: var(--forest-deep); }
.btn-candle:hover { background: var(--candle-bright); border-color: var(--candle-bright); color: var(--forest-deep); box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.8rem; }

/* ---------- Ornament (the lit window) ---------- */

.ornament { width: 22px; height: 34px; margin: 0 auto 1.6rem; color: var(--candle); }
.ornament-left { margin-left: 0; }

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

.section { padding: clamp(3.5rem, 9vw, 7rem) 0; }
.section-tight { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-rule { border-top: 1px solid var(--rule); }

.dark {
  background: var(--forest);
  color: var(--ivory);
  background-image: radial-gradient(ellipse at 80% 0%, rgba(200, 161, 90, 0.10), transparent 55%),
                    linear-gradient(180deg, var(--forest) 0%, var(--forest-deep) 100%);
}
.dark .eyebrow { color: var(--candle); }
.dark .quiet { color: rgba(245, 239, 226, 0.78); }
.dark a:hover { color: var(--candle-bright); }

.parchment { background: var(--parchment); }

.cover {
  box-shadow: 0 1px 2px rgba(19, 36, 27, 0.3), 0 18px 40px -12px rgba(19, 36, 27, 0.55), 0 40px 80px -30px rgba(19, 36, 27, 0.45);
  border-radius: 2px;
}

/* ---------- Home: full-screen opening ---------- */

.hero-title { font-family: var(--display); font-size: clamp(1.45rem, 3.4vw, 1.9rem); margin: 0 0 1rem; line-height: 1.2; }

.hero-full {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: clamp(620px, 94svh, 800px);
  display: flex; align-items: flex-end;
  padding: 7.5rem 0 4.5rem;
  background: var(--ink);
  color: var(--ivory);
}
/* Phones: the art fills the top of the screen and fades into the dark below */
.hero-media { position: absolute; top: 0; left: 0; right: 0; height: min(78vh, 640px); z-index: -2; will-change: transform;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 47% 45%; }
.hero-full::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11, 21, 18, 0.7) 0%, rgba(11, 21, 18, 0.1) 18%, rgba(11, 21, 18, 0.2) 35%, rgba(11, 21, 18, 0.85) 52%, var(--ink) 66%);
}
.hero-full-inner { width: 100%; display: grid; gap: 2.5rem; }
/* On phones the headline and Buy button come first, over the art; the cover follows */
.hero-full-cover { order: 2; justify-self: center; width: min(44vw, 170px); }
@media (max-width: 51.99rem) { .hero-full { padding-top: min(48vh, 400px); } }
.hero-full-cover .cover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 50px -10px rgba(0, 0, 0, 0.75); }
.hero-full h1 { font-style: italic; font-weight: 400; color: var(--ivory); }
.hero-full .eyebrow { color: var(--candle); }
.hero-full .lede { color: rgba(245, 239, 226, 0.88); max-width: 30rem; }

@media (min-width: 52rem) {
  .hero-full { align-items: center; padding: 8rem 0 5rem; }
  /* The art sits to the right and fades into the dark on the left */
  .hero-media { top: -8%; bottom: -8%; height: auto; left: 34%; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%); mask-image: linear-gradient(90deg, transparent 0%, #000 30%); }
  .hero-media img { object-position: 84% 60%; }
  .hero-full::before {
    background:
      linear-gradient(180deg, rgba(11, 21, 18, 0.7) 0%, transparent 20%, transparent 78%, rgba(11, 21, 18, 0.7) 100%),
      linear-gradient(90deg, var(--ink) 30%, rgba(11, 21, 18, 0.55) 48%, rgba(11, 21, 18, 0) 62%);
  }
  .hero-full-inner { grid-template-columns: minmax(0, 27rem) 1fr; align-items: center; }
  .hero-full-copy { grid-row: 1; grid-column: 1; }
  .hero-full-cover { grid-row: 1; grid-column: 2; justify-self: end; width: clamp(190px, 16vw, 240px); }
}

.btn-ghost-light { background: transparent; color: var(--ivory); border-color: rgba(245, 239, 226, 0.6); }
.btn-ghost-light:hover { background: rgba(245, 239, 226, 0.1); color: var(--candle-bright); border-color: var(--candle); box-shadow: none; }

.scroll-cue { position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%); width: 32px; height: 44px; display: flex; justify-content: center; }
.scroll-cue span { display: block; width: 1px; height: 100%; background: linear-gradient(180deg, transparent, var(--candle)); animation: cue 2.8s ease-in-out 1.5s 4 both; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 40% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-width: 51.99rem) { .scroll-cue { display: none; } }

/* Thin announcement band under the opening */
.notice-band { background: var(--ivory); border-bottom: 1px solid var(--rule); text-align: center; padding: 1.25rem 0; }
.notice-band p { margin: 0; font-family: var(--display); font-size: clamp(1.2rem, 3vw, 1.5rem); }
.notice-band .eyebrow { display: inline-block; margin: 0 0.8rem 0 0; font-family: var(--body); font-size: 0.8rem; vertical-align: 0.15em; }
.notice-band a { text-decoration: none; border-bottom: 1px solid var(--candle); }

/* Welcome note */
.welcome-grid { display: grid; gap: 3rem; align-items: center; }
.welcome-copy { max-width: 34rem; }
.welcome-copy h2 { font-style: italic; font-weight: 400; }
.signature { font-family: "Pinyon Script", var(--display); font-size: 3rem; line-height: 1; color: var(--brass); margin: 1.4rem 0 1.6rem; transform: rotate(-4deg); transform-origin: left; }
.welcome-portrait { margin: 0; justify-self: center; width: min(60vw, 240px); }
@media (min-width: 52rem) {
  .welcome-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 5rem; }
  .welcome-portrait { width: min(100%, 280px); justify-self: end; }
}

/* Full-bleed feature band (The Drowning Room) */
.feature-band { position: relative; isolation: isolate; overflow: hidden; color: var(--ivory); background: var(--ink); padding: clamp(4rem, 10vw, 8rem) 0; }
.feature-band-media { position: absolute; inset: -12% 0; z-index: -2; will-change: transform; }
.feature-band-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.feature-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(6, 14, 24, 0.82), rgba(6, 14, 24, 0.66) 50%, rgba(6, 14, 24, 0.88)); }
.feature-band .eyebrow { color: var(--candle); }
.feature-band .lede { color: rgba(245, 239, 226, 0.9); }
.feature-band .cover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 50px -10px rgba(0, 0, 0, 0.8); }

/* Journal */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--rule); margin-bottom: 2.2rem; }
.section-head h2 { margin-bottom: 0.4em; }
.section-head a { font-size: 0.9rem; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; }
.journal-grid { display: grid; gap: 2.5rem; }
@media (min-width: 52rem) { .journal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4rem; } }
.journal-card h3 { font-size: 1.75rem; margin-bottom: 0.4em; }
.journal-card h3 a { text-decoration: none; }
.journal-card p { margin-bottom: 0.8rem; }

/* Quote strip over the castle photograph */
.quote-strip { position: relative; isolation: isolate; overflow: hidden; color: var(--ivory); text-align: center; padding: clamp(6rem, 16vw, 11rem) 0; background: var(--forest-deep); }
.quote-strip-media {
  position: absolute; top: -18%; bottom: -18%; left: 0; right: 0; z-index: -2; will-change: transform;
  background: url("/assets/img/quote-castle.jpg") center 40% / cover no-repeat;
}
.quote-strip::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(19, 36, 27, 0.78), rgba(19, 36, 27, 0.62) 50%, rgba(19, 36, 27, 0.82)); }
.quote-strip figure { margin: 0 auto; }
.quote-strip blockquote { margin: 0 auto 1.2rem; max-width: 40rem; font-family: var(--display); font-style: italic; font-size: clamp(2rem, 5.5vw, 3.4rem); line-height: 1.15; text-wrap: balance; }
.quote-strip figcaption { font-size: 0.85rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--candle); }

/* Instagram */
.instagram-band { text-align: center; }
.ig-glyph { width: 28px; height: 28px; margin: 0 auto 1rem; color: var(--brass); }
.instagram-band .eyebrow { margin-bottom: 0.4rem; }
.ig-handle { font-family: var(--display); font-size: clamp(1.8rem, 5vw, 2.4rem); margin-bottom: 0.4rem; }
.ig-handle a { text-decoration: none; }

/* ---------- Two-column feature (coming soon, author, book entries) ---------- */

.feature { display: grid; gap: 2.5rem; align-items: center; }
.feature-media { justify-self: center; width: min(60vw, 230px); }
@media (min-width: 52rem) {
  .feature { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 4.5rem; }
  .feature-media { width: min(100%, 300px); }
  .feature.flip .feature-media { order: 2; }
  .feature.top { align-items: start; }
}

/* Placeholder cover for unrevealed titles */
.cover-placeholder {
  aspect-ratio: 2 / 3;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  padding: 14% 10% 10%;
  text-align: center;
  color: var(--ivory);
  background:
    radial-gradient(ellipse at 50% 108%, rgba(200, 161, 90, 0.28), transparent 55%),
    repeating-linear-gradient(180deg, transparent 0 13px, rgba(245, 239, 226, 0.045) 13px 14px),
    linear-gradient(180deg, #0f1c1a 0%, #17302c 55%, #0c1716 100%);
  border: 1px solid rgba(200, 161, 90, 0.35);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
  border-radius: 2px;
}
.cover-placeholder .cp-title { font-family: var(--display); font-size: clamp(1.5rem, 5vw, 2.1rem); line-height: 1.05; letter-spacing: 0.08em; text-transform: uppercase; }
.cover-placeholder .cp-title small { display: block; font-size: 0.5em; letter-spacing: 0.3em; margin-bottom: 0.5em; }
.cover-placeholder .cp-note { font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--candle); }
.cover-placeholder .cp-author { font-size: 0.8rem; letter-spacing: 0.26em; text-transform: uppercase; }

/* Arched image (window shape) */
.arch { border-radius: 999px 999px 2px 2px; overflow: hidden; background: var(--forest-deep); }
.arch img { width: 100%; filter: grayscale(1) contrast(1.05) brightness(0.82); mix-blend-mode: luminosity; opacity: 0.92; }
.arch-small { width: 150px; }
.arch-medium { width: min(60vw, 260px); }

/* ---------- Book page ---------- */

.book { scroll-margin-top: 2rem; }
.book-meta { font-size: 0.95rem; letter-spacing: 0.06em; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 1.1rem; margin-top: 2rem; }
.dark .book-meta { color: rgba(245, 239, 226, 0.75); border-top-color: var(--rule-dark); }
.status { display: inline-block; font-size: 0.82rem; letter-spacing: 0.2em; text-transform: uppercase; border: 1px solid currentColor; padding: 0.25rem 0.7rem; margin-bottom: 1.2rem; color: var(--brass); }
.dark .status { color: var(--candle); }
.blurb p:first-child { font-family: var(--display); font-style: italic; font-size: 1.7rem; line-height: 1.25; }

/* ---------- Page heads ---------- */

.page-head { padding-top: clamp(2rem, 6vw, 4.5rem); padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.page-head h1 { margin-bottom: 0.2em; }

/* ---------- Newsletter ---------- */

.newsletter { text-align: center; }
.newsletter .prose-center { max-width: 36rem; }
.nl-form { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; margin-top: 1.8rem; }
.nl-form input[type="email"] { flex: 1 1 15rem; max-width: 22rem; }
.nl-note { font-size: 0.95rem; margin-top: 1rem; min-height: 1.5em; }

input[type="email"], input[type="text"], textarea {
  font: inherit; color: var(--charcoal);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(43, 43, 40, 0.45);
  border-radius: 0;
  padding: 0.8rem 1rem;
  width: 100%;
  transition: border-color 400ms ease, background 400ms ease;
}
input:focus, textarea:focus { background: #fff; border-color: var(--forest); }
.site-footer input[type="email"] { background: rgba(245, 239, 226, 0.08); border-color: rgba(245, 239, 226, 0.45); color: var(--ivory); }
.site-footer input[type="email"]:focus { background: rgba(245, 239, 226, 0.14); border-color: var(--candle); }
.site-footer input[type="email"]::placeholder { color: rgba(245, 239, 226, 0.65); }
label { display: block; font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 0.4rem; color: var(--muted); }
.field { margin-bottom: 1.3rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

.site-footer { background: var(--forest-deep); color: var(--ivory); padding: clamp(3rem, 7vw, 5rem) 0 2.5rem; }
.site-footer .eyebrow { color: var(--candle); }
.site-footer a:hover { color: var(--candle-bright); }
.footer-grid { display: grid; gap: 3rem; }
@media (min-width: 52rem) { .footer-grid { grid-template-columns: 1.2fr 0.8fr; gap: 5rem; } .footer-grid.single { grid-template-columns: 1fr; } }
.site-footer .nl-form { justify-content: flex-start; margin-top: 1.2rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.footer-links a { text-decoration: none; border-bottom: 1px solid var(--rule-dark); padding-bottom: 1px; }
.colophon { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule-dark); font-size: 0.9rem; color: rgba(245, 239, 226, 0.7); display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; justify-content: space-between; }

/* ---------- Links page (Instagram bio link) ---------- */

.links-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; }
.links-card { width: 100%; max-width: 26rem; margin: 0 auto; padding: 3rem var(--gutter); text-align: center; }
.links-card .cover { width: 150px; margin: 0 auto 1.8rem; }
.links-card h1 { font-size: 2rem; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 0.3em; }
.link-list { list-style: none; padding: 0; margin: 2.2rem 0 0; display: grid; gap: 0.9rem; }
.link-list .btn { display: block; width: 100%; border-color: rgba(245, 239, 226, 0.5); background: transparent; color: var(--ivory); }
.link-list .btn:hover { border-color: var(--candle); color: var(--candle-bright); background: rgba(0, 0, 0, 0.18); box-shadow: none; }
.link-list .btn-candle { background: var(--candle); border-color: var(--candle); color: var(--forest-deep); }
.link-list .btn-candle:hover { background: var(--candle-bright); color: var(--forest-deep); }

/* ---------- News ---------- */

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 2rem 0; border-top: 1px solid var(--rule); }
.post-list li:last-child { border-bottom: 1px solid var(--rule); }
.post-list h2 { font-size: 1.9rem; margin-bottom: 0.25em; }
.post-list h2 a { text-decoration: none; }
.post-date { font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); margin-bottom: 0.6rem; }
.post-body h2 { font-size: 1.9rem; margin-top: 1.6em; }
.post-body h3 { margin-top: 1.4em; }
.post-body blockquote { margin: 1.6em 0; padding-left: 1.2rem; border-left: 2px solid var(--candle); font-style: italic; }
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem auto; width: 40%; }
.post-body img { margin: 2rem 0; }

/* ---------- Slow reveal ---------- */

.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--slow), transform var(--slow); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: 180ms; }
.js .reveal.d2 { transition-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue span { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}
