/* Happy FriYay — design tokens from design_handoff_happy_friyay/README.md */

:root {
  --bg-page: #F0E3D8;
  --bg-card: #FFF6EE;
  --bg-section: #FBEDE2;
  --bg-chip: #F7E4D6;
  --bg-card-inner: #FFFBF6;
  --accent: #E9B09B;
  --accent-hover: #dd9d85;
  --accent-deep: #cf8b72;
  --text-primary: #2B2B2B;
  --text-secondary: #5A5A56;
  --text-muted: #A08D80;
  --hairline: #F0DFD1;
  --hairline-shell: #EBD9CB;
  --shadow-card: 0 18px 50px rgba(90, 90, 86, 0.10);
  --shadow-image: 0 14px 36px rgba(90, 90, 86, 0.16);
  --serif: 'Playfair Display', Georgia, serif;
  --script: 'Dancing Script', cursive;
  --sans: Lato, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
}

body {
  min-height: 100vh;
  padding: 28px 24px 56px;
  font-family: var(--sans);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #d8977f; }

img { max-width: 100%; }

.shell {
  max-width: 1160px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--hairline-shell);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 22px 40px;
  background: var(--bg-card);
  border-bottom: 1px solid #F0E0D2;
}

.site-header .logo-link { display: block; line-height: 0; }
.site-header .logo-link img { height: 40px; width: auto; display: block; }

.site-nav { display: flex; align-items: center; gap: 22px; }

.site-nav a {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
}

.site-nav a:hover, .site-nav a.active { color: var(--text-primary); }

.site-nav .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  display: block;
}

.site-nav .nav-heart { height: 20px; width: 20px; margin-left: 14px; display: block; }

/* ---------- Buttons, hearts, eyebrows ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-card);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 16px 34px;
  border-radius: 999px;
  white-space: nowrap;
}

.btn:hover { background: var(--accent-hover); color: var(--bg-card); }

.heart-divider { display: block; margin-left: auto; margin-right: auto; }

.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Home hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  background: var(--bg-section);
  min-height: 460px;
}

.hero-copy {
  padding: 76px 20px 76px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 620px;
}

.hero-copy h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 62px;
  line-height: 1.02;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text-primary);
}

.hero-copy .tagline {
  font-family: var(--script);
  font-size: 31px;
  color: var(--text-secondary);
  margin: 16px 0 0;
}

.hero-copy .intro {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 44px 0 0;
  max-width: 430px;
  text-wrap: pretty;
}

.hero-media { position: relative; overflow: hidden; min-height: 460px; }

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.5) 4%, rgba(0,0,0,0.9) 9%, #000 14%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.5) 4%, rgba(0,0,0,0.9) 9%, #000 14%);
}

.hero-media .hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #FBEDE2 0%, rgba(251,237,226,0.45) 5%, rgba(251,237,226,0) 13%);
}

/* ---------- Home: recent archive rows ---------- */

.home-archive { padding: 68px 56px 76px; background: var(--bg-card); }

.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 38px;
  letter-spacing: 0.06em;
  text-align: center;
  margin: 0;
  color: var(--text-primary);
}

.home-archive .heart-divider { height: 20px; width: auto; margin-top: 18px; margin-bottom: 44px; }

.entry-rows { display: flex; flex-direction: column; gap: 22px; }

.entry-row {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  background: var(--bg-card-inner);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
}

.entry-row:hover { border-color: var(--accent); }

.entry-row-media {
  background: var(--bg-chip);
  min-height: 210px;
  overflow: hidden;
  position: relative;
}

.entry-row-media a { display: block; position: absolute; inset: 0; }

.entry-row-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  display: block;
}

.entry-row-body {
  padding: 34px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.entry-row-body .eyebrow { margin: 0 0 12px; }

.entry-row-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 27px;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.entry-row-body h3 a { color: var(--text-primary); }
.entry-row-body h3 a:hover { color: var(--text-primary); }

.entry-row-body .blurb {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 18px;
  max-width: 520px;
  text-wrap: pretty;
}

.entry-row-body .view-link { font-size: 15px; color: var(--accent); font-weight: 400; }
.entry-row-body .view-link:hover { color: var(--accent-deep); }

.home-archive .btn-wrap { display: flex; justify-content: center; margin-top: 46px; }

/* ---------- Page hero (archive / about / detail) ---------- */

.page-hero { background: var(--bg-section); padding: 68px 56px 60px; text-align: center; }

.page-hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 50px;
  letter-spacing: 0.05em;
  margin: 0;
  color: var(--text-primary);
}

.page-hero .tagline {
  font-family: var(--script);
  font-size: 28px;
  color: var(--text-secondary);
  margin: 16px 0 0;
}

.page-hero .heart-divider { height: 22px; width: 22px; margin-top: 26px; margin-bottom: 26px; }

.page-hero .meta {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Archive ---------- */

.archive-month { padding: 62px 56px 20px; background: var(--bg-card); }

.month-heading { display: flex; align-items: center; gap: 20px; margin: 0 0 34px; }

.month-heading h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--text-primary);
  white-space: nowrap;
}

.month-heading .rule { height: 1px; background: var(--hairline); flex: 1; }

.month-heading .count {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.entry-card {
  display: block;
  background: var(--bg-card-inner);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
}

.entry-card:hover { border-color: var(--accent); }

.entry-card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg-chip);
  overflow: hidden;
}

.entry-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  display: block;
}

.entry-card-body { padding: 22px 24px 26px; }

.entry-card-body .eyebrow { font-size: 11px; margin: 0 0 10px; }

.entry-card-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--text-primary);
  text-wrap: pretty;
}

.entry-card-body p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
  text-wrap: pretty;
}

.archive-end { padding: 56px 56px 72px; background: var(--bg-card); text-align: center; }

.archive-end .end-note {
  font-family: var(--script);
  font-size: 24px;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Detail ---------- */

.detail-hero { padding: 54px 56px 10px; text-align: center; background: var(--bg-section); }

.back-link {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.back-link:hover { color: var(--text-secondary); }

.detail-hero .eyebrow { margin: 30px 0 14px; }

.detail-hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 48px;
  line-height: 1.14;
  margin: 0 auto;
  max-width: 760px;
  color: var(--text-primary);
  text-wrap: pretty;
}

.detail-hero .friyay-no {
  font-family: var(--script);
  font-size: 27px;
  color: var(--text-secondary);
  margin: 14px 0 0;
}

.detail-hero .heart-divider { height: 22px; width: 22px; margin-top: 26px; margin-bottom: 0; }

.detail-meme {
  background: var(--bg-section);
  padding: 40px 56px 56px;
  display: flex;
  justify-content: center;
}

.detail-meme figure { margin: 0; max-width: 620px; width: 100%; }

.detail-meme img {
  width: 100%;
  max-width: min(100%, calc(78vh * 0.8));
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid var(--hairline-shell);
  background: var(--bg-card);
  box-shadow: var(--shadow-image);
}

.detail-meme figcaption {
  font-family: var(--script);
  font-size: 20px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
}

.detail-body { padding: 64px 56px 20px; background: var(--bg-card); }

.detail-body .inner { max-width: 720px; margin: 0 auto; }

.detail-body h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 18px;
}

.detail-body p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0;
  text-wrap: pretty;
}

.detail-body p + p { margin-top: 20px; }

.detail-body strong { font-weight: 700; color: var(--text-primary); }

.detail-body .rule { height: 1px; background: var(--hairline); margin: 44px 0; }

.tag-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 40px 0 0; }

.tag {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-chip);
  border-radius: 999px;
  padding: 9px 16px;
  white-space: nowrap;
}

.prev-next { padding: 52px 56px 64px; background: var(--bg-card); }

.prev-next .inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.prev-next a {
  border: 1px solid var(--hairline);
  background: var(--bg-card-inner);
  border-radius: 14px;
  padding: 24px 28px;
  display: block;
}

.prev-next a:hover { border-color: var(--accent); background: var(--bg-card); }

.prev-next a.next { text-align: right; }

.prev-next .label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px;
  font-weight: 700;
}

.prev-next .pn-title { font-family: var(--serif); font-size: 21px; color: var(--text-primary); margin: 0; }

.prev-next .pn-date { font-size: 13px; color: var(--text-muted); margin: 8px 0 0; letter-spacing: 0.05em; }

.prev-next .spacer { visibility: hidden; }

/* ---------- About ---------- */

.about-hero { padding: 76px 56px 68px; }
.about-hero h1 { font-size: 52px; letter-spacing: 0.04em; }
.about-hero .tagline { font-size: 29px; }
.about-hero .heart-divider { height: 24px; width: 24px; margin-top: 30px; margin-bottom: 0; }

.about-copy { padding: 70px 56px 20px; background: var(--bg-card); }
.about-copy .inner { max-width: 660px; margin: 0 auto; }

.about-block + .about-block { margin-top: 46px; }

.about-copy .statement {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 25px;
  line-height: 1.4;
  color: var(--text-primary);
  margin: 0 0 14px;
  text-wrap: pretty;
}

.about-copy p {
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: 0;
  text-wrap: pretty;
}

.about-close {
  margin-top: 58px;
  padding-top: 46px;
  border-top: 1px solid var(--hairline);
  text-align: center;
}

.about-close .statement { margin-bottom: 10px; }

.about-close .welcome-line {
  font-family: var(--script);
  font-size: 27px;
  color: var(--text-secondary);
}

.about-close .welcome-line img {
  height: 20px;
  width: 20px;
  display: inline-block;
  vertical-align: -2px;
  margin-left: 6px;
}

.stats { padding: 56px 56px 10px; background: var(--bg-card); }

.stats .inner {
  max-width: 700px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.stat { padding: 30px 10px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--hairline); }

.stat .num { font-family: var(--serif); font-size: 34px; margin: 0; color: var(--text-primary); }

.stat .label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 8px 0 0;
}

.about-cta { padding: 56px 56px 72px; background: var(--bg-card); text-align: center; }

.about-cta .note {
  font-family: var(--script);
  font-size: 26px;
  color: var(--text-secondary);
  margin: 0 0 26px;
}

/* ---------- Welcome takeover (?welcome=1) ---------- */

/* Set on <html> by a head script before first paint, so the page never
   flashes behind the welcome card while it loads. */
html.welcome-pending { overflow: hidden; }

html.welcome-pending body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: radial-gradient(circle at 50% 30%, #FBEDE2 0%, #F0E3D8 70%);
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 30%, #FBEDE2 0%, #F0E3D8 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.welcome-overlay[hidden] { display: none; }

.welcome-overlay canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.welcome-card {
  position: relative;
  text-align: center;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--hairline-shell);
  border-radius: 22px;
  padding: 52px 36px;
  box-shadow: 0 24px 60px rgba(90, 90, 86, 0.18);
}

.welcome-card .welcome-logo {
  height: 44px;
  width: auto;
  display: block;
  margin: 0 auto 26px;
}

.welcome-card .welcome-script {
  font-family: var(--script);
  font-size: 30px;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.welcome-card .welcome-copy {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 30px;
  text-wrap: pretty;
}

.welcome-card .btn {
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  padding: 15px 30px;
}

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

.site-footer {
  padding: 34px 56px 40px;
  background: var(--bg-section);
  border-top: 1px solid #F0E0D2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer .made-for {
  font-family: var(--script);
  font-size: 22px;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
}

.site-footer .names {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-footer .names img { height: 15px; width: 15px; display: block; }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }

  .home-archive,
  .archive-month,
  .archive-end,
  .page-hero,
  .about-hero,
  .about-copy,
  .stats,
  .about-cta,
  .detail-hero,
  .detail-meme,
  .detail-body,
  .prev-next {
    padding-left: 32px;
    padding-right: 32px;
  }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }

  .hero-copy {
    padding: 56px 28px 44px;
    max-width: none;
    text-align: center;
    align-items: center;
  }

  .hero-copy .intro { max-width: 520px; }

  .hero-media { min-height: 300px; }

  .hero-media img {
    object-position: 50% 40%;
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.5) 4%, rgba(0,0,0,0.9) 9%, #000 14%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.5) 4%, rgba(0,0,0,0.9) 9%, #000 14%);
  }

  .hero-media .hero-fade {
    background: linear-gradient(to bottom, #FBEDE2 0%, rgba(251,237,226,0.45) 5%, rgba(251,237,226,0) 13%);
  }

  .entry-row { grid-template-columns: 1fr; }

  .entry-row-media {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .entry-row-media img { object-position: 50% 25%; }

  .entry-row-body { padding: 26px 28px 30px; }

  .prev-next .inner { grid-template-columns: 1fr; }
  .prev-next a.next { text-align: left; }
  .prev-next .spacer { display: none; }
}

@media (max-width: 640px) {
  body { padding: 16px 12px 36px; }

  .shell { border-radius: 18px; }

  .site-header { padding: 18px 20px; gap: 16px; }
  .site-header .logo-link img { height: 30px; }
  .site-nav { gap: 14px; }
  .site-nav .nav-heart { margin-left: 4px; height: 17px; width: 17px; }

  .hero-copy h1 { font-size: 42px; }
  .hero-copy .tagline { font-size: 26px; }

  .section-title { font-size: 30px; }

  .home-archive { padding: 48px 20px 56px; }
  .archive-month { padding: 44px 20px 8px; }
  .archive-end { padding: 40px 20px 52px; }

  .card-grid { grid-template-columns: 1fr; gap: 20px; }

  .page-hero, .about-hero { padding: 48px 24px 44px; }
  .page-hero h1, .about-hero h1 { font-size: 36px; }
  .page-hero .tagline, .about-hero .tagline { font-size: 24px; }

  .detail-hero { padding: 40px 24px 6px; }
  .detail-hero h1 { font-size: 32px; }
  .detail-meme { padding: 28px 20px 40px; }
  .detail-body { padding: 44px 24px 8px; }
  .detail-body .rule { margin: 32px 0; }
  .prev-next { padding: 36px 20px 44px; }

  .about-copy { padding: 48px 24px 10px; }
  .about-copy .statement { font-size: 21px; }
  .about-block + .about-block { margin-top: 36px; }
  .about-close { margin-top: 44px; padding-top: 36px; }
  .about-close .welcome-line { font-size: 24px; }
  .stats { padding: 40px 20px 0; }
  .stat .num { font-size: 27px; }
  .stat .label { font-size: 9.5px; letter-spacing: 0.12em; }
  .about-cta { padding: 40px 24px 52px; }

  .site-footer {
    padding: 26px 24px 30px;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
  }
}
