/* feelflow.co.jp — tokens inspired by Anthropic's restrained tone,
   warmed toward the logo's apricot and paper-ivory palette. */

:root {
  /* Paper / ink — warm, low-saturation (not pure gray) */
  --ff-bg:        #f4f1ea;   /* warm paper */
  --ff-bg-2:      #ebe6dc;
  --ff-bg-card:   #fbf9f4;
  --ff-ink:       #1a1714;
  --ff-ink-2:     #3a332c;
  --ff-ink-3:     #6e6558;
  --ff-ink-4:     #a59c8e;
  --ff-line:      #d6cebf;
  --ff-line-soft: #e2dccf;

  /* Orange — logo-matched */
  --ff-accent:     oklch(0.72 0.12 55);   /* logo apricot */
  --ff-accent-ink: oklch(0.56 0.14 45);   /* deeper for links */
  --ff-accent-wash:oklch(0.92 0.03 60);

  /* Type */
  --ff-jp:   "Noto Sans JP", -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --ff-en:   "Geist", "Söhne", ui-sans-serif, -apple-system, sans-serif;
  --ff-mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

/* Global scope for the site preview */
.ff {
  font-family: var(--ff-jp);
  font-feature-settings: "palt" 1;
  color: var(--ff-ink);
  background: var(--ff-bg);
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.ff *, .ff *::before, .ff *::after { box-sizing: border-box; }
.ff a { color: inherit; text-decoration: none; }
.ff p, .ff h1, .ff h2, .ff h3, .ff h4, .ff ul, .ff ol, .ff dl, .ff dd, .ff figure { margin: 0; padding: 0; }
.ff ul, .ff ol { list-style: none; }
.ff button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.ff-en   { font-family: var(--ff-en);   font-feature-settings: "ss01" 1, "cv11" 1; letter-spacing: -0.01em; }
.ff-mono { font-family: var(--ff-mono); letter-spacing: 0; }

.ff-eyebrow {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ff-ink-3);
}

.ff-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--ff-jp);
  transition: all .22s ease;
  cursor: pointer;
  white-space: nowrap;
}
.ff .ff-btn-primary { background: var(--ff-ink); color: var(--ff-bg); }
.ff .ff-btn-primary:hover { background: var(--ff-accent-ink); color: var(--ff-bg); }
.ff .ff-btn-ghost { color: var(--ff-ink); box-shadow: inset 0 0 0 1px var(--ff-line); }
.ff .ff-btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ff-ink); background: var(--ff-bg-card); color: var(--ff-ink); }

.ff-arrow { transition: transform .22s ease; display: inline-block; }
.ff-btn:hover .ff-arrow, .ff a:hover .ff-arrow { transform: translateX(2px); }

/* Photo placeholder — intentional, expresses "to be dropped in" */
.ff-photo {
  position: relative;
  background: var(--ff-bg-2);
  background-image:
    repeating-linear-gradient(135deg, transparent 0 11px, rgba(110,101,88,0.08) 11px 12px);
  border: 1px solid var(--ff-line);
  color: var(--ff-ink-3);
  overflow: hidden;
  border-radius: 4px;
}
.ff-photo::after {
  content: attr(data-label);
  position: absolute; inset: auto 16px 14px auto;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ff-ink-3);
  background: rgba(244,241,234,0.82);
  backdrop-filter: blur(4px);
  padding: 4px 8px;
  border-radius: 2px;
}
.ff-photo-gradient {
  /* warm orange-paper gradient used where a "real" image would feel too hollow */
  background:
    radial-gradient(ellipse at 20% 30%, oklch(0.88 0.08 60) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, oklch(0.82 0.10 45) 0%, transparent 55%),
    linear-gradient(135deg, oklch(0.94 0.02 70), oklch(0.82 0.08 55));
  background-blend-mode: screen;
}

/* Ticker — single-line marquee */
@keyframes ff-ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ff-ticker-track {
  display: inline-flex;
  animation: ff-ticker 55s linear infinite;
  gap: 72px;
  padding-right: 72px;
}

/* Sticky-nav blur */
.ff-nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--ff-bg) 94%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ff-line-soft);
}

/* Headline type */
.ff-h1 {
  font-family: var(--ff-jp);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.18;
  text-wrap: balance;
}
.ff-h2 {
  font-family: var(--ff-jp);
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.3;
  text-wrap: balance;
}
.ff-lead {
  font-size: 18px; line-height: 1.9; color: var(--ff-ink-2);
  max-width: 44em; text-wrap: pretty;
}

/* Link underline */
.ff-link {
  color: var(--ff-accent-ink);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color .2s;
}
.ff-link:hover { color: var(--ff-ink); }

/* Hide scrollbars inside dc artboards */
.ff ::-webkit-scrollbar { display: none; }
.ff { scrollbar-width: none; }

/* ── Animation primitives ─────────────────────────────────────── */

/* Fade-reveal: starts at opacity 0.3 + slight lift; becomes full on .is-in */
.ff-reveal {
  opacity: 0.3;
  transform: translateY(14px);
  transition:
    opacity  1.1s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
.ff-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Per-character wave on hero title */
@keyframes ff-title-wave {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
/* Keep each word unbroken */
.ff-title-wave { white-space: nowrap; display: inline-block; }
.ff-title-wave > span {
  display: inline-block;
  animation: ff-title-wave 4.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.08s);
  will-change: transform;
}

/* Logo one-stroke draw */
.ff-logo-draw path,
.ff-logo-draw rect,
.ff-logo-draw circle {
  stroke-dasharray: var(--len, 400);
  stroke-dashoffset: var(--len, 400);
  animation: ff-draw 2.2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.ff-logo-draw .accent {
  animation-delay: 1.4s;
  fill-opacity: 0;
  animation-name: ff-draw, ff-fade-fill;
  animation-duration: 1.2s, 0.8s;
  animation-delay: 1.2s, 2.0s;
  animation-fill-mode: forwards, forwards;
}
@keyframes ff-draw     { to { stroke-dashoffset: 0; } }
@keyframes ff-fade-fill { to { fill-opacity: 0.95; } }

/* Services card hover wave */
.ff-service-card { position: relative; overflow: hidden; }
.ff-service-card .ff-service-wave {
  position: absolute; inset: auto 0 0 0;
  height: 60%;
  opacity: 0; transform: translateY(40%);
  transition: opacity .5s ease, transform .9s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
}
.ff-service-card:hover .ff-service-wave,
.ff-service-card:focus-within .ff-service-wave {
  opacity: 0.55;
  transform: translateY(0%);
}

/* ── Reduced-motion: honor OS setting ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ff-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .ff-title-wave > span { animation: none !important; }
  .ff-logo-draw path,
  .ff-logo-draw rect,
  .ff-logo-draw circle { animation: none !important; stroke-dashoffset: 0 !important; fill-opacity: 0.95 !important; }
  .ff-service-card .ff-service-wave { transition: none !important; }
  .ff-ticker-track { animation: none !important; }
  * { scroll-behavior: auto !important; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (768px – 1023px)
   Prevent cramped 2-col text and forced side-label on mid widths.
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {
  .ff .ff-section-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .ff .ff-section-grid .ff-eyebrow { order: -1; }
  .ff-col-2, .ff-col-3 { grid-template-columns: 1fr !important; gap: 32px !important; }
  .ff-h2 { font-size: 40px !important; line-height: 1.15 !important; }
  /* CEO message grid — left signature column sits on top */
  .ff-ceo-grid { grid-template-columns: 1fr !important; gap: 32px !important; }

  /* Principles: 4 → 2×2 */
  .ff-principles-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .ff-principles-grid > li:nth-child(1),
  .ff-principles-grid > li:nth-child(2) { border-right: none !important; }
  .ff-principles-grid > li:nth-child(1) { border-right: 1px solid var(--ff-line) !important; }
  .ff-principles-grid > li:nth-child(3) { border-right: 1px solid var(--ff-line) !important; }
  .ff-principles-grid > li:nth-child(4) { border-right: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (<= 767px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* Container + section padding */
  .ff-row { padding: 0 20px !important; }
  .ff section { padding-left: 20px !important; padding-right: 20px !important; }
  .ff footer { padding-left: 20px !important; padding-right: 20px !important; }
  /* Kill inner Row padding on mobile — section already handles it */
  .ff .ff-row-inner { padding-left: 0 !important; padding-right: 0 !important; }

  /* Nav: replace horizontal links with hamburger */
  .ff-nav { padding: 14px 20px !important; }
  .ff-nav-desktop { display: none !important; }
  .ff-nav-hamburger { display: inline-flex !important; }

  /* Global h1/h2/h3 resize */
  .ff-h1 { line-height: 0.95 !important; }
  .ff-h2 { font-size: 30px !important; line-height: 1.25 !important; }
  .ff h3 { font-size: 18px !important; }

  /* Eyebrow spacing + forced side-label → top label */
  .ff .ff-section-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
  .ff .ff-section-grid .ff-eyebrow { order: -1; }

  /* Typography-heavy blocks */
  .ff-lead { font-size: 15px !important; line-height: 1.85 !important; }

  /* Generic 2-col → 1-col collapse */
  .ff-col-2, .ff-col-3 { grid-template-columns: 1fr !important; gap: 20px !important; }

  /* Services: 3 cards → 1 column, restore borders between stacked */
  .ff-services-grid { grid-template-columns: 1fr !important; }
  .ff-services-grid > * { border-right: none !important; }

  /* Principles: 4 cols → 1 col */
  .ff-principles-grid { grid-template-columns: 1fr !important; }
  .ff-principles-grid > li { border-right: none !important; }

  /* News table → stacked rows */
  .ff-news-row { grid-template-columns: 1fr !important; gap: 8px !important; padding: 18px 0 !important; align-items: start !important; }
  .ff-news-row .ff-arrow { display: none !important; }
  .ff-news-row > span:nth-child(2) { justify-self: start !important; }
  /* News section header stacks */
  .ff-news-head { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; }
  .ff-news-head h2 { font-size: 30px !important; }

  /* Hero top-right logo: shrink */
  .ff-hero-logo { top: 16px !important; right: 20px !important; }
  .ff-hero-logo svg { width: 56px !important; height: 56px !important; }
  .ff-hero-logo .ff-hero-logo-label { font-size: 8px !important; letter-spacing: 0.12em !important; }

  /* Hero hero-headline shrinks drastically */
  .ff-hero-headline { font-size: 56px !important; letter-spacing: -0.04em !important; }
  /* Force line break between "your" and "Wave." on mobile */
  .ff-hero-space-or-break { display: block !important; height: 0; width: 0; font-size: 0; }

  /* Hero padding */
  .ff-hero { padding: 110px 20px 80px !important; }

  /* Section padding generally */
  .ff-section { padding: 80px 20px !important; }

  /* Closer hero-style text */
  .ff-closer-headline { font-size: 68px !important; }

/* Principle pictograms */
.ff-principle-icon .pi { width: 100%; height: 100%; overflow: visible; }
.ff-principles-grid { --sp: 0; }

/* 01 Feel — rings scale bigger as you scroll through */
@keyframes pi-ripple { 0% { opacity: 0.85; r: 6; } 100% { opacity: 0; r: 34; } }
.pi-feel .pi-ring { transform-origin: 40px 40px; animation: pi-ripple 3.2s ease-out infinite; }
.pi-feel .pi-ring-2 { animation-delay: 1.07s; }
.pi-feel .pi-ring-3 { animation-delay: 2.13s; }
/* Scroll-linked: extra ring that grows with scroll progress */
.pi-feel { transform: scale(calc(1 + var(--sp, 0) * 0.15)); transform-origin: center; transition: transform 0.3s; }

/* 02 Front — dots accelerate forward as you scroll */
@keyframes pi-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@keyframes pi-chase { 0% { transform: translateX(-4px); opacity: 0.2; } 50% { opacity: 1; } 100% { transform: translateX(2px); opacity: 0.2; } }
.pi-front .pi-arrow { animation: pi-nudge 2.6s ease-in-out infinite; transform: translateX(calc(var(--sp, 0) * 6px)); }
.pi-front .pi-dot { animation: pi-chase 2.6s ease-in-out infinite; }
.pi-front .pi-dot-2 { animation-delay: 0.3s; }
.pi-front { transform: translateX(calc(var(--sp, 0) * 8px)); transition: transform 0.2s; }

/* 03 Wave — sines flow faster and shift with scroll */
@keyframes pi-flow { 0% { transform: translateX(0); } 100% { transform: translateX(-12px); } }
.pi-wave .pi-sine { animation: pi-flow 3.4s linear infinite; }
.pi-wave .pi-sine-2 { animation-duration: 4.2s; }
.pi-wave .pi-sine-3 { animation-duration: 5s; animation-direction: reverse; }
/* Scroll-linked: vertical spread increases with scroll */
.pi-wave { transform: scaleY(calc(1 + var(--sp, 0) * 0.4)); transform-origin: center; transition: transform 0.2s; }

/* 04 AI — spin speed + core glow driven by scroll */
@keyframes pi-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes pi-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.7; } }
.pi-ai .pi-sq { transform-origin: 40px 40px; animation: pi-spin 16s linear infinite; }
.pi-ai .pi-sq-inner { animation-duration: 10s; animation-direction: reverse; }
.pi-ai .pi-core { transform-origin: 40px 40px; animation: pi-pulse 2.4s ease-in-out infinite; }
/* Scroll-linked: whole icon rotates slightly with scroll */
.pi-ai { transform: rotate(calc(var(--sp, 0) * 45deg)); transform-origin: center; transition: transform 0.25s; }

@media (prefers-reduced-motion: reduce) {
  .pi-feel, .pi-front, .pi-wave, .pi-ai { transform: none !important; }
  .pi-feel .pi-ring, .pi-front .pi-arrow, .pi-front .pi-dot,
  .pi-wave .pi-sine, .pi-ai .pi-sq, .pi-ai .pi-core { animation: none !important; }
}

/* Footer accordion — flat on desktop, collapsible on mobile */
.ff-footer-group { display: block; }
.ff-footer-group > summary { list-style: none; cursor: default; }
.ff-footer-group > summary::-webkit-details-marker { display: none; }
.ff-footer-group > summary .ff-eyebrow { display: block; margin-bottom: 14px; }
.ff-footer-group > summary .ff-footer-group-chevron { display: none; }
.ff-footer-group > .ff-footer-group-list { display: flex !important; }
@media (min-width: 768px) {
  .ff-footer-group[open] > .ff-footer-group-list,
  .ff-footer-group > .ff-footer-group-list { display: flex !important; }
}
@media (max-width: 767px) {
  /* Footer legal row stacks on mobile */
  .ff-footer-legal { flex-direction: column !important; gap: 6px !important; align-items: flex-start !important; }

  .ff-footer-group { border-top: 1px solid var(--ff-line); }
  .ff-footer-group:last-of-type { border-bottom: 1px solid var(--ff-line); }
  .ff-footer-group > summary {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 0; cursor: pointer; user-select: none;
  }
  .ff-footer-group > summary .ff-eyebrow { margin: 0; font-size: 12px; }
  .ff-footer-group > summary .ff-footer-group-chevron {
    display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center;
    color: var(--ff-ink-3); font-size: 18px; font-weight: 300;
    transition: transform .3s ease;
  }
  .ff-footer-group[open] > summary .ff-footer-group-chevron { transform: rotate(45deg); color: var(--ff-accent-ink); }
  .ff-footer-group > .ff-footer-group-list { display: none !important; padding: 4px 0 20px; }
  .ff-footer-group[open] > .ff-footer-group-list { display: flex !important; }
  /* Override earlier grid collapse so each group is full-width */
  .ff-footer-grid { grid-template-columns: 1fr !important; gap: 0 !important; padding-bottom: 24px !important; }
  .ff-footer-grid > *:first-child { grid-column: 1 / -1; margin-bottom: 12px; }
}

  /* Company dl: shrink dt column */
  .ff-company-row { grid-template-columns: 96px 1fr !important; padding: 14px 0 !important; }

  /* CEO Message grid */
  .ff-ceo-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .ff-ceo-portrait { max-width: 220px; aspect-ratio: 3/4; }

  /* History: stack date above title */
  .ff-history { padding-left: 20px !important; gap: 28px !important; }
  .ff-history-row { grid-template-columns: 1fr !important; gap: 6px !important; }
  .ff-history-dot { left: -25px !important; top: 6px !important; width: 8px !important; height: 8px !important; }
  .ff-history-date { font-size: 11px !important; padding-top: 0 !important; }
  .ff-history-title { font-size: 15px !important; }

  /* Hero CTA buttons wrap */
  .ff-hero-cta { flex-wrap: wrap !important; gap: 8px !important; }
  .ff .ff-btn { padding: 11px 16px; font-size: 12px; }

  /* Ticker label keeps small */
  .ff-ticker-label { font-size: 10px !important; padding: 12px 12px !important; letter-spacing: 0.14em !important; }
  .ff-ticker-label-full  { display: none !important; }
  .ff-ticker-label-short { display: inline !important; }
}

/* Default: hide hamburger on desktop (use !important to beat .ff-hamburger-btn rule) */
.ff-nav-hamburger { display: none !important; }
/* Ticker label — desktop shows full, mobile shows short */
.ff-ticker-label-short { display: none; }
.ff-ticker-label-full  { display: inline; }
@media (max-width: 767px) {
  .ff-nav-hamburger { display: inline-flex !important; }
}

/* Mobile overlay menu */
.ff-mobile-menu {
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  width: 100vw; height: 100vh; height: 100dvh;
  z-index: 1000;
  background: #f4f1ea !important;
  display: flex; flex-direction: column;
  padding: 24px;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform .45s cubic-bezier(0.22,0.61,0.36,1), opacity .3s ease;
  pointer-events: none;
  overflow-y: auto;
}
.ff-mobile-menu.is-open {
  transform: translateY(0); opacity: 1; pointer-events: auto;
}
.ff-mobile-menu a { font-size: 24px; padding: 14px 0; border-bottom: 1px solid var(--ff-line-soft); color: var(--ff-ink); font-family: var(--ff-jp); }
.ff-mobile-menu a:last-child { border-bottom: none; }

.ff-hamburger-btn {
  width: 40px; height: 40px; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.ff-hamburger-btn span {
  display: block; width: 22px; height: 1.4px; background: var(--ff-ink); transition: transform .3s ease, opacity .2s ease;
}
.ff-hamburger-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ff-hamburger-btn.is-open span:nth-child(2) { opacity: 0; }
.ff-hamburger-btn.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
