/* ============================================================
   陶禮君 — 個人網站樣式
   設計語言：書頁編輯感／奶油紙色＋玫瑰粉＋蝴蝶插畫
   ============================================================ */

:root {
  --paper:      #FBF6EE;
  --paper-deep: #F3EBDD;
  --ink:        #33291f;
  --ink-soft:   #6b5d4f;
  --rose:       #D34F7E;
  --rose-deep:  #B23663;
  --rose-mist:  #F5DEE7;
  --butter:     #E4AF3D;
  --line:       rgba(51, 41, 31, .22);
  --line-faint: rgba(51, 41, 31, .10);

  --serif-tc: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --display-en: "Cormorant Garamond", "Times New Roman", serif;
  --script-en: "Parisienne", "Snell Roundhand", cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-tc);
  font-size: 17px;
  line-height: 2;
  letter-spacing: .06em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 紙張紋理 —— 全站底層 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .26 0 0 0 0 .19 0 0 0 .04 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--rose-mist); color: var(--rose-deep); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- 共用工具 ---------- */

.wrap {
  width: min(1080px, 92vw);
  margin-inline: auto;
  position: relative;
  z-index: 2;
}

.script {
  font-family: var(--script-en);
  color: var(--rose);
  font-weight: 400;
  letter-spacing: .02em;
}

/* ［ 括號標題 ］ —— 參考圖的核心排版語言 */
.bracket-title {
  display: inline-flex;
  align-items: baseline;
  gap: .45em;
  font-weight: 600;
}
.bracket-title .bk {
  font-family: var(--display-en);
  font-weight: 300;
  color: var(--rose);
  transform: translateY(-.04em);
}

/* 進場顯示動畫 */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s cubic-bezier(.22,.61,.36,1), transform 1s cubic-bezier(.22,.61,.36,1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   導覽列
   ============================================================ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 22px 4vw 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: linear-gradient(to bottom, var(--paper) 55%, transparent);
}
.nav .logo {
  font-size: 19px;
  letter-spacing: .38em;
  font-weight: 600;
}
.nav .logo .sep { color: var(--rose); font-size: .7em; margin-inline: .1em; }
.nav ul {
  display: flex;
  gap: 34px;
  list-style: none;
  font-size: 14px;
  letter-spacing: .22em;
}
.nav ul a {
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color .4s, color .4s;
}
.nav ul a:hover { color: var(--rose-deep); border-color: var(--rose); }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  z-index: 2;
}

/* 巨型半透明英文 —— TAINAN 式壓底字 */
.hero .giant {
  position: absolute;
  bottom: -.08em;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--display-en);
  font-weight: 300;
  font-size: clamp(70px, 12.5vw, 185px);
  letter-spacing: .1em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(51,41,31,.16);
  white-space: nowrap;
  user-select: none;
}
.hero .giant b {
  font-weight: 300;
  color: rgba(255,255,255,.55);
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 0 rgba(51,41,31,.08);
}

.hero-inner {
  text-align: center;
  padding-top: 6vh;
}

.hero .kicker {
  font-size: clamp(26px, 3.2vw, 40px);
  display: block;
  margin-bottom: 3.2vh;
  animation: fadeDown 1.4s .2s cubic-bezier(.22,.61,.36,1) both;
}

.hero h1 {
  font-size: clamp(44px, 7.5vw, 96px);
  font-weight: 600;
  letter-spacing: .18em;
  line-height: 1.25;
  animation: fadeDown 1.4s .45s cubic-bezier(.22,.61,.36,1) both;
}
.hero h1 .bk { font-size: .92em; }
.hero h1 .sep {
  color: var(--rose);
  font-size: .38em;
  vertical-align: .55em;
  margin-inline: .12em;
}

.hero .sub {
  margin-top: 3.4vh;
  font-size: 15px;
  letter-spacing: .5em;
  color: var(--ink-soft);
  animation: fadeDown 1.4s .7s cubic-bezier(.22,.61,.36,1) both;
}

/* 直排引文 —— 中文書卷氣 */
.hero .vquote {
  position: absolute;
  right: clamp(12px, 6vw, 90px);
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-size: 15px;
  letter-spacing: .42em;
  color: var(--ink-soft);
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 18px;
  height: 46vh;
  animation: fadeIn 2s 1.1s both;
}

/* 蝴蝶 —— 書封品牌符號 */
.butterfly {
  position: absolute;
  width: 54px;
  color: var(--rose);
  animation: flutter 7s ease-in-out infinite;
}
.hero .butterfly { left: clamp(20px, 12vw, 190px); top: 24vh; }

.hero .scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--display-en);
  font-size: 12px;
  letter-spacing: .5em;
  color: var(--ink-soft);
  animation: fadeIn 2s 1.6s both;
}
.hero .scroll-hint::after {
  content: "";
  display: block;
  width: 1px;
  height: 44px;
  margin: 12px auto 0;
  background: var(--line);
  animation: drop 2.2s ease-in-out infinite;
}

@keyframes fadeDown { from { opacity: 0; transform: translateY(-22px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop { 0% { transform: scaleY(0); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: top; } 56% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@keyframes flutter {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-16px) rotate(7deg); }
}

/* ============================================================
   章節標頭
   ============================================================ */

.section { padding: 13vh 0 9vh; position: relative; z-index: 2; }

.sec-head { margin-bottom: 7vh; }
.sec-head .no {
  font-family: var(--display-en);
  font-style: italic;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: .3em;
  color: var(--rose);
  display: block;
  margin-bottom: 10px;
}
.sec-head h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: .3em;
}
.sec-head .en {
  font-size: clamp(22px, 2.6vw, 30px);
  margin-left: 18px;
}
.sec-head .rule {
  margin-top: 26px;
  height: 1px;
  background: linear-gradient(to right, var(--line) 0 38%, transparent 38.5%);
}

/* ============================================================
   關於
   ============================================================ */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(36px, 6vw, 90px);
  align-items: start;
}

.portrait {
  position: relative;
}
.portrait .ph {
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  padding: 14px;
  background: var(--paper);
  box-shadow: 14px 14px 0 var(--paper-deep);
}
.portrait .ph-inner {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 30% 20%, var(--rose-mist), transparent 60%),
    linear-gradient(160deg, #f6eddf, #eaddc9);
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: .3em;
  text-align: center;
  line-height: 2.4;
}
.portrait .caption {
  position: absolute;
  right: -14px;
  top: 8%;
  writing-mode: vertical-rl;
  font-size: 12px;
  letter-spacing: .4em;
  color: var(--ink-soft);
}

.about-text .lead {
  font-size: clamp(21px, 2.2vw, 26px);
  font-weight: 600;
  line-height: 2.1;
  letter-spacing: .1em;
  margin-bottom: 30px;
}
.about-text .lead em {
  font-style: normal;
  color: var(--rose-deep);
  border-bottom: 1px solid var(--rose);
  padding-bottom: 2px;
}
.about-text p { color: var(--ink-soft); margin-bottom: 1.4em; }

.books {
  margin-top: 44px;
  border-top: 1px solid var(--line-faint);
}
.books li {
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line-faint);
  transition: background .4s;
}
.books li:hover { background: rgba(245, 222, 231, .35); }
.books .yr {
  font-family: var(--display-en);
  font-style: italic;
  color: var(--rose);
  font-size: 14px;
  letter-spacing: .1em;
  min-width: 52px;
}
.books .t { font-weight: 600; letter-spacing: .12em; }
.books .tag {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: .25em;
}

/* ============================================================
   精選文章
   ============================================================ */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
  margin-bottom: 11vh;
}
.feature:nth-of-type(even) .f-media { order: 2; }

.f-media { position: relative; }
.f-media .frame {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
}
.f-media .frame .ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 13px; letter-spacing: .3em; color: var(--ink-soft);
  transition: transform 1.2s cubic-bezier(.22,.61,.36,1);
}
.feature:hover .frame .ph { transform: scale(1.045); }
.f-media .tape {
  position: absolute;
  top: -12px; left: 26px;
  padding: 3px 16px;
  background: var(--rose);
  color: #fff;
  font-family: var(--display-en);
  font-style: italic;
  font-size: 13px;
  letter-spacing: .25em;
}

.f-body .date {
  font-family: var(--display-en);
  font-style: italic;
  font-size: 14px;
  letter-spacing: .25em;
  color: var(--rose);
  display: block;
  margin-bottom: 14px;
}
.f-body h3 {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1.7;
  margin-bottom: 18px;
}
.f-body h3 a { transition: color .4s; }
.f-body h3 a:hover { color: var(--rose-deep); }
.f-body .excerpt {
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 24px;
}
.more {
  font-size: 13px;
  letter-spacing: .35em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
  transition: color .4s, border-color .4s;
}
.more:hover { color: var(--rose-deep); border-color: var(--rose); }
.more .arr { font-family: var(--display-en); margin-left: 6px; }

/* 文章卡片格 */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3.4vw, 46px);
}
.card {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  display: flex;
  flex-direction: column;
}
.card .frame {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line-faint);
  margin-bottom: 20px;
}
.card .frame .ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 12px; letter-spacing: .3em; color: var(--ink-soft);
  transition: transform 1.1s cubic-bezier(.22,.61,.36,1);
}
.card:hover .frame .ph { transform: scale(1.05); }
.card .date {
  font-family: var(--display-en);
  font-style: italic;
  font-size: 13px;
  letter-spacing: .22em;
  color: var(--rose);
  margin-bottom: 8px;
}
.card h4 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.8;
  margin-bottom: 10px;
}
.card h4 a:hover { color: var(--rose-deep); }
.card .excerpt {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.95;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .pics {
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--ink-soft);
}
.card .pics::before { content: "◦ "; color: var(--rose); }

.all-posts {
  margin-top: 9vh;
  text-align: center;
}
.all-posts a {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 15px 54px;
  font-size: 14px;
  letter-spacing: .4em;
  transition: background .5s, color .5s, border-color .5s;
}
.all-posts a:hover { background: var(--rose-deep); border-color: var(--rose-deep); color: #fff; }

/* ============================================================
   引文帶
   ============================================================ */

.quote-band {
  background: var(--paper-deep);
  padding: 12vh 0;
  text-align: center;
  position: relative;
  z-index: 2;
  overflow: hidden;
}
.quote-band .script {
  font-size: clamp(30px, 4.6vw, 54px);
  display: block;
  margin-bottom: 26px;
}
.quote-band .zh {
  font-size: clamp(17px, 1.8vw, 21px);
  letter-spacing: .34em;
  color: var(--ink-soft);
}
.quote-band .butterfly {
  position: absolute;
  right: 8vw;
  bottom: 8vh;
  width: 42px;
  opacity: .8;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  padding: 10vh 0 6vh;
  text-align: center;
  position: relative;
  z-index: 2;
}
footer .sign { font-size: clamp(30px, 4vw, 44px); display: block; margin-bottom: 18px; }
footer .fine {
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--ink-soft);
}
footer .fine .sep { color: var(--rose); margin-inline: 10px; }

/* ============================================================
   文章內頁
   ============================================================ */

.article-page { padding-top: 15vh; }

.article-head { text-align: center; margin-bottom: 8vh; }
.article-head .cat {
  font-family: var(--display-en);
  font-style: italic;
  font-size: 15px;
  letter-spacing: .3em;
  color: var(--rose);
  display: block;
  margin-bottom: 22px;
}
.article-head h1 {
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 600;
  letter-spacing: .16em;
  line-height: 1.7;
}
.article-head .meta {
  margin-top: 30px;
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--ink-soft);
}
.article-head .meta .sep { color: var(--rose); margin-inline: 14px; }
.article-head .rule {
  width: 72px; height: 1px;
  background: var(--rose);
  margin: 34px auto 0;
}

.article-body {
  width: min(680px, 92vw);
  margin-inline: auto;
}
.article-body p {
  margin-bottom: 2em;
  text-align: justify;
  color: #443a2e;
}
.article-body p.opening::first-letter {
  font-size: 3.1em;
  float: left;
  line-height: 1;
  padding: .08em .18em 0 0;
  color: var(--rose-deep);
  font-weight: 600;
}

.article-body .pull {
  margin: 3.4em auto;
  text-align: center;
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 600;
  letter-spacing: .22em;
  line-height: 2.2;
  color: var(--rose-deep);
  position: relative;
  padding: 1.6em 0;
}
.article-body .pull::before,
.article-body .pull::after {
  content: "";
  position: absolute;
  left: 50%; transform: translateX(-50%);
  width: 46px; height: 1px;
  background: var(--rose);
}
.article-body .pull::before { top: 0; }
.article-body .pull::after { bottom: 0; }

/* 文內圖片：1-4 張皆適用 */
.article-body figure {
  margin: 3.6em 0;
  break-inside: avoid;
}
.article-body figure.wide { width: min(880px, 94vw); margin-inline: calc((min(680px,92vw) - min(880px,94vw)) / 2); }
.article-body .frame {
  border: 1px solid var(--line);
  padding: 12px;
  background: var(--paper);
}
.article-body .frame .ph {
  aspect-ratio: 3 / 2;
  display: grid; place-items: center;
  font-size: 13px; letter-spacing: .3em; color: var(--ink-soft);
}
.article-body figcaption {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: .28em;
  color: var(--ink-soft);
}
.article-body figcaption .no {
  font-family: var(--display-en);
  font-style: italic;
  color: var(--rose);
  margin-right: 12px;
}

/* 兩張並排 */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 3.6em 0;
}
.duo figure { margin: 0; }
.duo .frame { aspect-ratio: 3 / 4; }
.duo .frame .ph { height: 100%; }

.article-end {
  text-align: center;
  margin: 7vh 0;
}
.article-end .fin {
  font-family: var(--display-en);
  font-style: italic;
  letter-spacing: .4em;
  font-size: 14px;
  color: var(--rose);
}

.post-nav {
  width: min(880px, 92vw);
  margin: 0 auto 10vh;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.post-nav a {
  padding: 30px 10px;
  transition: color .4s;
}
.post-nav a:hover { color: var(--rose-deep); }
.post-nav .dir {
  font-family: var(--display-en);
  font-style: italic;
  font-size: 13px;
  letter-spacing: .25em;
  color: var(--rose);
  display: block;
  margin-bottom: 8px;
}
.post-nav .t { font-size: 15px; letter-spacing: .1em; font-weight: 600; }
.post-nav .next { text-align: right; }
.post-nav .home {
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--ink-soft);
  padding-inline: 34px;
}

/* ---------- 真實照片通用 ---------- */
.ph > img,
.frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.frame > img { transition: transform 1.2s cubic-bezier(.22,.61,.36,1); }
.feature:hover .frame > img,
.card:hover .frame > img { transform: scale(1.045); }

/* ---------- 著作書牆 ---------- */
.shelf {
  margin-top: 44px;
  padding-top: 34px;
  border-top: 1px solid var(--line-faint);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 22px;
}
.shelf .book { text-align: center; }
.shelf .cover {
  aspect-ratio: 3 / 4.3;
  border: 1px solid var(--line);
  padding: 6px;
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--paper-deep);
  transition: transform .5s cubic-bezier(.22,.61,.36,1), box-shadow .5s;
  overflow: hidden;
}
.shelf .book:hover .cover {
  transform: translateY(-6px);
  box-shadow: 9px 13px 0 var(--rose-mist);
}
.shelf .cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.shelf .cover-ph {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(165deg, #f8f1e4, #efe2cd);
}
.shelf .cover-ph span {
  writing-mode: vertical-rl;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .34em;
  color: var(--ink-soft);
  border: 1px solid var(--line-faint);
  padding: 14px 6px;
}
.shelf .b-title {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1.7;
}
.shelf .b-tag {
  margin-top: 4px;
  font-family: var(--display-en);
  font-style: italic;
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--rose);
}

/* ============================================================
   RWD
   ============================================================ */

@media (max-width: 900px) {
  .nav ul { gap: 20px; font-size: 12.5px; }
  .hero .vquote { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 400px; }
  .feature { grid-template-columns: 1fr; gap: 26px; }
  .feature:nth-of-type(even) .f-media { order: 0; }
  .post-grid { grid-template-columns: 1fr; gap: 40px; }
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 26px; }
  .duo { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .post-nav .home { padding: 20px 10px; }
}
