/* Shared styles for ja/en landing pages.
   Light mode design unified with the app icon (vibrant overlapping shapes
   on an off-white background). Tailwind via CDN handles 99% of layout —
   this file is for components Tailwind utilities don't express cleanly. */

:root {
  /* Surfaces */
  --bg: #fafafa;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --border-soft: #f1f1f4;

  /* Text */
  --text: #18181b;
  --text-dim: #52525b;
  --text-faint: #a1a1aa;

  /* Brand — pulled directly from icon.svg */
  --indigo: #4F46E5;       /* primary */
  --indigo-dim: #4F46E518;
  --indigo-soft: #4F46E50d;
  --violet: #8B5CF6;
  --purple: #A855F7;
  --pink:   #EC4899;
  --orange: #F97316;
  --yellow: #EAB308;
  --green:  #10B981;
  --cyan:   #06B6D4;
  --blue:   #3B82F6;

  --good: #10B981;
  --info: #3B82F6;
}

html {
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body[lang^="ja"] {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", system-ui, -apple-system, sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 0.01em;
}
body[lang="en"] {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

.mono {
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
}

/* Headings: prefer visually balanced line wrapping (Safari 17.4+, Chrome 114+). */
h1, h2, h3 {
  text-wrap: balance;
}

/* Scroll-triggered soft reveal for sections. JS adds .is-visible when the
   section enters the viewport (see the inline script at the end of each HTML). */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Gradient text — Safari needs -webkit-text-fill-color, not just color: transparent. */
.grad-text {
  background: linear-gradient(90deg, #4F46E5, #A855F7, #EC4899);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}

/* ============= BACKGROUNDS ============= */

.hero-glow {
  background:
    radial-gradient(ellipse 70% 50% at 80% 20%, rgba(168, 85, 247, 0.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 30%, rgba(79, 70, 229, 0.08), transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 80%, rgba(249, 115, 22, 0.06), transparent 60%);
}

.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.06) 1px, transparent 0);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 80%);
  pointer-events: none;
}

.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, #000 30%, transparent 80%);
  pointer-events: none;
}

/* ============= HERO ILLUSTRATION (icon-derived shape composition) ============= */

.hero-art {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
}
.hero-art .blob {
  position: absolute;
  filter: blur(0.5px);
  mix-blend-mode: multiply;
}
.hero-art .b-indigo  { background: var(--indigo);  opacity: 0.85; }
.hero-art .b-violet  { background: var(--violet);  opacity: 0.80; }
.hero-art .b-purple  { background: var(--purple);  opacity: 0.75; }
.hero-art .b-pink    { background: var(--pink);    opacity: 0.78; }
.hero-art .b-orange  { background: var(--orange);  opacity: 0.78; }
.hero-art .b-yellow  { background: var(--yellow);  opacity: 0.65; }
.hero-art .b-green   { background: var(--green);   opacity: 0.78; }
.hero-art .b-cyan    { background: var(--cyan);    opacity: 0.70; }
.hero-art .b-blue    { background: var(--blue);    opacity: 0.65; }

/* ============= FOLDER TREE (Before/After) ============= */

.tree {
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  white-space: pre;
}
.tree .dim    { color: var(--text-faint); }
.tree .ok     { color: var(--green); }
.tree .accent { color: var(--indigo); }

/* ============= CARDS ============= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02), 0 4px 12px -4px rgba(0,0,0,0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.card-soft {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.card:hover {
  border-color: #d4d4d8;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 8px 24px -6px rgba(0,0,0,0.08);
}

.section-num {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--indigo);
  text-transform: uppercase;
}

/* Section accents: large, blurred, low-opacity blobs derived from the
   icon palette. Use mix-blend-multiply so they tint the surface without
   competing with foreground content. */
.section-accent {
  position: absolute;
  pointer-events: none;
  filter: blur(22px);
  mix-blend-mode: multiply;
  z-index: 0;
}
.section-accent.acc-indigo  { background: var(--indigo); }
.section-accent.acc-purple  { background: var(--purple); }
.section-accent.acc-violet  { background: var(--violet); }
.section-accent.acc-pink    { background: var(--pink); }
.section-accent.acc-orange  { background: var(--orange); }
.section-accent.acc-yellow  { background: var(--yellow); }
.section-accent.acc-green   { background: var(--green); }
.section-accent.acc-cyan    { background: var(--cyan); }
.section-accent.acc-blue    { background: var(--blue); }

/* ============= BUTTONS ============= */

.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--indigo);
  color: #ffffff;
  box-shadow: 0 4px 14px -4px rgba(79, 70, 229, 0.5);
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: #4338CA;
  box-shadow: 0 6px 20px -4px rgba(79, 70, 229, 0.55);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: #d4d4d8; background: var(--surface-2); }

.badge {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 999px;
  background: var(--indigo-dim);
  color: var(--indigo);
  text-transform: uppercase;
}
.badge-soon {
  background: #f4f4f5;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ============= MOCK APP WINDOW ============= */

.mock-window {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 30px 60px -20px rgba(79, 70, 229, 0.18),
    0 12px 30px -8px rgba(0,0,0,0.10);
  position: relative;
}

.mock-titlebar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafafa, #ffffff);
}
.mock-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #d4d4d8;
}
.mock-dot.r { background: #ff5f57; }
.mock-dot.y { background: #febc2e; }
.mock-dot.g { background: #28c840; }
.mock-title {
  margin-left: 0.5rem;
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.mock-body {
  padding: 1.1rem 1.2rem;
}
.mock-section { margin-bottom: 0.95rem; }
.mock-section:last-child { margin-bottom: 0; }
.mock-label {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.mock-input {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-dim);
}
.mock-input.focus { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
.mock-input .folder { color: var(--indigo); }

/* Token chips for template builder */
.token-chip {
  display: inline-flex; align-items: center;
  padding: 0.18rem 0.55rem;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 11.5px;
  background: var(--indigo-soft);
  color: var(--indigo);
  border: 1px solid var(--indigo-dim);
  border-radius: 5px;
}
.token-sep { color: var(--text-faint); padding: 0 0.15rem; }

/* Progress bar */
.mock-progress {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.65rem 0.8rem;
}
.mock-progress-bar {
  height: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}
.mock-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--violet));
  border-radius: 3px;
  transition: width 0.3s;
}
.mock-progress-text {
  display: flex; justify-content: space-between;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-dim);
}

/* Log lines */
.mock-log {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.7rem 0.85rem;
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text-dim);
  max-height: 180px; overflow: hidden;
}
.mock-log .ok    { color: var(--green); }
.mock-log .skip  { color: var(--info); }
.mock-log .arrow { color: var(--text-faint); }
.mock-log .path  { color: var(--text); }

/* Preview/diff table */
.mock-table {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 11.5px;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}
.mock-table-row {
  display: grid;
  grid-template-columns: 1fr auto 1.1fr auto;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.mock-table-row:last-child { border-bottom: none; }
.mock-table-row.header {
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.mock-table-row .src   { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-table-row .dst   { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-table-row .arrow { color: var(--text-faint); }
.pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pill-copy   { background: rgba(16, 185, 129, 0.12); color: var(--green); }
.pill-skip   { background: rgba(59, 130, 246, 0.12); color: var(--blue); }
.pill-rename { background: rgba(249, 115, 22, 0.14); color: var(--orange); }

/* Session row (Undo) */
.session-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: var(--surface);
}
.session-row .icon {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: var(--indigo-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--indigo);
}
.session-row .meta { display: flex; flex-direction: column; gap: 0.15rem; }
.session-row .title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.session-row .sub {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--text-faint);
}
.session-row .undo-btn {
  align-self: center;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface);
}

/* ============= TERMINAL ============= */

.terminal {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  color: #d4d4d8;
  overflow-x: auto;
}
.terminal .prompt  { color: #4ade80; user-select: none; }
.terminal .cmd     { color: #ffffff; }
.terminal .flag    { color: var(--orange); }
.terminal .out     { color: #a1a1aa; }
.terminal .ok      { color: #4ade80; }
.terminal .barfill { color: var(--violet); }

/* ============= FEATURE CARD MINI DIAGRAMS ============= */

.diagram {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.flow-row {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 11px;
}
.flow-pill {
  padding: 0.18rem 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
}
.flow-arrow { color: var(--text-faint); }

.tag-chip {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 10.5px;
  background: rgba(59, 130, 246, 0.10);
  color: #1e40af;
  border: 1px solid rgba(59, 130, 246, 0.20);
  border-radius: 4px;
  margin: 0.1rem 0.15rem 0.1rem 0;
}

/* ============= HOW IT WORKS STEPS ============= */

.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--indigo-soft);
  border: 1px solid var(--indigo-dim);
  color: var(--indigo);
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}

/* ============= PHOTO GRID (legacy fallback) ============= */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.photo-grid .ph {
  aspect-ratio: 1;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

@media (max-width: 720px) {
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============= PHOTO MARQUEE ============= */
/* Two-row infinite scrollers: top → right, bottom → left.
   Each track contains the photo set twice; the keyframes translate by
   exactly half the track width so the seam wraps invisibly. */

.photo-marquee {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  /* fade edges so photos appear to emerge / vanish */
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
          mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.marquee-row {
  overflow: hidden;
}

.marquee-track {
  display: flex;
  gap: 8px;
  width: max-content;
  will-change: transform;
}

.marquee-right .marquee-track {
  /* slow rightward scroll: start shifted left, end at zero */
  animation: marquee-right 80s linear infinite;
}

.marquee-left .marquee-track {
  animation: marquee-left 80s linear infinite;
}

@keyframes marquee-right {
  from { transform: translate3d(-50%, 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}

@keyframes marquee-left {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.photo-marquee .ph {
  flex-shrink: 0;
  width: 150px;
  height: 150px;
  border-radius: 10px;
  background-color: #e4e4e7;  /* fallback while picsum loads */
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

@media (max-width: 720px) {
  .photo-marquee .ph {
    width: 110px;
    height: 110px;
    border-radius: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-right .marquee-track,
  .marquee-left .marquee-track {
    animation: none;
    transform: translate3d(-25%, 0, 0);
  }
}

/* ============= FAQ ============= */

details {
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0;
}
details summary {
  cursor: pointer;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600;
  color: var(--text);
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+";
  color: var(--indigo);
  font-size: 1.4rem;
  font-weight: 300;
  transition: transform 0.2s;
}
details[open] summary::after { content: "−"; }
details p {
  margin-top: 0.7rem;
  color: var(--text-dim);
  line-height: 1.7;
}
details p code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}

/* ============= HOW-IT-WORKS STEP ANIMATIONS =============
   Subtle, slow loops that reinforce the "drag → arrange → done" story
   in the 3 step cards. Kept gentle so the page does not feel busy. */

@keyframes step1-folder-drift {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@keyframes step1-arrow-pulse {
  0%, 100% { opacity: 0.55; transform: translateX(0); }
  50%      { opacity: 1;    transform: translateX(3px); }
}
.step-anim-drop .flow-pill:first-child {
  animation: step1-folder-drift 3s ease-in-out infinite;
}
.step-anim-drop .flow-arrow {
  animation: step1-arrow-pulse 3s ease-in-out infinite;
}

@keyframes step2-token-snap {
  0%       { transform: translateY(-12px); opacity: 0; }
  35%      { transform: translateY(2px);  opacity: 1; }
  50%      { transform: translateY(0);    opacity: 1; }
  100%     { transform: translateY(0);    opacity: 1; }
}
.step-anim-tokens .token-chip {
  animation: step2-token-snap 4s ease-out infinite;
}
.step-anim-tokens .token-chip:nth-child(1) { animation-delay: 0s; }
.step-anim-tokens .token-chip:nth-child(3) { animation-delay: 0.45s; }
.step-anim-tokens .token-chip:nth-child(5) { animation-delay: 0.9s; }

@keyframes step3-progress-fill {
  0%   { width: 0%; }
  85%  { width: 100%; }
  100% { width: 100%; }
}
@keyframes step3-check-pop {
  0%, 70%  { transform: scale(0); opacity: 0; }
  80%      { transform: scale(1.25); opacity: 1; }
  90%      { transform: scale(0.95); opacity: 1; }
  100%     { transform: scale(1);   opacity: 1; }
}
.step-anim-progress .mock-progress-bar > div {
  animation: step3-progress-fill 4s ease-out infinite;
  transition: none;
}
.step-anim-progress .pop-check {
  display: inline-block;
  color: var(--green);
  animation: step3-check-pop 4s ease-out infinite;
  margin-left: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .step-anim-drop     .flow-pill:first-child,
  .step-anim-drop     .flow-arrow,
  .step-anim-tokens   .token-chip,
  .step-anim-progress .mock-progress-bar > div,
  .step-anim-progress .pop-check { animation: none; }
}

/* ============= HERO STORY SVG =============
   Container sizing for the SVG drop-in that replaces the mock window.
   The SVG itself ships its own scoped <style> for keyframes. */

.hero-story {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.hero-story svg { display: block; width: 100%; height: auto; }

/* ============= UNDO SVG =============
   Spin direction & inline alignment with the UNDO feature card. */

.undo-illust {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
