/* P.A.Pilio v2 — "Twilight Wings"
   Deep dusk teal-indigo, pearl text, copper-bronze butterfly accent.
   Literary display type; calm expansive layout. */

:root {
  --bg: #0e1a22;
  --bg-elevated: #152430;
  --bg-soft: #1b2d3a;
  --surface: rgba(232, 228, 218, 0.04);
  --surface-strong: rgba(232, 228, 218, 0.08);
  --text: #ebe6dc;
  --text-muted: #9aabba;
  --text-faint: #6d7f8f;
  --accent: #c9a07a;
  --accent-soft: #d8b896;
  --accent-deep: #a67c52;
  --orchid: #b89bc4;
  --sky: #7eafc0;
  --line: rgba(232, 228, 218, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-ui: "Outfit", system-ui, sans-serif;
  --max: 72rem;
  --prose: 42rem;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(126, 175, 192, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(184, 155, 196, 0.1), transparent 50%),
    radial-gradient(800px 400px at 50% 100%, rgba(201, 160, 122, 0.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

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

a {
  color: var(--accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--text);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.85rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(14, 26, 34, 0.82);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand__mark {
  width: 2.4rem;
  height: 2.4rem;
  filter: drop-shadow(0 0 12px rgba(201, 160, 122, 0.35));
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand__tag {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
  color: var(--text);
  align-items: center;
  justify-content: center;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 1.15rem;
  height: 1.5px;
  background: currentColor;
  position: relative;
  transition: transform 0.2s var(--ease);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__bars::before {
  top: -6px;
}

.nav-toggle__bars::after {
  top: 6px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  align-items: center;
  justify-content: flex-end;
}

.nav__link {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--text);
  background: var(--surface-strong);
}

.nav__link.is-active {
  color: var(--accent-soft);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem 1.25rem;
    background: rgba(14, 26, 34, 0.96);
    border-bottom: 1px solid var(--line);
    gap: 0.25rem;
  }

  .nav.is-open {
    display: flex;
  }

  .nav__link {
    padding: 0.75rem 0.9rem;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: min(78vh, 42rem);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 1.25rem 5rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(14, 26, 34, 0.2), rgba(14, 26, 34, 0.85)),
    url("/assets/hero-lofoten.jpg") center / cover no-repeat;
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(201, 160, 122, 0.15), transparent 45%),
    linear-gradient(180deg, transparent 40%, var(--bg) 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  max-width: 42rem;
}

.hero__mark {
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 0 24px rgba(201, 160, 122, 0.45));
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.12;
  margin: 0.4rem 0 1rem;
  letter-spacing: 0.01em;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent-soft);
  font-weight: 400;
}

.hero__sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 34rem;
  margin: 0 auto 1.75rem;
}

.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sky);
  margin: 0 0 0.65rem;
}

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

/* Buttons */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.page-article .cta-row,
.post-article .cta-row,
.feature-band .cta-row,
.book-feature .cta-row,
.book-hero .cta-row {
  justify-content: flex-start;
}

.btn {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #1a120c;
  box-shadow: 0 10px 28px rgba(201, 160, 122, 0.25);
}

.btn--primary:hover {
  color: #0e0a07;
}

.btn--ghost {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent-soft);
}

.text-link {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--accent-soft);
  border-bottom: 1px solid transparent;
}

.text-link:hover {
  border-bottom-color: currentColor;
}

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.25rem;
}

.section--prose {
  max-width: calc(var(--prose) + 2.5rem);
}

.section__head {
  margin-bottom: 1.75rem;
}

.section__head h2,
.feature-band h2,
.page-hero h1,
.post-article h1,
.page-article h1 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0.25rem 0 0.75rem;
}

.page-hero h1,
.post-article h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.section__head h2,
.feature-band h2 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
}

/* Prose */
.prose,
.page-article,
.post-article__body {
  max-width: var(--prose);
}

.page-article {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.page-article > .prose,
.page-article > section.prose {
  max-width: var(--prose);
}

.prose p,
.page-article p,
.post-article__body p {
  margin: 0 0 1.15rem;
  color: var(--text);
}

.prose .lede,
.page-hero .lede,
.contact-panel .lede {
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.prose h1,
.prose h2,
.prose h3,
.page-article h1,
.page-article h2,
.page-article h3,
.post-article__body h1,
.post-article__body h2,
.post-article__body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 2rem 0 0.85rem;
}

.prose h2,
.page-article h2 {
  font-size: 1.85rem;
}

.prose h3,
.page-article h3 {
  font-size: 1.4rem;
  color: var(--accent-soft);
}

.prose ul,
.page-article ul,
.post-article__body ul {
  padding-left: 1.2rem;
  margin: 0 0 1.25rem;
}

.prose li,
.page-article li {
  margin-bottom: 0.45rem;
}

.pullquote,
.prose blockquote,
.page-article blockquote,
.post-article__body blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--accent-soft);
}

.byline {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-ui);
  color: var(--text-muted);
}

.inline-mark {
  width: 2rem;
  height: 2rem;
  display: inline-block;
}

.signature,
.signature-img {
  margin-top: 1.5rem;
}

.signature img,
.signature-img {
  max-width: 10rem;
  filter: brightness(0) invert(0.9) sepia(0.2);
  opacity: 0.85;
}

/* Feature band / book */
.feature-band {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.feature-band__inner {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

.feature-band__cover,
.book-feature__cover img,
.book-hero__cover {
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.book-feature {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 2rem;
  align-items: start;
  max-width: var(--max);
  margin: 0 auto 2.5rem;
  padding: 0 1.25rem;
}

.book-hero {
  display: grid;
  grid-template-columns: minmax(140px, 240px) 1fr;
  gap: 2rem;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1rem;
}

.book-hero__cover {
  width: 100%;
}

.quote-card {
  max-width: var(--max);
  margin: 0 auto 3rem;
  padding: 1.5rem 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  align-items: center;
}

.quote-card__avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
  grid-row: span 2;
  border: 2px solid var(--line);
}

.quote-card blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--accent-soft);
}

.quote-card cite {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: normal;
}

.testimonial {
  max-width: var(--prose);
  margin: 0 auto 2.5rem;
  padding: 0 1.25rem;
}

.testimonial blockquote {
  margin: 0 0 1.25rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--text);
}

.testimonial figcaption {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.testimonial figcaption img {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial figcaption strong {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.testimonial figcaption span {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.media-block {
  max-width: var(--prose);
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

.media-block--wide {
  max-width: var(--max);
}

.media-block img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

/* Blog */
.page-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.25rem 1.5rem;
}

.page-hero--compact {
  padding-bottom: 0.5rem;
}

.post-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.25rem;
}

.post-card {
  padding: 1.4rem 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.post-card:hover {
  border-color: rgba(201, 160, 122, 0.45);
  transform: translateY(-2px);
}

.post-card time {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.post-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}

.post-card h2 a {
  color: inherit;
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--accent-soft);
}

.post-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  flex: 1;
}

.post-rail {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.post-rail a {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s var(--ease);
}

.post-rail a:hover {
  border-color: rgba(201, 160, 122, 0.45);
}

.post-rail time {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.post-rail span {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.post-article {
  max-width: calc(var(--prose) + 2.5rem);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.post-article__header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.post-article__header time {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-article__footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* Thought cards */
.card-gallery {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.25rem;
}

.affirmation-card {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--bg-elevated);
}

.affirmation-card img {
  width: 100%;
}

/* Contact */
.contact-panel {
  max-width: var(--prose);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.contact-email {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 1.5rem 0 !important;
}

.contact-email a {
  color: var(--accent-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 160, 122, 0.4);
}

.contact-email a:hover {
  border-bottom-color: var(--accent);
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  background: rgba(8, 14, 18, 0.55);
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  display: grid;
  gap: 1.5rem;
}

.site-footer__brand {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.site-footer__brand strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  display: block;
}

.site-footer__brand p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.site-footer__links a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--accent-soft);
}

.site-footer__copy {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* Responsive book layouts */
@media (max-width: 700px) {
  .feature-band__inner,
  .book-feature,
  .book-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .feature-band__cover,
  .book-feature__cover,
  .book-hero__cover {
    max-width: 14rem;
    margin: 0 auto;
  }

  .feature-band .cta-row,
  .book-feature .cta-row,
  .book-hero .cta-row {
    justify-content: center;
  }

  .quote-card {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .quote-card__avatar {
    grid-row: auto;
  }
}
