/* ─── TOKENS ─── */
:root {
  --ivory:        #FDFAF5;
  --ivory-warm:   #F6EFE4;
  --ivory-deep:   #EDE3D5;
  --ink:          #1C1408;
  --ink-mid:      #7A6655;
  --ink-soft:     #A89480;
  --ink-veil:     #C8B8A8;

  --blush:        #B87A78;
  --blush-mid:    #D4A090;
  --blush-light:  #F0E0DA;
  --rose:         #8B5E5C;

  --border:       #E5D8CC;
  --border-soft:  #EDE6DC;

  --radius:       2px;
  --card-gap:     2px;
  --transition:   0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'EB Garamond', Georgia, serif;
  background-color: var(--ivory-warm);
  background-image:
    linear-gradient(to bottom, transparent 50%, var(--ivory-warm) 100%),
    radial-gradient(ellipse at center top, rgba(253,250,245,0.82) 0%, rgba(253,250,245,0.5) 50%, transparent 80%),
    url('images/Emily-Writer-Header.webp');
  background-position: center top;
  /* image is 2000×675 (≈3:1); 33.75vw = natural height at full viewport width */
  background-size: 100% 33.75vw, 100% 33.75vw, 100% auto;
  background-repeat: no-repeat;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { text-decoration: none; color: inherit; }
img { display: block; }

/* ─── GRAIN OVERLAY ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 1000;
}

/* ─── FLOATING CONTACT PILL ─── */
.contact-pill {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(253, 250, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: 0 2px 12px rgba(28, 20, 8, 0.08);
}
.contact-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--rose);
  transition: color var(--transition);
}
.contact-pill-icon:hover { color: var(--blush); }
.contact-pill-icon svg {
  width: 20px;
  height: 20px;
}
.contact-pill-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 8px;
}

/* ─── HERO ─── */
.hero {
  width: 100%;
}
.hero-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 40px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  opacity: 0;
  animation: rise 0.9s ease forwards;
  animation-delay: 0.2s;
}

/* Circular photo */
.hero-photo-wrap {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  padding: 4px;
  background: var(--blush-mid);
  box-shadow: 0 4px 20px rgba(184, 122, 120, 0.18);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 18px;
}
.hero-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
/* Identity text */
.hero-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 8px;
}
.hero-title {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 24px;
  margin-top: 24px;
  line-height: 1.6;
}
.hero-bio {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 16px;
}

/* ─── FOCUS RIBBON ─── */
.focus-ribbon {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  padding: 24px 40px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background-color: var(--ink-veil);
}
.focus-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 32px;
  border-right: 1px solid var(--border-soft);
  color: var(--rose);
}
.focus-item:last-child { border-right: none; }
.focus-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--blush);
  flex-shrink: 0;
}
.focus-item span {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  /* letter-spacing: 0.04em; */
  color: var(--ink-mid);
  white-space: nowrap;
}

/* Contact icons */
.hero-contact {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: center;
  justify-content: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  width: 100%;
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
  padding-bottom: 0;
}
.hero-contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--blush-mid);
  border-radius: 50%;
  color: var(--rose);
  transition: background var(--transition), color var(--transition);
}
.hero-contact-icon:hover {
  background: var(--blush-light);
  color: var(--blush);
}
.hero-contact-icon svg {
  width: 16px;
  height: 16px;
}

/* ─── HERO RESPONSIVE ─── */
@media (max-width: 600px) {
  .hero-inner { padding: 48px 24px 56px; }
  .hero-photo-wrap { width: 140px; height: 140px; }
  .hero-name { font-size: clamp(2rem, 7vw, 2.8rem); }
  .hero-contact { flex-direction: column; align-items: center; gap: 16px; }
}

/* ─── SECTION ORNAMENT ─── */
.section-ornament {
  max-width: 1110px;
  margin: 64px auto 0;
  padding: 0 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.section-ornament-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-ornament-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.section-ornament-title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--ink-mid);
}
.section-ornament-num {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--blush-mid);
}
.ornament-diamond {
  width: 4px;
  height: 4px;
  background: var(--blush-mid);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* ─── FILTER BAR ─── */
.filter-bar {
  max-width: 1110px;
  margin: 0 auto 0;
  padding: 0 60px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.filter-btn {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mid);
  background: none;
  border: none;
  cursor: pointer;
  padding: 15px 22px;
  transition: color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.filter-btn:hover { color: var(--ink); }
.filter-btn.active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--blush);
}

/* ─── PORTFOLIO ─── */
.portfolio {
  max-width: 1110px;
  margin: 0 auto;
  padding: 56px 60px 100px;
}

/* ─── SECTION HEADER (within grid) ─── */
.grid-section {
  margin-bottom: 56px;
}
.grid-section-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 40px 0 20px;
}
.grid-section-header:first-child { padding-top: 0; }
.grid-section-line { flex: 1; height: 1px; background: var(--border); }
.grid-section-title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 2.1rem;
  color: var(--rose);
  letter-spacing: 0.02em;
}
.grid-section-adorn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.mini-diamond {
  width: 4px;
  height: 4px;
  background: var(--blush-mid);
  transform: rotate(45deg);
  opacity: 0.7;
}
.grid-section-num {
  display: none;
}

/* ─── CARD ─── */
.card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  background: var(--ivory);
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 10px;
}
.card:hover {
  border-color: var(--ink-soft);
  box-shadow: 0 4px 32px rgba(28,20,8,0.07);
}
.card.hidden { display: none; }

/* banner image */
.card-image {
  flex: none;
  width: 100%;
  position: relative;
  background: var(--ivory-warm);
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease;
}
.card:hover .card-image img { transform: scale(1.03); }
/* overlay fills the card, text flows top-to-bottom with link pinned to bottom */
.card-overlay {
  position: absolute;
  inset: 0;
  padding: 16px 36px 18px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  z-index: 1;
}

/* hidden — no longer a vertical bar */
.card-divider { display: none; }

.card-body { display: none; }

.card-category {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.card[data-cat="marketing"]  .card-category { color: var(--rose); }
.card[data-cat="editorial"]  .card-category { color: var(--rose); }
.card[data-cat="fiction"]    .card-category { color: var(--rose); }
.card[data-cat="academic"]   .card-category { color: var(--rose); }

.card-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: clamp(1.1rem, 3.5vw, 1.75rem);
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
}
.card-desc {
  display: none;
}
.card-footer {
  display: none;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mid);
  transition: color var(--transition);
}
.card-link::before,
.card-link::after {
  content: '—';
  font-size: 0.8rem;
  letter-spacing: 0;
  transition: opacity var(--transition);
}
.card:hover .card-link { color: var(--blush); }
.card-link-arrow { display: none; }

/* ─── FOOTER ─── */
footer {
  padding: 0 0 40px;
  text-align: center;
}
.footer-copy {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--rose);
}

/* ─── ANIMATIONS ─── */
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
  nav { padding: 0 32px; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 56px 32px 48px; }
  .hero-name, .hero-name-italic { font-size: clamp(3.5rem, 12vw, 6rem); }
  .portfolio { padding: 40px 32px 80px; }
  .filter-bar { padding: 0 32px; }
  footer { padding: 24px 0 32px; }
}

@media (max-width: 580px) {
  nav { padding: 0 20px; }
  .hero { padding: 44px 20px 0; }
  .portfolio { padding: 32px 20px 64px; }
  .filter-bar { padding: 0 20px; overflow: visible; justify-content: center; }
  .filter-btn { letter-spacing: 0.06em; padding: 10px 8px; }
}

@media (max-width: 390px) {
  .filter-btn { font-size: 0.63rem; letter-spacing: 0.04em; padding: 10px 5px; }
  footer { padding: 24px 0 32px; }
  .card-overlay { gap: 6px; }
}

/* ═══════════════════════════════════════════════════════════
   NOTION MODAL
═══════════════════════════════════════════════════════════ */

body.modal-open { overflow: hidden; }

#notionModal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#notionModal.open {
  pointer-events: auto;
  opacity: 1;
}

.notion-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 15, 5, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.notion-modal-panel {
  position: relative;
  z-index: 1;
  background: var(--ivory);
  border-radius: 14px;
  box-shadow: 0 32px 96px rgba(22, 15, 5, 0.28), 0 4px 20px rgba(22, 15, 5, 0.12);
  width: 80vw;
  height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(18px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid var(--border-soft);
}
#notionModal.open .notion-modal-panel {
  transform: translateY(0) scale(1);
}

/* ── Hero image (inside scrollable body, bleeds edge-to-edge) ── */
.notion-modal-hero {
  display: block;
  width: calc(100% + 96px);
  margin: -36px -48px 28px -48px;
  height: 260px;
  object-fit: cover;
  flex-shrink: 0;
}
.notion-modal-hero[hidden] { display: none; }

/* ── Header ── */
.notion-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.notion-modal-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: clamp(1.1rem, 2.4vw, 1.55rem);
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
}

.notion-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin-top: 2px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink-mid);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.notion-modal-close:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}

/* ── Scrollable body ── */
.notion-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 36px;
  overscroll-behavior: contain;
  background: var(--ivory-warm);

  /* Article typography */
  font-family: 'EB Garamond', serif;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--ink);
}

.notion-modal-body h1,
.notion-modal-body h2,
.notion-modal-body h3,
.notion-modal-body h4 {
  font-family: 'Playfair Display', serif;
  color: var(--ink);
  line-height: 1.3;
  margin: 1.8em 0 0.5em;
}
.notion-modal-body h1 { font-size: 1.85rem; font-weight: 700; }
.notion-modal-body h2 { font-size: 1.45rem; font-weight: 600; }
.notion-modal-body h3 { font-size: 1.2rem;  font-weight: 600; }
.notion-modal-body h4 { font-size: 1rem;    font-weight: 500; }

.notion-modal-body p { margin: 0 0 1.15em; }

.notion-modal-body ul,
.notion-modal-body ol {
  margin: 0 0 1.15em 1.4em;
  padding: 0;
}
.notion-modal-body li { margin-bottom: 0.35em; }

.notion-modal-body a {
  color: var(--rose);
  border-bottom: 1px solid var(--blush-light);
  text-decoration: none;
  transition: border-color var(--transition);
}
.notion-modal-body a:hover { border-color: var(--blush); }

.notion-modal-body blockquote {
  margin: 1.6em 0;
  padding: 0.9em 1.4em;
  border-left: 3px solid var(--blush-mid);
  background: var(--ivory-warm);
  font-style: italic;
  color: var(--ink-mid);
}
.notion-modal-body blockquote p { margin-bottom: 0; }

.notion-modal-body img {
  max-width: 100%;
  height: auto;
  margin: 1.6em auto;
  display: block;
  border-radius: 2px;
}

.notion-modal-body hr {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 2.2em 0;
}

.notion-modal-body pre {
  background: var(--ivory-deep);
  padding: 1em 1.2em;
  border-radius: 2px;
  overflow-x: auto;
  margin: 0 0 1.15em;
  font-size: 0.9rem;
}
.notion-modal-body code {
  font-size: 0.88em;
  background: var(--ivory-deep);
  padding: 2px 5px;
  border-radius: 2px;
}
.notion-modal-body pre code { background: none; padding: 0; }

/* ── Loading / error states ── */
.notion-modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.notion-modal-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--blush);
  border-radius: 50%;
  animation: modal-spin 0.75s linear infinite;
}

@keyframes modal-spin {
  to { transform: rotate(360deg); }
}

.notion-modal-error {
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  padding: 40px 0;
}

/* ── Gallery ── */
.notion-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notion-gallery-desc {
  font-style: italic;
  color: var(--ink-mid);
  margin-bottom: 28px;
}

.notion-gallery-empty {
  color: var(--ink-soft);
}

.notion-gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  box-shadow: 0 2px 16px rgba(28, 20, 8, 0.10);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .notion-modal-header { padding: 14px 16px 12px; }
  .notion-modal-body   { padding: 18px 16px 28px; }
  .notion-modal-title  { font-size: 1.1rem; }
  .notion-modal-hero   { width: calc(100% + 32px); margin: -18px -16px 16px -16px; }
}
