/* =========================================================
   制作サンプル: GAS業務自動化 事例紹介
   「問い合わせフォーム送信 → スプレッドシート自動記録 → メール通知」
   Clean & Minimal / 白基調・ネイビー＆ティール
   ========================================================= */

:root {
  --g-bg: #ffffff;
  --g-alt: #f4f6fb;
  --g-ink: #1a2233;
  --g-muted: #5b6577;
  --g-navy: #2b3a67;
  --g-teal: #0aa89a;
  --g-teal-dark: #07796f;
  --g-line: #e3e8f0;
  --g-code-bg: #1c2333;
  --g-font: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic", Meiryo, sans-serif;
  --g-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --g-maxw: 940px;
  --g-radius: 12px;
  --g-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; font-family: var(--g-font); color: var(--g-ink);
  background: var(--g-bg); line-height: 1.85; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--g-teal-dark); }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--g-teal); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.g-container { width: 100%; max-width: var(--g-maxw); margin-inline: auto; padding-inline: 24px; }

/* ===== サンプルバナー ===== */
.sample-bar {
  background: #1a2233; color: #e6ebf3; font-size: 0.8rem;
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; justify-content: center;
  padding: 8px 16px; text-align: center;
}
.sample-bar strong { color: #6fe0d3; }
.sample-bar a { color: #e6ebf3; text-decoration: underline; }

/* ===== Header ===== */
.g-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--g-line);
}
.g-header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.g-brand { font-weight: 700; color: var(--g-ink); text-decoration: none; font-size: 0.95rem; }
.g-brand span { color: var(--g-teal-dark); }
.g-header a.g-back { font-size: 0.84rem; color: var(--g-muted); text-decoration: none; }
.g-header a.g-back:hover { color: var(--g-teal-dark); }

/* ===== Hero ===== */
.g-hero { padding: clamp(44px, 8vw, 84px) 0 clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--g-line); }
.g-hero-kind {
  display: inline-block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em;
  color: var(--g-teal-dark); background: rgba(10, 168, 154, 0.1);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.g-hero h1 { font-size: clamp(1.6rem, 4.6vw, 2.4rem); line-height: 1.45; font-weight: 700; }
.g-hero-lead { margin-top: 18px; color: var(--g-muted); }
.g-hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.g-hero-meta span {
  font-size: 0.8rem; font-weight: 700; color: var(--g-navy);
  background: var(--g-alt); border: 1px solid var(--g-line);
  padding: 6px 12px; border-radius: 8px;
}

/* ===== Section ===== */
.g-section { padding: clamp(44px, 7vw, 76px) 0; }
.g-section-alt { background: var(--g-alt); }
.g-section-label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--g-teal-dark); margin-bottom: 8px; }
.g-section-title { font-size: clamp(1.35rem, 3.4vw, 1.75rem); font-weight: 700; }
.g-section-desc { margin-top: 12px; color: var(--g-muted); }
.g-section > .g-container > .g-section-title { margin-bottom: 28px; }

/* ===== Before / After ===== */
.g-ba { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 16px; align-items: stretch; margin-top: 28px; }
.g-ba-card { background: #fff; border: 1px solid var(--g-line); border-radius: var(--g-radius); padding: 24px; }
.g-ba-card.is-after { border-color: var(--g-teal); box-shadow: 0 10px 30px rgba(10, 168, 154, 0.12); }
.g-ba-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; color: var(--g-muted); margin-bottom: 12px; }
.g-ba-card.is-after .g-ba-tag { color: var(--g-teal-dark); }
.g-ba-list li { position: relative; padding-left: 22px; font-size: 0.9rem; color: var(--g-muted); margin-top: 8px; }
.g-ba-list li::before { content: "−"; position: absolute; left: 4px; color: #c0392b; font-weight: 700; }
.g-ba-card.is-after .g-ba-list li::before { content: "✓"; color: var(--g-teal); }
.g-ba-arrow { display: grid; place-items: center; color: var(--g-teal); font-size: 1.6rem; font-weight: 700; }
@media (max-width: 720px) {
  .g-ba { grid-template-columns: 1fr; }
  .g-ba-arrow { transform: rotate(90deg); }
}

/* ===== Flow diagram ===== */
.g-flow { margin-top: 28px; display: grid; gap: 14px; }
.g-flow-step {
  display: grid; grid-template-columns: 52px 1fr; gap: 18px; align-items: center;
  background: #fff; border: 1px solid var(--g-line); border-radius: var(--g-radius); padding: 20px 22px;
  position: relative;
}
.g-flow-step:not(:last-child)::after {
  content: ""; position: absolute; left: 41px; bottom: -14px; height: 14px; width: 2px; background: var(--g-line);
}
.g-flow-ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 700; font-size: 0.9rem; color: #fff;
}
.g-flow-ico.c1 { background: var(--g-navy); }
.g-flow-ico.c2 { background: var(--g-teal); }
.g-flow-ico.c3 { background: #3a7d44; }
.g-flow-ico.c4 { background: #b26a00; }
.g-flow-step h3 { font-size: 1rem; }
.g-flow-step p { font-size: 0.88rem; color: var(--g-muted); }
.g-flow-step code { font-family: var(--g-mono); font-size: 0.82em; background: var(--g-alt); padding: 1px 6px; border-radius: 4px; }

/* ===== Demo ===== */
.g-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 28px; align-items: start; }
@media (max-width: 820px) { .g-demo { grid-template-columns: 1fr; } }

.g-panel { background: #fff; border: 1px solid var(--g-line); border-radius: var(--g-radius); overflow: hidden; }
.g-panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; background: var(--g-alt); border-bottom: 1px solid var(--g-line);
  font-size: 0.8rem; font-weight: 700; color: var(--g-muted);
}
.g-panel-head .dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd3e1; }
.g-panel-body { padding: 20px; }

.g-form-row { margin-bottom: 14px; }
.g-form-row label { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; }
.g-req { font-size: 0.64rem; font-weight: 700; color: #c0392b; background: rgba(192,57,43,0.09); padding: 2px 6px; border-radius: 4px; margin-left: 5px; }
.g-form-row input, .g-form-row textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--g-ink);
  border: 1px solid var(--g-line); border-radius: 8px; background: #fff;
  transition: border-color 0.15s var(--g-ease), box-shadow 0.15s var(--g-ease);
}
.g-form-row input:focus, .g-form-row textarea:focus {
  outline: none; border-color: var(--g-teal); box-shadow: 0 0 0 3px rgba(10,168,154,0.15);
}
.g-form-row textarea { resize: vertical; }
.g-form-row.has-error input, .g-form-row.has-error textarea { border-color: #c0392b; }
.g-form-error { font-size: 0.76rem; color: #c0392b; margin-top: 5px; }
.g-form-error:empty { margin-top: 0; }
.g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 12px 20px; border-radius: 8px; font-weight: 700; font-size: 0.9rem; line-height: 1;
  border: 0; cursor: pointer; background: var(--g-teal); color: #fff;
  transition: background-color 0.2s var(--g-ease);
}
.g-btn:hover { background: var(--g-teal-dark); }
.g-btn:disabled { opacity: 0.6; cursor: default; }
.g-demo-status { margin-top: 10px; font-size: 0.82rem; font-weight: 700; text-align: center; min-height: 1.2em; }
.g-demo-status.is-ok { color: var(--g-teal-dark); }
.g-demo-status.is-ng { color: #c0392b; }

/* fake spreadsheet */
.g-sheet-wrap { overflow-x: auto; }
.g-sheet { width: 100%; border-collapse: collapse; font-size: 0.8rem; min-width: 420px; }
.g-sheet th, .g-sheet td { border: 1px solid #d7deea; padding: 7px 10px; text-align: left; vertical-align: top; }
.g-sheet thead th { background: #e8f5f2; color: var(--g-teal-dark); font-weight: 700; position: sticky; top: 0; }
.g-sheet td.col-idx { background: var(--g-alt); color: var(--g-muted); text-align: center; width: 34px; font-variant-numeric: tabular-nums; }
.g-sheet tr.is-new td { animation: rowIn 0.5s var(--g-ease); }
@keyframes rowIn { from { background: #d3f3ee; } to { background: transparent; } }
.g-sheet-empty { font-size: 0.82rem; color: var(--g-muted); padding: 8px 2px; }

/* mail preview */
.g-mail { border: 1px solid var(--g-line); border-radius: 8px; overflow: hidden; }
.g-mail-head { background: var(--g-alt); padding: 12px 16px; border-bottom: 1px solid var(--g-line); font-size: 0.82rem; }
.g-mail-head div { display: flex; gap: 8px; }
.g-mail-head span { color: var(--g-muted); min-width: 40px; }
.g-mail-body { padding: 16px; font-size: 0.84rem; white-space: pre-wrap; color: var(--g-ink); }
.g-mail.is-empty .g-mail-body { color: var(--g-muted); }

/* ===== Code ===== */
.g-code-note { margin-bottom: 16px; color: var(--g-muted); font-size: 0.9rem; }
.g-code {
  background: var(--g-code-bg); color: #e7ecf5; border-radius: var(--g-radius);
  padding: 22px; overflow-x: auto; font-family: var(--g-mono); font-size: 0.82rem; line-height: 1.7;
}
.g-code code { font-family: inherit; }
.g-code .cm { color: #7f8ba6; }
.g-code .kw { color: #7cc7ff; }
.g-code .st { color: #9ae6a4; }
.g-code .fn { color: #f0c674; }

/* ===== Effects ===== */
.g-effects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.g-effect { background: #fff; border: 1px solid var(--g-line); border-radius: var(--g-radius); padding: 24px; }
.g-effect strong { display: block; font-size: 1.6rem; color: var(--g-teal-dark); }
.g-effect span { font-size: 0.86rem; color: var(--g-muted); }
@media (max-width: 720px) { .g-effects { grid-template-columns: 1fr; } }

/* ===== spec list ===== */
.g-spec { border-top: 1px solid var(--g-line); margin-top: 8px; }
.g-spec > div { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--g-line); font-size: 0.9rem; }
.g-spec dt { font-weight: 700; }
.g-spec dd { color: var(--g-muted); }
@media (max-width: 560px) { .g-spec > div { grid-template-columns: 1fr; gap: 2px; } }

/* ===== Footer ===== */
.g-footer { background: #1a2233; color: #b9c2d4; padding: 40px 0 26px; text-align: center; }
.g-footer a { color: #e6ebf3; }
.g-footer-copy { font-size: 0.78rem; color: #7c869c; margin-top: 12px; }

/* ===== reveal =====
   JS 動作時（html.js-anim）のみ初期状態を隠す。JS 無効時は常に表示。 */
.js-anim .g-reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--g-ease), transform 0.6s var(--g-ease); }
.js-anim .g-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-anim .g-reveal { opacity: 1; transform: none; transition: none; }
}
