/* ============================================================
   言霊会話にゃお × LIXデザイン 応募用デモサイト
   Brand palette: mustard yellow / black / warm orange
   ============================================================ */

:root {
  --yellow: #f5d000;
  --yellow-deep: #e0ba00;
  --yellow-pale: #fff6d6;
  --black: #1c1a14;
  --black-soft: #2b2820;
  --orange: #ff8a3d;
  --orange-deep: #e56a1c;
  --cream: #fffaf0;
  --gray-text: #55503f;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(28, 26, 20, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --font-jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-jp);
  color: var(--black-soft);
  background: var(--cream);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--black);
  border-bottom: 3px solid var(--yellow);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--yellow);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand .cat-mark { width: 34px; height: 34px; flex-shrink: 0; }

.brand small {
  display: block;
  color: var(--white);
  font-weight: 400;
  font-size: 10.5px;
  opacity: 0.75;
  letter-spacing: 0.03em;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
  justify-content: flex-end;
}

.main-nav a {
  color: var(--white);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--yellow);
  color: var(--black);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  text-align: center;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--black);
  color: var(--yellow);
  box-shadow: var(--shadow);
}
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-2px); }

.btn-accent {
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(255, 138, 61, 0.4);
}
.btn-accent:hover { background: var(--orange-deep); transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  color: var(--black);
  border: 2px solid var(--black);
}
.btn-outline:hover { background: var(--black); color: var(--yellow); }

.btn-ghost-yellow {
  background: var(--yellow);
  color: var(--black);
}
.btn-ghost-yellow:hover { background: var(--yellow-deep); transform: translateY(-2px); }

/* ---------- Sections / generic ---------- */
section { padding: 70px 0; }

.section-yellow { background: var(--yellow); }
.section-black { background: var(--black); color: var(--cream); }
.section-cream { background: var(--cream); }
.section-white { background: var(--white); }

.eyebrow {
  display: inline-block;
  background: var(--black);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.section-black .eyebrow,
.badge-graphic ~ .eyebrow { background: var(--yellow); color: var(--black); }

h1, h2, h3, h4 { font-weight: 800; line-height: 1.4; margin: 0 0 18px; }
h1 { font-size: clamp(28px, 5vw, 46px); }
h2 { font-size: clamp(24px, 3.6vw, 34px); }
h3 { font-size: 20px; }
p { margin: 0 0 16px; color: var(--gray-text); }
.section-black p { color: #d8d3c2; }

.lead { font-size: 18px; color: var(--black-soft); }
.section-black .lead { color: var(--yellow-pale); }

.center { text-align: center; }
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }

/* ---------- Cat mascot (pure SVG/CSS) ---------- */
.cat-mark { display: block; }

/* ---------- Badge (お墨付き style) ---------- */
.badge-graphic { width: 150px; height: 150px; }

/* ---------- Cards / grid ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow);
}

.card-yellow-border { border: 3px solid var(--yellow); }

/* ---------- Hero photo frame ---------- */
.photo-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
  font-size: 12px;
  padding: 30px 16px 12px;
  letter-spacing: 0.02em;
}

/* ---------- Phone mockup ---------- */
.phone {
  width: 300px;
  max-width: 82vw;
  margin: 0 auto;
  background: var(--black);
  border-radius: 42px;
  padding: 14px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.35);
  position: relative;
}
.phone::before {
  content: "";
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 22px;
  background: var(--black);
  border-radius: 0 0 16px 16px;
  z-index: 5;
}
.phone-screen {
  background: var(--yellow-pale);
  border-radius: 28px;
  overflow: hidden;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.phone-statusbar {
  height: 30px;
  background: transparent;
  flex-shrink: 0;
}
.phone-topbar {
  background: var(--black);
  color: var(--yellow);
  padding: 14px 18px 12px;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.phone-body { padding: 18px; flex: 1; overflow-y: auto; }

.app-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255,138,61,0.4);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.app-btn:hover { filter: brightness(1.08); }
.app-btn:active { transform: scale(0.96); }

.app-btn-secondary {
  background: var(--white);
  color: var(--black);
  border: 2px solid var(--black);
  box-shadow: none;
}

.history-item {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 10px rgba(28,26,20,0.06);
  border-left: 5px solid var(--yellow);
  animation: fadeIn 0.4s ease;
}
.history-item .h-date { font-size: 11px; color: #9a917a; font-weight: 700; margin-bottom: 4px; }
.history-item .h-text { font-size: 14px; color: var(--black-soft); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-hint {
  text-align: center;
  color: #a89f88;
  font-size: 13px;
  padding: 30px 10px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--black);
  color: #d8d3c2;
  padding: 40px 0 30px;
  font-size: 13px;
}
.site-footer a { color: var(--yellow); font-weight: 700; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Utility ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; }
.tag-list li {
  background: var(--yellow-pale);
  border: 1.5px solid var(--yellow-deep);
  color: var(--black-soft);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
}

.note-box {
  background: var(--yellow-pale);
  border: 2px dashed var(--yellow-deep);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 13.5px;
  color: var(--black-soft);
  margin: 18px 0;
}

.hero {
  padding: 60px 0 40px;
  background:
    radial-gradient(circle at 85% 15%, rgba(255,138,61,0.35), transparent 45%),
    var(--yellow);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.page-hero {
  padding: 54px 0;
  background: var(--black);
  color: var(--cream);
  text-align: center;
}
.page-hero h1 { color: var(--yellow); margin-bottom: 10px; }
.page-hero p { color: #d8d3c2; max-width: 640px; margin: 0 auto; }

/* ---------- Code blocks ---------- */
.code-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 22px 0; }
.code-block {
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.code-block .code-label {
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13px;
}
.code-before .code-label { background: #5c2323; color: #ffd6d6; }
.code-after .code-label { background: #1f5c2e; color: #d6ffe0; }
.code-block pre {
  margin: 0;
  background: #1b1b1b;
  color: #eae6da;
  padding: 16px;
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
}
.code-block pre .tok-key { color: #ffb454; }
.code-block pre .tok-str { color: #a8e07a; }
.code-block pre .tok-com { color: #8a8676; }
.code-block pre .tok-fn { color: #7cc6ff; }

/* ---------- Devtools console (bug demo) ---------- */
.devtools {
  background: #1e1e1e;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
}
.devtools-bar {
  background: #2d2d2d;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.devtools-dot { width: 11px; height: 11px; border-radius: 50%; }
.devtools-dot.red { background: #ff5f57; }
.devtools-dot.yellow { background: #febc2e; }
.devtools-dot.green { background: #28c840; }
.devtools-title { color: #999; font-size: 11.5px; margin-left: 8px; }
.devtools-body { padding: 16px; min-height: 150px; font-size: 12.5px; color: #d4d4d4; }
.devtools-body .console-line { padding: 6px 0; border-bottom: 1px solid #2a2a2a; display: flex; gap: 8px; }
.devtools-body .console-error { color: #ff6b6b; }
.devtools-body .console-error .marker { color: #ff5f57; font-weight: 700; }
.devtools-body .console-ok { color: #7ee08a; }
.devtools-body .console-ok .marker { color: #28c840; font-weight: 700; }
.devtools-body .console-muted { color: #7a7a7a; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(20px);
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 12px 26px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: #c0392b; color: #fff; }
.toast-success { background: #1f8a3c; color: #fff; }

.shake { animation: shake 0.45s ease; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

/* ---------- Mode toggle ---------- */
.mode-toggle {
  display: inline-flex;
  background: var(--black);
  border-radius: 999px;
  padding: 5px;
  gap: 4px;
  margin: 0 auto 36px;
}
.mode-toggle button {
  border: none;
  background: transparent;
  color: #a89f88;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mode-toggle button.active.mode-before { background: #c0392b; color: #fff; }
.mode-toggle button.active.mode-after { background: #1f8a3c; color: #fff; }

.demo-flex {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: start;
  justify-content: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.status-pill.before { background: #fbe3e0; color: #a3291b; }
.status-pill.after { background: #dff5e2; color: #1a6b30; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .code-compare { grid-template-columns: 1fr; }
  .demo-flex { grid-template-columns: 1fr; justify-items: center; }
  .main-nav { justify-content: flex-start; }
  section { padding: 50px 0; }
}

@media (max-width: 480px) {
  .nav-inner { flex-direction: column; align-items: flex-start; }
  .main-nav { width: 100%; justify-content: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .phone { width: 100%; }
}
