/*
Theme Name: awai
Theme URI: https://awai-journal.com
Author: Anna Murashima
Description: あわい｜余白とくらしの記録 オリジナルテーマ。墨と余白の和モダン。
Version: 1.0.2
License: All rights reserved
Text Domain: awai
*/

:root {
  --shiro: #fcfcfa;
  --sumi: #1c1c1a;
  --nezu: #8a8a84;
  --usuzumi: #cfcfc8;
  --kinari: #f6f6f1;
  --serif: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --serif-old: "Zen Old Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--shiro);
  color: var(--sumi);
  font-family: var(--serif);
  line-height: 2;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
::selection { background: var(--sumi); color: var(--shiro); }

/* 幕あけ */
#veil {
  position: fixed; inset: 0; z-index: 100;
  background: var(--shiro);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.2s ease 0.2s, visibility 0s 1.5s;
}
#veil.open { opacity: 0; visibility: hidden; }
#veil .v-logo {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  opacity: 0; animation: vin 1.6s var(--ease) 0.3s forwards;
}
#veil .v-en { font-size: 30px; letter-spacing: 0.35em; padding-left: 0.35em; }
#veil .v-rule { width: 28px; height: 1px; background: var(--usuzumi); }
#veil .v-ja { font-size: 11px; letter-spacing: 0.6em; padding-left: 0.6em; color: var(--nezu); }
@keyframes vin { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: blur(0); } }
body.no-veil #veil { display: none; }

/* 頭 */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 30px 48px;
  transition: padding .6s var(--ease), background .6s, backdrop-filter .6s;
}
.site-head.compact {
  padding: 16px 48px;
  background: rgba(252,252,250,0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(28,28,26,0.06);
}
.logo { font-size: 19px; letter-spacing: 0.35em; font-family: var(--serif); }
.site-head nav { display: flex; gap: 40px; font-family: var(--sans); font-weight: 300; font-size: 12px; letter-spacing: 0.35em; }
.site-head nav a { position: relative; padding-bottom: 6px; }
.site-head nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--sumi);
  transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.site-head nav a:hover::after, .site-head nav a.now::after { transform: scaleX(1); transform-origin: left; }

/* しおり */
#shiori {
  position: fixed; right: 40px; top: 50%; transform: translateY(-50%);
  z-index: 15; display: flex; flex-direction: column; align-items: center;
  font-family: var(--sans);
}
#shiori .rail { position: relative; width: 1px; height: 180px; background: rgba(28,28,26,0.12); }
#shiori .ink { position: absolute; top: 0; left: 0; width: 1px; height: 0%; background: var(--sumi); transition: height .15s linear; }
#shiori .pct { writing-mode: vertical-rl; font-size: 9px; letter-spacing: 0.3em; color: var(--nezu); margin-top: 14px; }

/* 一景 */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; }
.hero-inner { display: flex; gap: 72px; align-items: center; }
.hero-fig { width: min(300px, 26vw); height: min(420px, 56vh); overflow: hidden; margin: 0; opacity: 0; transition: opacity 2s ease 1.7s; }
body.ready .hero-fig { opacity: 1; }
.hero-fig img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(1) contrast(0.95) brightness(1.04);
  transform: scale(1.06); transition: transform 8s var(--ease);
}
body.ready .hero-fig img { transform: scale(1); }
.hero-copy {
  writing-mode: vertical-rl;
  font-family: var(--serif-old);
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 2.4; letter-spacing: 0.3em;
  height: 400px; font-weight: 500;
}
.hero-copy .line { display: block; overflow: hidden; }
.hero-copy .line span { display: inline-block; transform: translateX(105%); transition: transform 1.6s var(--ease); }
body.ready .hero-copy .line:nth-child(1) span { transform: none; transition-delay: 1.1s; }
body.ready .hero-copy .line:nth-child(2) span { transform: none; transition-delay: 1.35s; }
.hero-sub { writing-mode: vertical-rl; font-size: 13px; letter-spacing: 0.4em; color: var(--nezu); height: 300px; line-height: 2.6; opacity: 0; transition: opacity 1.6s ease 2s; }
body.ready .hero-sub { opacity: 1; }
.koyomi { position: absolute; bottom: 44px; left: 48px; display: flex; align-items: center; gap: 18px; opacity: 0; transition: opacity 1.6s ease 2.3s; }
body.ready .koyomi { opacity: 1; }
.koyomi .sekki { font-size: 15px; letter-spacing: 0.35em; }
.koyomi .date { font-family: var(--sans); font-weight: 300; font-size: 10px; letter-spacing: 0.35em; color: var(--nezu); }
.koyomi .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--usuzumi); }
.scroll-hint {
  position: absolute; bottom: 0; right: 96px;
  font-family: var(--sans); font-size: 10px; letter-spacing: 0.4em;
  color: var(--nezu); writing-mode: vertical-rl; padding-bottom: 88px;
  opacity: 0; transition: opacity 1.6s ease 2.6s;
}
body.ready .scroll-hint { opacity: 1; }
.scroll-hint::after {
  content: ""; position: absolute; bottom: 0; left: 50%;
  width: 1px; height: 72px; background: var(--nezu);
  animation: line 2.8s var(--ease) infinite; transform-origin: top;
}
@keyframes line { 0%{transform:scaleY(0)} 45%{transform:scaleY(1)} 100%{transform:scaleY(1);opacity:0} }

/* 共通 */
section { padding: 150px 48px; position: relative; }
.wrap { max-width: 880px; margin: 0 auto; }
.sec-head {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  margin-bottom: 96px;
  font-family: var(--sans); font-weight: 300;
  font-size: 11px; letter-spacing: 0.5em; color: var(--nezu);
}
.sec-head::before, .sec-head::after {
  content: ""; width: 48px; height: 1px; background: var(--usuzumi);
  transform: scaleX(0); transition: transform 1.2s var(--ease) .3s;
}
.sec-head::before { transform-origin: right; }
.sec-head::after { transform-origin: left; }
.in .sec-head::before, .in .sec-head::after { transform: scaleX(1); }
.fade { opacity: 0; transform: translateY(28px); transition: opacity 1.4s var(--ease), transform 1.4s var(--ease); }
.fade.in { opacity: 1; transform: none; }

/* 言 */
.statement { text-align: center; }
.statement p { font-size: 15px; line-height: 3.2; letter-spacing: 0.2em; }

/* 景 */
.kei { padding: 0 48px; }
.kei figure { max-width: 980px; margin: 0 auto; overflow: hidden; position: relative; }
.kei img {
  width: 100%; height: 46vh; min-height: 300px; object-fit: cover; display: block;
  filter: grayscale(1) contrast(0.95) brightness(1.05);
  transform: scale(1.08); transition: transform 2.4s var(--ease);
}
.kei figure.in img { transform: scale(1); }
.kei figcaption {
  position: absolute; right: 20px; bottom: 16px;
  writing-mode: vertical-rl;
  font-size: 10px; letter-spacing: 0.4em; color: rgba(252,252,250,0.85);
  font-family: var(--sans); font-weight: 300;
}

/* 章 */
.chapters { border-top: 1px solid #ebebe5; }
.chapter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 64px; max-width: 980px; margin: 0 auto; }
.chapter { text-align: center; transition-delay: var(--d, 0s); }
.chapter .num { font-family: var(--sans); font-weight: 300; font-size: 10px; letter-spacing: 0.4em; color: var(--usuzumi); display: block; margin-bottom: 28px; }
.chapter .kanji {
  display: inline-block;
  writing-mode: vertical-rl; margin: 0 0 40px;
  height: 112px; padding-left: 26px; position: relative;
  text-align: initial;
}
.chapter .kanji .k { display: block; font-family: var(--serif-old); font-size: 34px; letter-spacing: 0.3em; font-weight: 500; margin-block-end: 14px; }
.chapter .kanji .yomi { display: block; font-size: 12px; letter-spacing: 0.5em; color: var(--nezu); padding-top: 10px; }
.chapter .kanji::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: 1px; height: 100%; background: var(--usuzumi);
  transform: scaleY(0); transform-origin: top;
  transition: transform 1.4s var(--ease) calc(var(--d, 0s) + .4s);
}
.in .chapter .kanji::before { transform: scaleY(1); }
.chapter .en { font-family: var(--sans); font-weight: 300; font-size: 10px; letter-spacing: 0.45em; color: var(--usuzumi); display: block; margin-bottom: 24px; }
.chapter p { font-size: 13px; line-height: 2.6; letter-spacing: 0.12em; color: var(--nezu); }
.chapter a.more { display: inline-block; margin-top: 32px; position: relative; font-family: var(--sans); font-size: 10px; letter-spacing: 0.4em; padding-bottom: 7px; }
.chapter a.more::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--sumi); transition: transform .5s var(--ease); }
.chapter a.more:hover::after { transform: scaleX(0); transform-origin: right; }

/* 記録 */
.latest { background: var(--kinari); }
.latest .wrap { max-width: 720px; }
.article {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 36px 8px; position: relative;
  border-bottom: 1px solid #e4e4dc;
  transition: padding .5s var(--ease);
  transition-delay: var(--d, 0s);
}
.article:hover { padding-left: 24px; padding-right: 0; transition-delay: 0s; }
.article::after {
  content: "→"; position: absolute; right: -28px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans); font-size: 13px; color: var(--nezu);
  opacity: 0; transition: opacity .5s var(--ease), right .5s var(--ease);
}
.article:hover::after { opacity: 1; right: -16px; }
.article .thumb { width: 72px; height: 72px; flex-shrink: 0; overflow: hidden; align-self: center; margin-right: 28px; }
.article .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1) contrast(0.95) brightness(1.04); transition: transform 1.2s var(--ease); }
.article:hover .thumb img { transform: scale(1.07); }
.article .cat { font-size: 12px; letter-spacing: 0.3em; color: var(--nezu); width: 64px; flex-shrink: 0; overflow: hidden; white-space: nowrap; }
.article .title { font-family: var(--serif-old); font-size: 15px; letter-spacing: 0.15em; flex: 1; padding: 0 24px; }
.article .date { font-family: var(--sans); font-weight: 300; font-size: 11px; letter-spacing: 0.2em; color: #b9b9b0; }

/* 私 */
.about { text-align: center; }
.about p { font-size: 14px; line-height: 3; letter-spacing: 0.16em; color: #4a4a46; }
.about .name { font-size: 13px; letter-spacing: 0.4em; margin-top: 48px; }

/* 記事ページ */
.post-head { padding: 200px 48px 80px; text-align: center; }
.post-head .cat-label { font-family: var(--sans); font-weight: 300; font-size: 11px; letter-spacing: 0.5em; color: var(--nezu); display: block; margin-bottom: 32px; }
.post-head h1 { font-family: var(--serif-old); font-size: clamp(22px, 3vw, 30px); font-weight: 500; letter-spacing: 0.2em; line-height: 2.2; max-width: 680px; margin: 0 auto; }
.post-head .post-date { font-family: var(--sans); font-weight: 300; font-size: 11px; letter-spacing: 0.3em; color: #b9b9b0; display: block; margin-top: 32px; }
.post-body { max-width: 640px; margin: 0 auto; padding: 0 24px 140px; font-size: 15px; line-height: 2.6; letter-spacing: 0.1em; }
.post-body p { margin-bottom: 2.2em; }
.post-body h2 { font-family: var(--serif-old); font-size: 19px; font-weight: 500; letter-spacing: 0.25em; margin: 3.5em 0 1.8em; padding-left: 20px; border-left: 1px solid var(--usuzumi); }
.post-body h3 { font-family: var(--serif-old); font-size: 16px; font-weight: 500; letter-spacing: 0.2em; margin: 3em 0 1.5em; }
.post-body img { display: block; margin: 3em auto; filter: grayscale(0.15) contrast(0.97); }
.post-body blockquote { margin: 3em 0; padding: 0 0 0 24px; border-left: 1px solid var(--usuzumi); color: #4a4a46; }
.post-foot { text-align: center; padding: 0 24px 160px; }
.post-foot a { font-family: var(--sans); font-size: 11px; letter-spacing: 0.4em; color: var(--nezu); border-bottom: 1px solid var(--usuzumi); padding-bottom: 6px; transition: color .4s, border-color .4s; }
.post-foot a:hover { color: var(--sumi); border-color: var(--sumi); }

/* 404 */
.notfound { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; }
.notfound .msg { writing-mode: vertical-rl; font-family: var(--serif-old); font-size: 20px; letter-spacing: 0.35em; line-height: 2.4; height: 260px; }
.notfound a { color: var(--nezu); font-family: var(--sans); font-size: 12px; letter-spacing: 0.4em; border-bottom: 1px solid var(--usuzumi); padding-bottom: 6px; }

/* 結 */
.site-foot { padding: 80px 48px 56px; text-align: center; border-top: 1px solid #ebebe5; }
.site-foot .f-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; }
.site-foot .f-en { font-size: 24px; letter-spacing: 0.35em; padding-left: 0.35em; }
.site-foot .f-rule { width: 24px; height: 1px; background: var(--usuzumi); }
.site-foot .f-ja { font-size: 10px; letter-spacing: 0.6em; padding-left: 0.6em; color: var(--nezu); }
.site-foot small { font-family: var(--sans); font-weight: 300; font-size: 10px; letter-spacing: 0.35em; color: var(--usuzumi); }

@media (max-width: 720px) {
  .site-head, .site-head.compact { padding: 20px 24px; }
  .site-head nav { gap: 20px; }
  section { padding: 100px 24px; }
  .hero-inner { gap: 36px; }
  .hero-copy { height: 320px; font-size: 22px; }
  .hero-sub { display: none; }
  .hero-fig { display: none; }
  .kei { padding: 0; }
  .article .thumb { width: 56px; height: 56px; margin-right: 16px; }
  .scroll-hint { right: 24px; }
  #shiori { display: none; }
  .chapter-grid { grid-template-columns: 1fr; gap: 88px; }
  .article { flex-wrap: wrap; }
  .article .title { padding: 8px 0 0; flex-basis: 100%; }
  .koyomi { left: 24px; }
  .post-head { padding: 160px 24px 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fade, .hero-copy .line span { opacity: 1 !important; transform: none !important; }
  #veil { display: none; }
}
