/* ═══════════════════════════════════════════════════════════
   KSW COMMON STYLES
   Shared across all pages — colors, fonts, nav, footer,
   buttons, ambient effects, repair system, utilities
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --max: 1280px;
  --ink: #040b23;
  --ink-light: #0a1230;
  --ink-mid: #111a3e;
  --blue: #1e35fc;
  --yellow: #d4ff00;
  --cream: #f0f0f4;
  --muted: #9898c0;
  --orange: #d4ff00;
  --tape-bg: rgba(212,255,0,0.10);
  --tape-border: rgba(212,255,0,0.20);
  --punk-rotate-sm: 0.5deg;
  --punk-rotate-md: 1deg;
}

/* ── Font Faces ── */
@font-face {
  font-family: 'Workfolk';
  src: url('workfolk-400.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Workfolk';
  src: url('workfolk-700.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Emoji';
  src: url('NotoEmoji-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Base Typography ── */
body {
  background: var(--ink);
  color: var(--cream);
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  font-weight: 500;
  overflow-x: hidden;
  cursor: default;
  margin: 0;
  padding: 0;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Workfolk', sans-serif;
}

p, li, td {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}

a { cursor: pointer; }
button { cursor: pointer; }

/* ── Ambient Effects — Site-Wide Grid + Blobs ── */
.site-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(30,53,252,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,53,252,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-drift 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.ink-splat {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}
.ink-splat-1 {
  width: 450px; height: 450px;
  background: var(--blue);
  top: 10%; left: -5%;
  opacity: 0.25;
  animation: blob1 9s ease-in-out infinite;
}
.ink-splat-2 {
  width: 280px; height: 280px;
  background: var(--yellow);
  bottom: 15%; left: 25%;
  opacity: 0.18;
  animation: blob2 12s ease-in-out infinite;
}
.ink-splat-3 {
  width: 200px; height: 200px;
  background: var(--blue);
  top: 55%; left: 10%;
  opacity: 0.15;
  animation: blob1 15s ease-in-out infinite reverse;
}

@keyframes grid-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 40px 40px; }
}
@keyframes blob1 {
  0%,100% { transform: scale(1) translate(0,0); }
  33%      { transform: scale(1.12) translate(-20px, 15px); }
  66%      { transform: scale(0.92) translate(15px, -10px); }
}
@keyframes blob2 {
  0%,100% { transform: scale(1) translate(0,0); }
  50%     { transform: scale(1.18) translate(-12px, 18px); }
}

/* ── Broken-to-Functional State ── */
.diy-static-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.12;
  transition: opacity 0.3s ease;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  mix-blend-mode: overlay;
}

body.page-broken .site-grid {
  animation: grid-drift 8s linear infinite, grid-jitter 0.15s steps(2) infinite;
}
@keyframes grid-jitter {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(1px); }
  100% { transform: translateX(-1px); }
}

/* ── Repair System ── */
.service-card,
.process-step,
.sidebar-card,
.ig-card {
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s, opacity 0.8s ease;
}
.service-card.repaired,
.process-step.repaired,
.sidebar-card.repaired,
.ig-card.repaired {
  transform: rotate(0deg) translateY(0) !important;
  opacity: 1 !important;
}

.stat-block {
  transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.8s ease;
}

/* Override for fade-up elements that are also repair targets */
.service-card.fade-up,
.process-step.fade-up,
.sidebar-card.fade-up,
.ig-card.fade-up {
  opacity: 0;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease;
}

/* ── Tape Strips ── */
.tape-strip {
  position: absolute;
  top: -7px;
  height: 14px;
  background: var(--tape-bg);
  border: 1px solid var(--tape-border);
  z-index: 10;
  pointer-events: none;
  background-image: repeating-linear-gradient(90deg, transparent, transparent 6px, rgba(212,255,0,0.03) 6px, rgba(212,255,0,0.03) 7px);
  transform: scaleX(0);
}
.tape-strip.from-left { transform-origin: left center; }
.tape-strip.from-right { transform-origin: right center; }

.diy-tape { position: relative; }
.diy-tape::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(-2.5deg);
  width: 90px;
  height: 18px;
  background: var(--tape-bg);
  border: 1px solid var(--tape-border);
  z-index: 10;
  pointer-events: none;
  background-image: repeating-linear-gradient(90deg, transparent, transparent 8px, rgba(212,255,0,0.03) 8px, rgba(212,255,0,0.03) 9px);
}

/* ── Buttons — Primary (blue + yellow offset) ── */
.btn-primary {
  font-family: 'Workfolk', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 0.7rem 2rem;
  cursor: default;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  position: relative;
}
.btn-primary::after {
  content: '';
  position: absolute;
  bottom: -4px; right: -4px;
  width: 100%; height: 100%;
  border: 2px solid var(--yellow);
  transition: transform 0.15s;
  pointer-events: none;
}
.btn-primary:hover {
  background: var(--yellow);
  color: var(--ink);
  transform: translate(-2px, -2px);
}
.btn-primary:hover::after { transform: translate(2px, 2px); }

/* ── Buttons — Ghost (underline) ── */
.btn-ghost {
  font-family: 'Workfolk', monospace;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid var(--muted);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { color: var(--yellow); border-color: var(--yellow); }

/* ── Buttons — Submit (box-shadow variant for inputs) ── */
button[type="submit"], .submit-btn {
  background: var(--blue);
  color: #fff;
  font-family: 'Workfolk', sans-serif;
  border: none;
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--yellow);
  transition: transform 0.15s, box-shadow 0.15s;
}
button[type="submit"]:hover, .submit-btn:hover {
  background: var(--yellow);
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--blue);
}

/* ── Nav — Shared Base ── */
.nav-logo img {
  transition: filter 0.2s ease, transform 0.2s ease;
}
.nav-logo:hover img {
  filter: brightness(0) saturate(100%) invert(94%) sepia(57%) saturate(800%) hue-rotate(20deg) brightness(1.05);
  animation: logo-glitch 0.35s steps(1) forwards;
}
@keyframes logo-glitch {
  0%   { transform: translateX(0) skewX(0); }
  20%  { transform: translateX(-3px) skewX(-3deg); }
  40%  { transform: translateX(3px) skewX(2deg); }
  60%  { transform: translateX(-2px) skewX(0); }
  100% { transform: translateX(0) skewX(0); }
}

/* ── Footer — 3-Column Layout ── */
.footer-wrap {
  background: #141432;
  border-top: 2px solid rgba(212,255,0,0.1);
}

footer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem 3rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2.5rem;
  align-items: start;
}

.footer-logo {
  font-family: 'Workfolk', sans-serif;
  font-size: 1.8rem;
  color: var(--yellow);
  letter-spacing: 0.05em;
}
.footer-logo span { color: var(--muted); }

.footer-tagline {
  font-family: 'Workfolk', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.3rem;
}

.footer-social { margin-top: 1rem; }
.footer-social a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-social a:hover { color: var(--yellow); }
.footer-social svg { width: 22px; height: 22px; }

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-links a {
  font-family: 'Workfolk', monospace;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--yellow); }

.footer-contact { text-align: right; }
.footer-contact p {
  font-family: 'Workfolk', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.7;
}
.footer-contact a {
  font-family: 'Workfolk', sans-serif;
  font-size: 1.1rem;
  color: var(--yellow);
  text-decoration: none;
  display: block;
  letter-spacing: 0.04em;
  transition: color 0.2s;
  margin: 0.15rem 0;
}
.footer-contact a:hover { color: var(--orange); }
.footer-contact .footer-hours {
  font-size: 0.75rem;
  margin-top: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.footer-bottom {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 3rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom p {
  font-family: 'Workfolk', monospace;
  font-size: 0.75rem;
  color: rgba(122,117,103,0.45);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Section Layout ── */
.section {
  padding: 3.5rem 2rem;
}
.section > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.section-label {
  font-family: 'Workfolk', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transform: rotate(-0.3deg);
  text-align: center;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 1.5rem;
  height: 2px;
  background: var(--orange);
}

.section-title {
  font-family: 'Workfolk', sans-serif;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 0.9;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ── Utilities ── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -100%; left: 50%; transform: translateX(-50%);
  background: var(--yellow); color: var(--ink); padding: 0.5rem 1.5rem;
  font-family: 'Workfolk', monospace; font-size: 0.75rem; letter-spacing: 0.1em;
  text-decoration: none; z-index: 9999; border-radius: 0 0 6px 6px;
}
.skip-link:focus { top: 0; }

/* ── Ticker ── */
.ticker {
  background: var(--yellow);
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  padding: 0 0;
  border-top: 2px solid rgba(4,4,15,0.2);
  border-bottom: 2px solid rgba(4,4,15,0.2);
}
.ticker-inner {
  display: inline-flex;
  align-items: center;
  animation: scroll 80s linear infinite;
}
.ticker-item {
  font-family: 'Workfolk', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  padding: 0 2rem;
}
.ticker-dot {
  color: #04040f;
  opacity: 0.35;
  padding: 0 0.3rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Responsive — Mobile ── */
@media (max-width: 768px) {
  .section { padding: 2.5rem 1.5rem; }
  footer { grid-template-columns: 1fr; text-align: center; gap: 2rem; padding: 2rem 1.5rem 1rem; }
  .footer-contact { text-align: center; }
  .footer-social { display: flex; justify-content: center; }
  .footer-bottom { flex-direction: column; gap: 0.3rem; text-align: center; padding: 1rem 1.5rem; }
}
