/*
Theme Name:        IMPACT 2026
Theme URI:         https://impact.ne.jp/
Author:            IMPACT Inc.
Author URI:        https://impact.ne.jp/
Description:       Original theme for IMPACT Inc. — a tech-feel design with Three.js particle galaxy hero, AI-generated tagline, and Contact Form 7 integration.
Version:           1.5.0
Requires at least: 6.0
Tested up to:      6.5
Requires PHP:      7.4
License:           GPL v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       impact-2026
Tags:              dark, custom-colors, custom-menu, threaded-comments, translation-ready
*/

:root {
    --bg: #0a0a0f;
    --bg-2: #12121a;
    --fg: #f5f5f7;
    --muted: #6b6b7a;
    --accent: #B82C2F;
    --accent-2: #D14548;
    --line: rgba(255,255,255,0.08);
  }
  * { margin:0; padding:0; box-sizing:border-box; }
  html, body { background: var(--bg); color: var(--fg); font-family: 'Noto Sans JP', sans-serif; overflow-x:hidden; }
  html { scroll-behavior: smooth; }
  /* Avoid sections being hidden under the fixed header when scrolled to via anchor */
  section[id], div[id], main[id] { scroll-margin-top: 80px; }
  body { cursor: none; }

  /* Custom cursor */
  .cursor {
    position: fixed; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); pointer-events: none; z-index: 9999;
    mix-blend-mode: difference; transition: transform 0.15s ease;
    transform: translate(-50%, -50%);
  }
  .cursor-ring {
    position: fixed; width: 40px; height: 40px; border: 1px solid var(--accent);
    border-radius: 50%; pointer-events: none; z-index: 9998;
    transition: transform 0.4s cubic-bezier(.16,1,.3,1), width 0.3s, height 0.3s;
    transform: translate(-50%, -50%);
  }

  /* Three.js canvas */
  #bg-canvas {
    position: fixed; top:0; left:0; width:100vw; height:100vh; z-index:0;
  }

  /* Grain overlay */
  .grain {
    position: fixed; inset:0; pointer-events:none; z-index: 5;
    opacity: 0.06; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  /* Header */
  header {
    position: fixed; top:0; left:0; right:0; z-index: 100;
    padding: 24px 48px; display:flex; justify-content:space-between; align-items:center;
    backdrop-filter: blur(8px); background: rgba(10,10,15,0.4);
    border-bottom: 1px solid var(--line);
  }
  .logo {
    display: flex; align-items: center; gap: 10px;
  }
  .logo-mark {
    width: 26px; height: 31px;
    background-size: contain; background-repeat: no-repeat; background-position: center;
    flex-shrink: 0;
  }
  .logo-text {
    font-family: 'Syncopate', sans-serif; font-weight:700; font-size: 18px;
    letter-spacing: 0.15em;
  }
  .logo-text .dot { color: var(--accent); }
  nav ul { list-style:none; display:flex; gap: 36px; }
  nav a {
    color: var(--fg); text-decoration:none; font-size: 12px;
    font-family: 'JetBrains Mono', monospace; letter-spacing: 0.1em;
    text-transform: uppercase; position: relative; transition: color 0.3s;
  }
  nav a::before {
    content: '> '; color: var(--accent); opacity: 0;
    transition: opacity 0.3s; margin-right: 4px;
  }
  nav a:hover { color: var(--accent); }
  nav a:hover::before { opacity: 1; }
  .header-meta {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--muted); letter-spacing: 0.05em;
  }
  .header-meta .dot {
    display:inline-block; width:6px; height:6px; border-radius:50%;
    background: var(--accent); margin-right: 6px;
    animation: pulse 2s infinite;
  }
  @keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

  /* Hero */
  .hero {
    position: relative; height: 100vh; display:flex; align-items:center;
    padding: 0 48px; z-index: 10;
    background: transparent !important;
  }
  .hero-content { max-width: 1200px; }
  .hero-tag {
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    color: var(--accent); letter-spacing: 0.2em; margin-bottom: 32px;
    display: flex; align-items: center; gap: 12px;
    opacity: 0; animation: fadeUp 0.8s 0.3s forwards;
  }
  .hero-tag::before {
    content:''; width: 40px; height:1px; background: var(--accent);
  }
  .hero h1 {
    font-family: 'Syncopate', sans-serif; font-weight: 700;
    font-size: clamp(48px, 9vw, 140px); line-height: 0.95;
    letter-spacing: -0.02em; margin-bottom: 24px;
  }
  .hero h1 .line {
    display: block; overflow: hidden;
  }
  .hero h1 .line span {
    display: inline-block; opacity: 0; transform: translateY(100%);
    animation: lineUp 1s cubic-bezier(.16,1,.3,1) forwards;
  }
  .hero h1 .line:nth-child(1) span { animation-delay: 0.5s; }
  .hero h1 .line:nth-child(2) span { animation-delay: 0.7s; }
  .hero h1 .line:nth-child(3) span { animation-delay: 0.9s; }
  .hero h1 .accent { color: var(--accent); font-style: italic; font-family: 'Noto Sans JP', sans-serif; font-weight: 300; }
  @keyframes lineUp { to { opacity:1; transform: translateY(0); } }
  @keyframes fadeUp { to { opacity:1; transform: translateY(0); } }

  .hero-sub {
    font-size: 16px; color: var(--muted); max-width: 480px; line-height: 1.8;
    opacity: 0; animation: fadeUp 0.8s 1.2s forwards;
    transform: translateY(20px);
  }
  .hero-sub strong { color: var(--fg); font-weight: 500; }

  .hero-meta {
    position: absolute; bottom: 48px; left: 48px; right: 48px;
    display: flex; justify-content: space-between; align-items: flex-end;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--muted); letter-spacing: 0.05em;
  }
  .scroll-hint {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    animation: fadeUp 1s 2s forwards; opacity: 0;
  }
  .scroll-line {
    width: 1px; height: 40px; background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s infinite;
  }
  @keyframes scrollPulse {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
  }

  .hero-data {
    text-align: right; line-height: 1.8;
    animation: fadeUp 1s 2s forwards; opacity: 0;
  }
  .hero-data .key { color: var(--accent); }

  /* AI live message */
  .ai-message {
    margin-top: 48px; max-width: 600px;
    border: 1px solid var(--line); padding: 20px 24px;
    background: rgba(20, 20, 28, 0.6); backdrop-filter: blur(8px);
    font-family: 'JetBrains Mono', monospace;
    opacity: 0; animation: fadeUp 0.8s 1.6s forwards;
    transform: translateY(20px);
    position: relative; overflow: hidden;
  }
  .ai-message::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: aiScan 3s ease-in-out infinite;
  }
  @keyframes aiScan {
    0%, 100% { transform: translateX(-100%); opacity: 0; }
    50% { transform: translateX(100%); opacity: 1; }
  }
  .ai-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; font-size: 10px; letter-spacing: 0.15em;
    color: var(--muted); text-transform: uppercase;
    flex-wrap: wrap; gap: 8px;
  }
  .ai-status { color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
  .ai-status-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); animation: aiPulse 1.2s infinite;
  }
  @keyframes aiPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
  }
  .ai-prompt {
    font-size: 11px; color: var(--muted); margin-bottom: 8px;
  }
  .ai-output {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 15px; color: var(--fg); line-height: 1.7;
    min-height: 28px; font-weight: 400;
  }
  .ai-cursor {
    display: inline-block; color: var(--accent);
    animation: blink 0.8s steps(2) infinite;
    margin-left: 2px;
  }
  @keyframes blink { 50% { opacity: 0; } }

  /* Sections */
  section {
    position: relative; z-index: 10; padding: 160px 48px;
    background: var(--bg);
  }
  .section-num {
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    color: var(--accent); letter-spacing: 0.2em; margin-bottom: 16px;
  }
  .section-title {
    font-family: 'Syncopate', sans-serif; font-weight:700;
    font-size: clamp(40px, 6vw, 80px); line-height: 1; letter-spacing: -0.02em;
    margin-bottom: 80px;
  }
  .section-title .ja {
    display: block; font-family: 'Noto Sans JP', sans-serif; font-weight: 300;
    font-size: 14px; color: var(--muted); letter-spacing: 0.3em;
    margin-top: 16px;
  }

  /* Services */
  .services-grid {
    max-width: 1400px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
    background: var(--line); border: 1px solid var(--line);
  }
  @media (max-width: 1024px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
  }
  .service-card {
    background: var(--bg); padding: 56px 48px; position: relative;
    transition: background 0.4s, transform 0.6s cubic-bezier(.16,1,.3,1), opacity 0.6s cubic-bezier(.16,1,.3,1);
    cursor: pointer;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Initial state: hidden, will be revealed by JS */
    opacity: 0;
    transform: translateY(40px);
  }
  .service-card.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
  /* Left accent bar that grows on hover */
  .service-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.5s cubic-bezier(.16,1,.3,1);
  }
  .service-card:hover::before {
    transform: scaleY(1);
    transform-origin: top;
  }
  /* Subtle background glow on hover */
  .service-card::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    background: radial-gradient(circle at 30% 0%, rgba(184, 44, 47, 0.08), transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
  }
  .service-card:hover::after { opacity: 1; }
  .service-card:hover { background: var(--bg-2); }
  .service-card:hover .service-num { color: var(--accent); }
  .service-card:hover h3 { transform: translateX(4px); }
  .service-num {
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    color: var(--muted); letter-spacing: 0.2em; transition: color 0.3s;
    position: relative; z-index: 1;
  }
  .service-card h3 {
    font-family: 'Syncopate', sans-serif; font-weight: 700; font-size: 32px;
    letter-spacing: -0.01em; margin-top: 16px;
    transition: transform 0.4s cubic-bezier(.16,1,.3,1);
    position: relative; z-index: 1;
  }
  .service-card .ja-label {
    font-size: 12px; color: var(--muted); margin-top: 8px; letter-spacing: 0.1em;
    position: relative; z-index: 1;
  }
  .service-card p {
    font-size: 14px; color: var(--muted); line-height: 1.8; margin-top: 24px;
    position: relative; z-index: 1;
  }

  /* Stats */
  .stats {
    max-width: 1400px; margin: 0 auto; padding: 0;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 48px;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    padding: 80px 0;
  }
  .stat { text-align: center; }
  .stat-num {
    font-family: 'Syncopate', sans-serif; font-weight: 700;
    font-size: 64px; color: var(--accent); line-height: 1;
    transition: transform 0.6s cubic-bezier(.16,1,.3,1);
    display: inline-block;
  }
  .stat-num.is-counted {
    /* Tiny "settle" pulse when count finishes */
    animation: statSettle 0.6s cubic-bezier(.16,1,.3,1);
  }
  @keyframes statSettle {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.08); }
    100% { transform: scale(1); }
  }
  .stat-label {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--muted); letter-spacing: 0.2em; margin-top: 12px; text-transform: uppercase;
  }

  /* About */
  .about-wrap {
    max-width: 1400px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start;
  }
  .about-text p {
    font-size: 16px; line-height: 2; color: var(--muted); margin-bottom: 24px;
  }
  .about-text p strong { color: var(--fg); font-weight: 500; }
  .about-info {
    border: 1px solid var(--line); padding: 40px;
    font-family: 'JetBrains Mono', monospace; font-size: 13px;
  }
  .about-info dl { display: grid; grid-template-columns: 120px 1fr; gap: 20px 24px; }
  .about-info dt { color: var(--accent); letter-spacing: 0.05em; }
  .about-info dd { color: var(--fg); line-height: 1.6; }

  /* Contact */
  .contact-wrap {
    max-width: 1000px; margin: 0 auto; text-align: center;
  }
  .contact-wrap .section-title { margin-bottom: 48px; }
  .contact-mail {
    font-family: 'Syncopate', sans-serif; font-weight: 700;
    font-size: clamp(32px, 5vw, 64px); color: var(--fg);
    text-decoration: none; display: inline-block; position: relative;
    transition: color 0.3s; padding-bottom: 8px;
  }
  .contact-mail::after {
    content:''; position: absolute; left:0; bottom:0; width:100%; height:2px;
    background: var(--accent); transform: scaleX(0); transform-origin: right;
    transition: transform 0.6s cubic-bezier(.16,1,.3,1);
  }
  .contact-mail:hover { color: var(--accent); }
  .contact-mail:hover::after { transform: scaleX(1); transform-origin: left; }
  .contact-info {
    margin-top: 32px; display: flex; justify-content: center; gap: 64px;
    font-family: 'JetBrains Mono', monospace; font-size: 13px;
    flex-wrap: wrap;
  }
  .contact-info div span:first-child { color: var(--accent); display: block; margin-bottom: 8px; }
  .contact-info div span:last-child { color: var(--fg); }

  /* Contact form (CF7-ready styles) */
  .contact-lead {
    text-align: center; margin-bottom: 56px;
    font-size: 15px; color: var(--muted); line-height: 1.9;
  }
  .contact-lead-en {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--accent); letter-spacing: 0.15em; text-transform: uppercase;
  }
  .cf7-style {
    max-width: 760px; margin: 0 auto 80px;
    text-align: left;
    background: rgba(18,18,26,0.55);
    border: 1px solid var(--line);
    backdrop-filter: blur(10px);
    padding: 48px;
    position: relative;
  }
  .cf7-style::before {
    content: ''; position: absolute; top: -1px; left: -1px; right: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
  }
  .cf7-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
    margin-bottom: 24px;
  }
  .cf7-style label,
  .cf7-style .cf7-full {
    display: block; margin-bottom: 24px;
  }
  .cf7-label {
    display: block;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--muted); letter-spacing: 0.15em; text-transform: uppercase;
    margin-bottom: 10px;
  }
  .cf7-label em {
    color: var(--accent); font-style: normal; margin-left: 4px;
  }
  .cf7-style input,
  .cf7-style select,
  .cf7-style textarea {
    width: 100%;
    background: rgba(10,10,15,0.6);
    border: 1px solid var(--line);
    color: var(--fg);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 15px;
    padding: 14px 16px;
    transition: border-color 0.3s, background 0.3s;
    outline: none;
  }
  .cf7-style input:focus,
  .cf7-style select:focus,
  .cf7-style textarea:focus {
    border-color: var(--accent);
    background: rgba(10,10,15,0.85);
  }
  .cf7-style input::placeholder,
  .cf7-style textarea::placeholder {
    color: rgba(245,245,247,0.25);
  }
  .cf7-style select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                      linear-gradient(135deg, var(--accent) 50%, transparent 50%);
    background-position: calc(100% - 22px) center, calc(100% - 16px) center;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 40px;
    cursor: pointer;
  }
  .cf7-style select option {
    background: var(--bg); color: var(--fg);
  }
  .cf7-style textarea {
    resize: vertical; min-height: 140px; font-family: 'Noto Sans JP', sans-serif;
  }
  .cf7-submit-wrap {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 32px; gap: 24px; flex-wrap: wrap;
  }
  .cf7-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 18px 40px;
    font-family: 'Syncopate', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.15em;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 12px;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
    position: relative;
  }
  .cf7-submit:hover {
    background: var(--accent-2);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(184, 44, 47, 0.4);
  }
  .cf7-submit .cf7-arrow {
    transition: transform 0.3s;
  }
  .cf7-submit:hover .cf7-arrow {
    transform: translateX(6px);
  }
  .cf7-privacy {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--muted); letter-spacing: 0.05em;
  }
  .cf7-privacy a { color: var(--accent); text-decoration: none; }
  .cf7-privacy a:hover { text-decoration: underline; }

  /* Contact Form 7 default class overrides — applied when CF7 shortcode is rendered */
  .wpcf7 form.invalid .wpcf7-response-output,
  .wpcf7 form.unaccepted .wpcf7-response-output {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
  }
  .wpcf7-not-valid-tip {
    color: var(--accent) !important;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .wpcf7-spinner {
    background: var(--accent) !important;
  }

  /* Footer */
  footer {
    position: relative; z-index: 10; padding: 48px;
    border-top: 1px solid var(--line); background: var(--bg);
    display: flex; justify-content: space-between; align-items: center;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--muted); letter-spacing: 0.05em;
  }

  /* Marquee */
  .marquee {
    overflow: hidden; padding: 32px 0; border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line); position: relative; z-index: 10;
    background: var(--bg);
  }
  .marquee-track {
    display: flex; gap: 64px; animation: marquee 30s linear infinite;
    white-space: nowrap; font-family: 'Syncopate', sans-serif; font-weight: 700;
    font-size: 48px; letter-spacing: 0.05em;
  }
  .marquee-track span { color: var(--fg); }
  .marquee-track span.alt {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    letter-spacing: -0.05em;
    opacity: 0.85;
  }
  @keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }

  @media (max-width: 768px) {
    body { cursor: auto; }
    .cursor, .cursor-ring { display: none; }

    /* Header: hide desktop nav, show hamburger */
    header {
      padding: 14px 20px;
    }
    .logo-text { font-size: 16px; letter-spacing: 0.1em; }
    .logo-mark { width: 22px; height: 26px; }
    .header-meta { display: none; }

    /* Hide regular nav, show hamburger button */
    header nav { display: none; }
    .menu-toggle {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      width: 28px;
      height: 18px;
      background: transparent;
      border: none;
      cursor: pointer;
      padding: 0;
      z-index: 200;
    }
    .menu-toggle span {
      display: block;
      width: 100%;
      height: 1.5px;
      background: var(--fg);
      transition: transform 0.3s, opacity 0.3s;
    }
    .menu-toggle.is-open span:nth-child(1) {
      transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.is-open span:nth-child(2) {
      opacity: 0;
    }
    .menu-toggle.is-open span:nth-child(3) {
      transform: translateY(-8px) rotate(-45deg);
    }

    /* Mobile menu overlay */
    .mobile-menu {
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(10,10,15,0.97);
      backdrop-filter: blur(20px);
      z-index: 150;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 32px;
      transform: translateY(-100%);
      transition: transform 0.5s cubic-bezier(.16,1,.3,1);
      pointer-events: none;
    }
    .mobile-menu.is-open {
      transform: translateY(0);
      pointer-events: auto;
    }
    .mobile-menu ul {
      list-style: none;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 32px;
      text-align: center;
    }
    .mobile-menu a {
      font-family: 'Syncopate', sans-serif;
      font-weight: 700;
      font-size: 24px;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--fg);
      text-decoration: none;
      transition: color 0.3s;
    }
    .mobile-menu a:hover, .mobile-menu a:active { color: var(--accent); }
    .mobile-menu .menu-meta {
      position: absolute;
      bottom: 40px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      color: var(--muted);
      letter-spacing: 0.15em;
    }
    body.menu-open { overflow: hidden; }

    /* Hero */
    .hero {
      height: auto !important;
      min-height: 100vh;
      flex-direction: column !important;
      align-items: flex-start !important;
      justify-content: flex-start !important;
      padding-top: 100px;
      padding-bottom: 60px;
    }
    .hero, section { padding-left: 20px; padding-right: 20px; }
    .hero-content {
      width: 100%;
      max-width: 100%;
    }
    .hero h1 {
      font-size: clamp(40px, 11vw, 64px);
      word-break: break-word;
      overflow-wrap: anywhere;
    }
    /* Keep "web力" together as one unit (don't break between web and 力) */
    .hero h1 .accent {
      display: inline-block;
      white-space: nowrap;
    }
    .hero-tag {
      font-size: 11px;
      letter-spacing: 0.15em;
    }
    .hero-sub { font-size: 14px; max-width: 100%; }

    /* Hide the scroll hint on mobile (it overlaps with the AI message box) */
    .scroll-hint { display: none !important; }

    .hero-meta {
      position: static !important;
      left: auto; right: auto; bottom: auto;
      width: 100%;
      margin-top: 32px;
      flex-direction: column; gap: 16px; align-items: flex-start;
      padding: 0;
    }
    .hero-data {
      font-size: 10px;
      text-align: left !important;
      line-height: 1.8;
    }
    .hero-data div {
      display: block;
    }

    /* AI message: contain within viewport */
    .ai-message {
      margin-top: 32px;
      padding: 16px 18px;
      max-width: 100%;
      width: 100%;
      box-sizing: border-box;
      overflow: hidden;
    }
    .ai-output {
      font-size: 14px;
      word-break: break-word;
      overflow-wrap: anywhere;
    }
    .ai-header {
      font-size: 9px;
      flex-wrap: wrap;
      gap: 4px 12px;
    }
    .ai-header .ai-meta {
      /* The "REAL-TIME · POWERED BY ANTHROPIC API" line — too long on mobile */
      font-size: 8px;
    }
    .ai-prompt {
      font-size: 10px;
      word-break: break-word;
    }

    /* Services and stats */
    .services-grid { grid-template-columns: 1fr; }
    .service-card { padding: 40px 28px; min-height: 240px; }
    .service-card h3 { font-size: 26px; }

    .stats {
      grid-template-columns: repeat(2, 1fr);
      gap: 36px 16px;
      padding: 48px 0;
    }
    .stat-num { font-size: 44px; }
    .stat-label { font-size: 10px; }

    /* About */
    .about-wrap { grid-template-columns: 1fr; gap: 40px; }
    .about-info { padding: 28px 20px; }
    .about-info dl { grid-template-columns: 90px 1fr; gap: 14px 16px; font-size: 12px; }
    .about-info dt { font-size: 10px; }
    /* Override iOS auto-link blue for tel: */
    .about-info a[href^="tel:"], .contact-info a[href^="tel:"], .inner-wrap a[href^="tel:"] {
      color: var(--fg) !important;
      text-decoration: none !important;
    }

    /* Section title */
    .section-title { font-size: clamp(36px, 9vw, 56px); margin-bottom: 56px; }

    /* Contact form */
    .contact-info { flex-direction: column; gap: 24px; align-items: center; }
    .cf7-style { padding: 28px 20px; }
    .cf7-row { grid-template-columns: 1fr; gap: 0; }
    .cf7-submit-wrap { flex-direction: column; align-items: stretch; }
    .cf7-submit { width: 100%; justify-content: center; }
    .cf7-privacy { text-align: center; }

    /* General section padding */
    section { padding-top: 80px; padding-bottom: 80px; }

    /* Marquee */
    .marquee-track { font-size: 28px; gap: 36px; }

    /* Footer */
    footer { flex-direction: column; gap: 12px; text-align: center; padding: 32px 20px; font-size: 10px; }
  }

  /* Hide hamburger on desktop */
  @media (min-width: 769px) {
    .menu-toggle { display: none; }
    .mobile-menu { display: none; }
  }

/* ============================================================
   Inner pages (page.php / single.php) — for non-front content
   ============================================================ */
.inner-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 160px 32px 100px;
  position: relative;
  z-index: 10;
  background: var(--bg);
  min-height: 60vh;
}
.inner-wrap .post-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.inner-wrap .post-title {
  font-family: 'Syncopate', sans-serif;
  font-weight: 700;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 56px;
  color: var(--fg);
}
.inner-wrap .post-content {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  line-height: 1.95;
  color: var(--fg);
}
.inner-wrap .post-content h2 {
  font-family: 'Syncopate', sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 56px 0 20px;
  color: var(--fg);
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.inner-wrap .post-content h3 {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin: 36px 0 14px;
  color: var(--accent);
}
.inner-wrap .post-content p { margin-bottom: 20px; }
.inner-wrap .post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.inner-wrap .post-content a:hover { color: var(--accent-2); }
.inner-wrap .post-content ul,
.inner-wrap .post-content ol { margin: 0 0 20px 24px; }
.inner-wrap .post-content li { margin-bottom: 8px; }
.inner-wrap .post-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 8px 0 8px 24px;
  margin: 24px 0;
  color: var(--muted);
  font-style: italic;
}
.inner-wrap .post-content img {
  max-width: 100%;
  height: auto;
  margin: 24px 0;
}
.inner-wrap .post-content pre {
  background: var(--bg-2);
  padding: 20px;
  border: 1px solid var(--line);
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  margin: 24px 0;
}
.inner-wrap .post-content code {
  background: var(--bg-2);
  padding: 2px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  color: var(--accent);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 60px;
  color: var(--muted);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.3s, transform 0.3s;
}
.back-link:hover {
  color: var(--accent);
  transform: translateX(-4px);
}

/* 404 page */
.error-404 .inner-wrap {
  text-align: center;
}
.error-404 .post-title {
  font-size: clamp(80px, 16vw, 200px);
  color: var(--accent);
}

/* Search results / archive */
.archive-list {
  list-style: none;
  padding: 0;
}
.archive-list li {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.archive-list a {
  display: block;
  text-decoration: none;
  color: var(--fg);
  transition: color 0.3s;
}
.archive-list a:hover { color: var(--accent); }
.archive-list .item-title {
  font-family: 'Syncopate', sans-serif;
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 8px;
}
.archive-list .item-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.archive-list .item-excerpt {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

/* Pagination */
.pagination-wrap {
  margin-top: 60px;
  display: flex;
  gap: 16px;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
}
.pagination-wrap a, .pagination-wrap span {
  padding: 10px 16px;
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  transition: border-color 0.3s, color 0.3s;
}
.pagination-wrap a:hover { border-color: var(--accent); color: var(--accent); }
.pagination-wrap .current {
  border-color: var(--accent);
  color: var(--accent);
}
