/* おまかせ日記 / Omakase Journal — 公式サイト
   アプリの Theme.swift と同じ色: 昼は生成りの紙、夜は深い藍。アクセントは青緑。 */

:root {
  color-scheme: light dark;
  --paper: #faf7f1;
  --card: #ffffff;
  --bubble: #edf1f2;
  --ink: #1f2a30;
  --muted: #5d6b72;
  --line: #e6dfd2;
  --accent: #3f6e7a;
  --on-accent: #ffffff;
  --accent-soft: rgba(63, 110, 122, 0.1);
  --glow: #d9a441;
  --glow-text: #86601a;
  --joy: #eda542;
  --relief: #72b089;
  --tired: #7f96ba;
  --uneasy: #a585b7;
  --plain: #bab2a8;
  --shadow: 0 1px 2px rgba(31, 42, 48, 0.04), 0 8px 24px rgba(31, 42, 48, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111621;
    --card: #1d2330;
    --bubble: #293140;
    --ink: #e9edf1;
    --muted: #9aa6b2;
    --line: #2b3345;
    --accent: #7fb0bc;
    --on-accent: #0d1a1e;
    --accent-soft: rgba(127, 176, 188, 0.13);
    --glow: #f5c865;
    --glow-text: #f5c865;
    --joy: #f9bf64;
    --relief: #8dc9a3;
    --tired: #9ab0d3;
    --uneasy: #bfa2cf;
    --plain: #948f88;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "Noto Sans JP", "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.9;
  line-break: strict;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}

:lang(en) body,
body:lang(en) {
  line-height: 1.7;
  word-break: normal;
  overflow-wrap: break-word;
}

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

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

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: min(100% - 32px, 960px);
  margin-inline: auto;
}

.wrap-narrow {
  width: min(100% - 32px, 680px);
  margin-inline: auto;
}

/* ---------- ヘッダ・フッタ ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  flex-wrap: wrap;
  padding: 16px max(16px, calc((100% - 960px) / 2));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.site-nav {
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-footer {
  margin-top: 96px;
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: grid;
  gap: 16px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.footer-nav a {
  color: var(--muted);
}

.footer-nav a:hover {
  color: var(--ink);
}

.copyright {
  margin: 0;
}

@media (max-width: 480px) {
  .site-header {
    gap: 6px 12px;
    padding-bottom: 8px;
  }
  .site-nav {
    gap: 4px 18px;
  }
}

/* ---------- トップ ---------- */

.hero {
  display: grid;
  gap: 40px;
  align-items: center;
  padding-top: 24px;
}

@media (min-width: 820px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    padding-top: 48px;
  }
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(1.75rem, 5.2vw, 2.6rem);
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

:lang(en) h1 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0 0 28px;
  font-size: 1.05rem;
  color: var(--ink);
  max-width: 34em;
}

:lang(en) .lead {
  max-width: 36em;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.badge-soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}

.badge-soon svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.cta-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.device {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px 18px 18px;
  max-width: 420px;
  width: 100%;
  margin-inline: auto;
}

.device-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: var(--muted);
}

.device-head img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.bubble {
  margin: 0 0 12px;
  padding: 11px 15px;
  border-radius: 20px;
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 88%;
}

.bubble.yoru {
  background: var(--bubble);
  border-bottom-left-radius: 6px;
}

.bubble.you {
  background: var(--accent);
  color: var(--on-accent);
  border-bottom-right-radius: 6px;
  margin-left: auto;
}

.moods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 16px;
  padding: 0;
  list-style: none;
}

.moods li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}

.moods li::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--plain);
}

.moods .joy::before { background: var(--joy); }
.moods .relief::before { background: var(--relief); }
.moods .tired::before { background: var(--tired); }
.moods .uneasy::before { background: var(--uneasy); }

.moods .on {
  color: var(--ink);
  border-color: var(--relief);
  background: color-mix(in srgb, var(--relief) 16%, transparent);
}

.draft {
  margin: 0;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.85;
}

.draft small {
  display: block;
  margin-bottom: 4px;
  color: var(--glow-text);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.floaty {
  animation: floaty 7s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  .floaty { animation: none; }
  html { scroll-behavior: auto; }
}

section.block {
  margin-top: 88px;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 3.6vw, 1.7rem);
  line-height: 1.5;
  text-wrap: balance;
}

:lang(en) h2 {
  line-height: 1.3;
}

.block > .sub {
  margin: 0 0 32px;
  color: var(--muted);
  max-width: 38em;
}

.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.steps li {
  position: relative;
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 22px 24px;
  box-shadow: var(--shadow);
}

.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
}

.steps h3,
.feature h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  line-height: 1.5;
}

.steps p,
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.features {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .features {
    grid-template-columns: 1fr 1fr;
  }
}

.feature {
  padding: 22px;
  border-radius: 20px;
  background: var(--bubble);
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--glow);
  color: var(--glow-text);
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: 0.15em;
  letter-spacing: 0.04em;
}

.quiet {
  padding: 32px clamp(20px, 5vw, 44px);
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.quiet p {
  margin: 0 0 12px;
  max-width: 38em;
}

.quiet p:last-child {
  margin-bottom: 0;
}

.text-link {
  font-weight: 700;
}

/* ---------- 規約・ポリシー・サポート ---------- */

.doc {
  padding-top: 24px;
}

.doc h1 {
  font-size: clamp(1.6rem, 4.6vw, 2.1rem);
  margin-bottom: 10px;
}

.meta {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.9rem;
}

.doc h2 {
  margin: 56px 0 12px;
  padding-top: 8px;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  scroll-margin-top: 16px;
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 1.02rem;
  line-height: 1.6;
  scroll-margin-top: 16px;
}

.doc p {
  margin: 0 0 14px;
}

.doc ul,
.doc ol {
  margin: 0 0 14px;
  padding-left: 1.4em;
}

.doc li {
  margin-bottom: 6px;
}

.doc li::marker {
  color: var(--muted);
}

.intro {
  font-size: 1.02rem;
}

.toc {
  margin: 28px 0 8px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  font-size: 0.92rem;
}

.toc strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.doc .toc ol {
  margin: 0;
  padding-left: 1.6em;
  columns: 1;
}

@media (min-width: 640px) {
  .doc .toc ol {
    columns: 2;
    column-gap: 32px;
  }
}

.doc .toc li {
  margin-bottom: 3px;
  break-inside: avoid;
}

.note {
  margin: 0 0 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 0.95rem;
}

.doc .note p {
  margin: 0;
}

.table-wrap {
  margin: 0 0 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.7;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

th {
  width: 9.5em;
  font-weight: 700;
  white-space: nowrap;
}

:lang(en) th {
  width: 9em;
}

@media (max-width: 600px) {
  table,
  tbody,
  tr,
  th,
  :lang(en) th,
  td {
    display: block;
    width: auto;
  }
  tr {
    border-bottom: 1px solid var(--line);
  }
  tr:last-child {
    border-bottom: 0;
  }
  th,
  td,
  tr:last-child th,
  tr:last-child td {
    border-bottom: 0;
  }
  th {
    padding-bottom: 0;
  }
  td {
    padding-top: 2px;
  }
}

.faq details {
  margin: 0 0 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 44px 14px 18px;
  font-weight: 700;
  line-height: 1.6;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq details > div {
  padding: 0 18px 8px;
}

.faq details > div p:last-child,
.faq details > div ul:last-child,
.faq details > div ol:last-child {
  margin-bottom: 8px;
}

.contact-card {
  margin-top: 20px;
  padding: 22px 24px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.contact-card p {
  margin: 0 0 10px;
}

.contact-card p:last-child {
  margin-bottom: 0;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  padding: 11px 24px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.06);
  text-decoration: none;
}

/* ---------- 404 ---------- */

.not-found {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding-top: 64px;
}

.not-found img {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  margin-bottom: 12px;
}

.not-found p {
  margin: 0 0 8px;
}

@media print {
  .site-header,
  .site-footer,
  .toc,
  .skip-link {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}
