/* ============================================================
   Patchy.ch — shared site styles
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-feature-settings: 'cv02','cv03','cv04','cv11'; -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body { font-family: 'Inter', system-ui, sans-serif; background: #f7f7f5; color: #1a1a1a; overflow-x: hidden; }
::selection { background: #1a1a1a; color: #f7f7f5; }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cacac8; border-radius: 2px; }

/* ── Focus visibility (a11y) ── */
:focus-visible { outline: 2px solid #6366f1; outline-offset: 3px; border-radius: 6px; }
.hero-bg :focus-visible, .drone-bg :focus-visible, .page-hero :focus-visible, footer :focus-visible { outline-color: #fff; }

/* ── Skip link ── */
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 600;
  background: #0c0c0c; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600; transform: translateY(-150%);
  transition: transform 0.25s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ── Custom cursor disabled ── */
.cursor-ring { display: none !important; }

/* ── Back to top ── */
#to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 350;
  width: 46px; height: 46px; border-radius: 14px; border: none; cursor: pointer;
  background: #0c0c0c; color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(16px) scale(0.9); pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  transition: opacity 0.4s cubic-bezier(0.22,1,0.36,1), transform 0.4s cubic-bezier(0.22,1,0.36,1), background 0.2s ease;
}
#to-top.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
#to-top:hover { background: #2c2c2c; transform: translateY(-3px) scale(1.04); }
#to-top:active { transform: translateY(0) scale(0.95); }

/* ── Curtain (page enter / leave transition) ── */
#curtain {
  position: fixed; inset: 0; background: #0c0c0c; z-index: 500; pointer-events: none;
  clip-path: inset(0 0 0 0); will-change: clip-path;
  transition: clip-path 0.72s cubic-bezier(0.76,0,0.24,1);
}
#curtain.gone { clip-path: inset(0 0 100% 0); }
#curtain.leaving { clip-path: inset(0 0 0 0); }

/* ── Progress ── */
#progress {
  position: fixed; top: 0; left: 0; height: 1.5px; width: 0%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  z-index: 300; pointer-events: none; transition: width 0.08s linear;
}

/* ── Nav ── */
#nav { transition: all 0.5s cubic-bezier(0.22,1,0.36,1); }
.nav-inner {
  border: 1px solid rgba(255,255,255,0.12); border-radius: 18px;
  background: rgba(10,10,10,0.78);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  position: relative; overflow: hidden;
  transition: background 0.5s ease, border-color 0.5s ease, backdrop-filter 0.5s ease, box-shadow 0.5s ease;
}
/* glossy top sheen on the nav glass */
.nav-inner::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
}
#nav.scrolled .nav-inner {
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.nav-link { position: relative; }
.nav-link::after {
  content: ''; position: absolute; bottom: -2px; left: 50%; right: 50%;
  height: 1px; background: white;
  transition: left 0.35s cubic-bezier(0.22,1,0.36,1), right 0.35s cubic-bezier(0.22,1,0.36,1);
}
.nav-link:hover::after, .nav-link.active::after { left: 0; right: 0; }
.nav-link.active { color: #fff; }
.lang-pill { transition: background 0.2s, color 0.2s; }
.lang-pill:hover { background: rgba(255,255,255,0.12); }
.lang-pill.active { background: #f7f7f5; color: #1a1a1a; }
#mobile-menu { display: none; }
#mobile-menu.open { display: flex; }

/* ── Shared dark background texture (hero, drone, page-hero) ── */
.hero-bg, .drone-bg, .page-hero { background: #0c0c0c; position: relative; }
.hero-bg::after, .drone-bg::before, .page-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
.hero-bg::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at var(--mx,50%) var(--my,40%), rgba(255,255,255,0.04) 0%, transparent 65%);
}
.drone-bg { overflow: hidden; }
.drone-bg::before { opacity: 0.04; }

/* ── Page hero (sub pages) ── */
.page-hero { overflow: hidden; padding: 150px 20px 84px; text-align: center; }
.page-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 12%, rgba(255,255,255,0.06) 0%, transparent 60%);
}
.page-hero .ph-inner { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; }

/* ── Clip-word reveal (hero) ── */
.clip-word { display: inline-block; overflow: hidden; vertical-align: bottom; }
.clip-inner {
  display: inline-block;
  transform: translateY(112%) skewY(5deg);
  will-change: transform;
  transition: transform 0.9s cubic-bezier(0.16,1,0.3,1);
}
.clip-inner.up { transform: translateY(0) skewY(0deg); }

/* ── Generic scroll reveal ── */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.75s cubic-bezier(0.16,1,0.3,1), transform 0.75s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── 3D scroll reveal ── */
.reveal-3d {
  opacity: 0; transform: perspective(1300px) rotateX(14deg) translateY(46px);
  transform-origin: center top; will-change: transform, opacity;
  transition: opacity 0.85s cubic-bezier(0.16,1,0.3,1), transform 0.95s cubic-bezier(0.16,1,0.3,1);
}
.reveal-3d.visible { opacity: 1; transform: perspective(1300px) rotateX(0deg) translateY(0); }

/* ── Horizontal line reveal ── */
.line-in {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1s cubic-bezier(0.16,1,0.3,1);
}
.line-in.visible { clip-path: inset(0 0% 0 0); }

/* ── Parallax helper ── */
.parallax { will-change: transform; }

/* ── Profile ── */
@keyframes profileFloat {
  0%,100% { transform: translateY(0) rotate(0deg); }
  40%      { transform: translateY(-9px) rotate(0.4deg); }
  70%      { transform: translateY(-4px) rotate(-0.3deg); }
}
.profile-float { animation: profileFloat 7s ease-in-out infinite; }
.hbadge {
  background: #fff; border-radius: 16px; box-shadow: 0 10px 44px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.9);
  width: 90px; height: 54px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
@media (max-width: 420px) {
  .hero-badges { gap: 14px; }
  .hbadge { width: 74px; height: 46px; }
  .hbadge-avatar { width: 124px; height: 124px; }
}

/* ── Scroll hint ── */
@keyframes nudge { 0%,100%{transform:translateY(0);opacity:.5} 55%{transform:translateY(7px);opacity:1} }
#scroll-hint { animation: nudge 2.2s ease-in-out infinite; opacity: 0; transition: opacity 1s ease; }

/* ── Buttons ── */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 7px; overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.35s cubic-bezier(0.22,1,0.36,1);
}
/* glossy diagonal sheen sweep on hover */
.btn::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,0.5) 50%, transparent 68%);
  transform: translateX(-130%); mix-blend-mode: overlay;
  transition: transform 0.65s cubic-bezier(0.22,1,0.36,1);
}
.btn:hover::before { transform: translateX(130%); }
.btn::after {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: rgba(255,255,255,0.09);
  transition: opacity 0.2s ease;
}
.btn:hover::after { opacity: 1; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.16); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }

/* ── Cards ── */
.card {
  position: relative; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 18px rgba(0,0,0,0.06);
  transition: transform 0.55s cubic-bezier(0.22,1,0.36,1), box-shadow 0.55s cubic-bezier(0.22,1,0.36,1);
  transform-style: preserve-3d; will-change: transform;
  text-decoration: none; color: inherit;
}
.card:hover { box-shadow: 0 8px 28px rgba(0,0,0,0.1), 0 32px 80px -16px rgba(0,0,0,0.16); }
/* Shimmer sweep */
.card .shimmer {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,0.13) 50%, transparent 75%);
  transform: translateX(-100%);
  transition: transform 0.65s cubic-bezier(0.22,1,0.36,1);
}
.card:hover .shimmer { transform: translateX(100%); }
/* Cursor-follow glossy highlight */
.card .card-gloss {
  position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0;
  background: radial-gradient(240px circle at var(--gx,50%) var(--gy,50%), rgba(255,255,255,0.5), transparent 60%);
  mix-blend-mode: soft-light; transition: opacity 0.35s ease;
}
.card:hover .card-gloss { opacity: 1; }
.featured-card .card-gloss { mix-blend-mode: screen; }
.featured-card .card-gloss { background: radial-gradient(280px circle at var(--gx,50%) var(--gy,50%), rgba(255,255,255,0.06), transparent 62%); }
/* Arrow on cards */
.card-arrow { transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), color 0.25s ease; }
.card:hover .card-arrow { transform: translate(3px, -3px); color: #1a1a1a !important; }
/* Top accent line that draws in on hover */
.card .accent-line {
  position: absolute; top: 0; left: 0; height: 2px; width: 100%;
  background: #1a1a1a; transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22,1,0.36,1); z-index: 3;
}
.card:hover .accent-line { transform: scaleX(1); }
/* Tech tags */
.tag {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  color: #636361; background: #f1f1ef; border: 1px solid #e2e2df;
  padding: 3px 9px; border-radius: 100px; white-space: nowrap;
}
.tag-dark {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  color: rgba(255,255,255,0.78); background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2); padding: 3px 10px; border-radius: 100px; white-space: nowrap;
}

/* ── Project logo panel (soft glossy gray so white & dark logos both read) ── */
.logo-panel {
  display: flex; align-items: center; justify-content: center;
  height: 96px; padding: 16px 26px; position: relative; z-index: 1; overflow: hidden;
  background: linear-gradient(160deg, #9c9c9a 0%, #848482 52%, #6f6f6d 100%);
  border-bottom: 1.5px solid #d8d8d5;
}
.logo-panel::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(125deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.05) 30%, transparent 55%);
}
.logo-panel img { max-height: 100%; max-width: 100%; object-fit: contain; position: relative; z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.18)); }

/* ── Featured card ── */
.featured-card {
  background: linear-gradient(145deg, #0d0d0d 0%, #1e1e1e 100%);
  border: 1px solid rgba(255,255,255,0.11);
  position: relative; overflow: hidden;
}
.featured-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
.featured-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,0.22), 0 32px 80px -16px rgba(0,0,0,0.38); }

/* ── Glossy top sheen for dark panels ── */
.gloss-top { position: relative; }
.gloss-top::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.03) 26%, transparent 52%);
}

/* ── Stat / glass cards ── */
.stat-card {
  background: linear-gradient(160deg, #f1f1f0, #e4e4e2); border: 1px solid #dededc; border-radius: 20px; padding: 28px 24px;
  position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.35s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.1); }
.stat-n { font-size: clamp(2.2rem,4.5vw,3.2rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }

/* ── Skills panel ── */
.skill-pill {
  font-size: 11px; color: rgba(255,255,255,0.78); font-weight: 500;
  padding: 6px 14px; border: 1px solid rgba(255,255,255,0.24); border-radius: 100px;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}
.skill-pill:hover { border-color: rgba(255,255,255,0.4); color: #fff; background: rgba(255,255,255,0.06); transform: translateY(-2px); }

/* ── Drone ── */
.orb {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  filter: blur(60px);
}
.orb-a { width: 560px; height: 560px; top: -180px; left: -120px; animation: driftA 20s ease-in-out infinite alternate; }
.orb-b { width: 420px; height: 420px; bottom: -80px; right: -60px; animation: driftB 15s ease-in-out infinite alternate; }
@keyframes driftA { to { transform: translate(180px, 120px); } }
@keyframes driftB { to { transform: translate(-120px, -80px); } }

/* ── Marquee ── */
.marquee-wrap { overflow: hidden; border-top: 1px solid rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05); padding: 18px 0; }
.marquee-track { display: flex; gap: 2.5rem; width: max-content; animation: marquee 28s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-item { font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255,255,255,0.38); white-space: nowrap; }
.marquee-dot { color: rgba(255,255,255,0.22); }

/* ── Outline button (dark sections) ── */
.btn-outline {
  border: 1px solid rgba(255,255,255,0.22); color: rgba(255,255,255,0.72);
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.35s cubic-bezier(0.22,1,0.36,1);
}
.btn-outline:hover { border-color: rgba(255,255,255,0.45); color: #fff; }

/* ── Contact form ── */
.field { margin-bottom: 4px; }
.field label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: #6b6b69; margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; background: #fff; border: 1.5px solid #e8e8e6; border-radius: 14px;
  padding: 15px 18px; font-size: 14px; font-family: inherit; color: #1a1a1a;
  outline: none; transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field input:focus, .field textarea:focus {
  border-color: #1a1a1a; box-shadow: 0 0 0 4px rgba(26,26,26,0.06);
}
.field textarea { resize: none; }
.submit-btn {
  width: 100%; background: #1a1a1a; color: #f7f7f5; border: none; padding: 17px 24px; border-radius: 14px;
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; position: relative; overflow: hidden;
  transition: background 0.2s, transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s cubic-bezier(0.22,1,0.36,1);
}
.submit-btn::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,0.4) 50%, transparent 68%);
  transform: translateX(-130%); transition: transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.submit-btn:hover::before { transform: translateX(130%); }
.submit-btn:hover { background: #2c2c2c; transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.2); }
.submit-btn:active { transform: translateY(0) scale(0.99); }

/* ── Social ── */
.social { transition: color 0.25s ease, transform 0.3s cubic-bezier(0.22,1,0.36,1); }
.social:hover { color: #f7f7f5 !important; transform: translateY(-3px); }
.social-dark {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 14px; color: #8a8a88;
  background: #fff; border: 1.5px solid #e2e2df;
  transition: color 0.25s ease, transform 0.3s cubic-bezier(0.22,1,0.36,1), border-color 0.25s ease, box-shadow 0.25s ease;
}
.social-dark:hover { color: #1a1a1a; transform: translateY(-3px); border-color: #1a1a1a; box-shadow: 0 8px 22px rgba(0,0,0,0.1); }

/* ── Footer ── */
footer { background: #0c0c0c; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .clip-inner { transform: none !important; }
  .reveal, .reveal-3d { opacity: 1 !important; transform: none !important; }
  .cursor-ring { display: none !important; }
  #curtain { display: none !important; }
}
/* Touch / coarse pointers: never use the custom cursor */
@media (hover: none), (pointer: coarse) {
  .cursor-ring { display: none !important; }
}
