/* わたしラボ — アプリの「森の片隅の小さな研究室」から。生成りの紙に、インクの文字と深い葉の緑。
   見出しは研究ノートの明朝、本文は角ゴシック。罫線とピーチの余白線でノートの頁らしくしている。
   配色はアプリの DesignSystem/Palette.swift（ライト）と起動画面の Cream に合わせてある。 */
:root {
  --bg: #f3ebdd;       /* Cream（起動画面と同じ） */
  --paper: #faf5ec;    /* Card（ノートの紙） */
  --line: #dccfb8;     /* 罫線 */
  --ink: #514637;
  --dim: #6b5f51;      /* 背景に対して 4.5:1 以上 */
  --leaf: #5e7149;     /* LeafDeep。リンクと見出しの英字 */
  --sage: #879b70;
  --peach: #e9b79a;    /* ノートの余白線 */
  --honey: #eed79b;
  --radius: 14px;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); scroll-behavior: smooth; color-scheme: light; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  font-size: 15px; line-height: 1.95; letter-spacing: .02em;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--leaf); text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; border-radius: 6px; }
b, strong { font-weight: 700; }

.skip {
  position: absolute; top: -60px; left: 16px; z-index: 20;
  padding: 8px 14px; border-radius: 999px; background: var(--leaf); color: #fff;
  font-size: 12px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- 上のバー（棚の板のような細い木の縁） ---- */
.topbar {
  display: flex; align-items: center; gap: 6px; min-height: 58px;
  padding: 0 max(16px, env(safe-area-inset-left));
  background: rgba(243, 235, 221, .92); backdrop-filter: blur(10px);
  border-bottom: 3px solid #c9a77d;
  position: sticky; top: 0; z-index: 10;
}
.topbar a {
  padding: 6px 12px; border-radius: 999px;
  color: var(--dim); font-size: 12px; text-decoration: none; white-space: nowrap;
}
.topbar a:hover { color: var(--ink); background: var(--paper); }
.topbar a[aria-current="page"] { color: var(--ink); background: var(--paper); }
.topbar .home {
  display: flex; align-items: center; gap: 7px; margin-right: auto; padding-left: 0;
  color: var(--dim); font-size: 11px; letter-spacing: .1em;
}
.topbar .home:hover { background: none; }
.topbar .home img { width: 16px; opacity: .6; }

/* ---- はじめの画面：研究室の水彩画の上に、ノートの頁 ---- */
.hero { position: relative; text-align: center; }
.hero .room {
  width: 100%; aspect-ratio: 16 / 7; object-fit: cover; object-position: 50% 78%;
  -webkit-mask: linear-gradient(#000 70%, transparent);
  mask: linear-gradient(#000 70%, transparent);
}
.hero .room-night { display: none; }
.hero .page {
  position: relative; width: min(100% - 32px, 560px); margin: -64px auto 0;
  padding: 30px 28px 28px 44px; border-radius: 6px var(--radius) var(--radius) 6px;
  background: var(--paper); box-shadow: 0 10px 30px rgba(90, 69, 50, .14);
}
.hero .page::before { /* ノートの余白線 */
  content: ""; position: absolute; left: 22px; top: 10px; bottom: 10px; width: 1px; background: var(--peach);
}
.hero .icon {
  width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(81, 70, 55, .12), 0 8px 24px rgba(90, 69, 50, .2);
}
.hero h1 {
  font-family: var(--serif); font-weight: 700; color: var(--ink);
  font-size: clamp(30px, 8vw, 42px); letter-spacing: .12em; text-indent: .12em; line-height: 1.4;
}
.hero .tag { margin-top: 8px; font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--leaf); letter-spacing: .08em; }
.hero .sub { margin-top: 6px; color: var(--dim); font-size: 13px; }
.hero .status {
  display: inline-block; margin-top: 18px; padding: 4px 16px; border-radius: 999px;
  border: 1px dashed var(--sage); color: var(--leaf); font-size: 12px; letter-spacing: .12em; background: var(--paper);
}

/* ---- 本文 ---- */
.wrap { width: min(100% - 32px, 760px); margin: 0 auto; }
main.wrap { padding-bottom: 20px; }
section { padding: 56px 0 8px; }
h2 {
  margin-bottom: 18px; font-family: var(--serif); font-size: 21px; letter-spacing: .06em; line-height: 1.5; font-weight: 700;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
h2 .en { display: block; margin-bottom: 2px; color: var(--leaf); font-family: inherit; font-size: 11px; letter-spacing: .22em; font-weight: 400; }
h3 { margin: 22px 0 4px; font-family: var(--serif); font-size: 16px; line-height: 1.6; }
h4 { margin: 20px 0 4px; font-size: 14px; }
p + p { margin-top: 12px; }
ul { padding-left: 1.3em; }
li + li { margin-top: 5px; }
.note, .updated { color: var(--dim); font-size: 12.5px; }
.lead { font-size: 16px; line-height: 1.9; }

/* 今日の調子の5つの顔（アプリの記録と同じ色） */
.faces { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 18px; padding: 0; list-style: none; }
.faces li { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--dim); }
.faces li::before {
  content: ""; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(81, 70, 55, .15);
}
.faces .f2 { --c: #5e7149; } .faces .f1 { --c: #879b70; } .faces .f0 { --c: #dccbae; }
.faces .fm1 { --c: #e9b79a; } .faces .fm2 { --c: #9e5a4a; }

/* 研究室の昼と夜 */
.daynight { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.daynight figure img { border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 10px 26px rgba(90, 69, 50, .16); }
.daynight figcaption { margin-top: 8px; color: var(--dim); font-size: 12px; text-align: center; }

/* カード（ノートの付箋） */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 6px; }
.card {
  position: relative; padding: 20px 22px 20px 30px; border-radius: 6px var(--radius) var(--radius) 6px;
  background: var(--paper); box-shadow: 0 0 0 1px var(--line);
}
.card::before { content: ""; position: absolute; left: 14px; top: 12px; bottom: 12px; width: 1px; background: var(--peach); }
.card h3 { margin: 0 0 4px; color: var(--leaf); }
.card p { color: var(--dim); font-size: 13px; line-height: 1.8; }

/* 表 */
.spec { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 14px; }
.spec th, .spec td { padding: 11px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec th { width: 34%; color: var(--dim); font-weight: 400; }

/* App Store バッジ。Apple が配布しているアートワークをそのまま置く(assets/style.css と同じ指定)。
   色・比率・内部の余白は変えない。高さだけ指定し、周囲の余白はバッジ高さの 1/4 以上空ける */
.badge-appstore { display: inline-block; line-height: 0; margin: 16px 16px 0 0; border-radius: 8px; }
.badge-appstore img { height: 52px; width: auto; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 20px;
  border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink);
  font-size: 13px; text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.links a:hover { border-color: var(--leaf); color: var(--leaf); }

.contact {
  margin-top: 16px; padding: 18px 22px; border-radius: var(--radius); background: var(--paper);
  box-shadow: 0 0 0 1px var(--line);
}
.contact .addr { font-size: 15px; font-weight: 700; letter-spacing: .03em; overflow-wrap: anywhere; }
.caution {
  margin-top: 16px; padding: 14px 18px; border-radius: 10px;
  background: rgba(238, 215, 155, .32); box-shadow: inset 0 0 0 1px rgba(201, 167, 125, .6);
  font-size: 13px; color: var(--ink);
}

/* 規約・ポリシー・サポート（ノートの頁） */
.doc { width: min(100% - 32px, 680px); }
.doc > section:first-child { padding-top: 40px; }
.doc h1 {
  padding-bottom: 14px; border-bottom: 1px solid var(--leaf); color: var(--leaf);
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(21px, 5vw, 26px); letter-spacing: .05em; line-height: 1.5;
}
.doc h1 + .updated, .doc h1 + .lead { margin-top: 12px; }
.doc h2 { margin-top: 38px; margin-bottom: 10px; font-size: 17px; }
.doc section > h2:first-child { margin-top: 0; }

/* 英語 */
section.en { margin-top: 48px; padding-top: 40px; border-top: 1px dashed var(--line); }
section.en > h2 { font-size: 18px; }
section.en h3 { color: var(--dim); font-family: inherit; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

.wrap.foot { padding-bottom: 48px; }
footer {
  margin-top: 40px; padding: 28px 0; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 11px; text-align: center;
}
footer .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
footer .row a { color: var(--dim); text-decoration: none; }
footer .row a:hover { color: var(--leaf); }

@media (max-width: 640px) {
  .topbar { gap: 2px; overflow-x: auto; }
  .topbar a { padding: 6px 9px; font-size: 11px; }
  .hero .room { aspect-ratio: 4 / 3; }
  .hero .page { margin-top: -40px; padding: 26px 18px 24px 36px; }
  .hero .page::before { left: 18px; }
  .hero .tag { font-size: 16px; }
  .cards, .daynight { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
