/*
Theme Name: Kwintex Custom Theme
Theme URI: https://kwintex.ee
Author: Kwintex
Description: Custom brutalist theme for Kwintex.
Version: 1.2
*/

:root {
  --ink: #0d0d0d;
  --paper: #f0ebe3;
  --rust: #b84c1e;
  --rust-light: #d4622a;
  --khaki: #8a7a5e;
  --warm-gray: #c8bfb0;
  --thread: #e8dfd0;
  --white: #faf8f4;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: 'DM Mono', monospace;
  overflow-x: hidden;
  cursor: none;
}

/* Custom cursor */
.cursor {
  position: fixed;
  width: 12px; height: 12px;
  background: var(--rust);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
  mix-blend-mode: difference;
}
.cursor-ring {
  position: fixed;
  width: 36px; height: 36px;
  border: 1px solid var(--rust);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: all 0.12s ease-out;
  opacity: 0.6;
}
body:hover .cursor { opacity: 1; }

/* Noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 100;
  opacity: 0.35;
}

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  mix-blend-mode: difference;
}
.nav-logo { font-family: 'Bebas Neue', sans-serif; font-size: 28px; letter-spacing: 0.12em; color: var(--white); opacity: 0; }
.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a { font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--warm-gray); text-decoration: none; transition: color 0.2s; opacity: 0; }
.nav-links a:hover { color: var(--rust); }

.nav-right { display: flex; align-items: center; gap: 24px; }

/* Language switcher — works for Polylang <ul>, WPML <a>, and fallback <a> */
.nav-lang { display: flex; align-items: center; gap: 10px; }
/* Polylang outputs a <ul> — strip browser defaults and make it flex */
.nav-lang > ul { display: flex; align-items: center; gap: 10px; list-style: none; margin: 0; padding: 0; }
.nav-lang > ul li { margin: 0; padding: 0; list-style: none; }
/* All lang links: Polylang <li> a, WPML a, fallback a */
.nav-lang a,
.nav-lang > ul li a { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--warm-gray); text-decoration: none; transition: color 0.2s; opacity: 0; padding: 4px 6px; border: 1px solid transparent; display: inline-block; }
.nav-lang a:hover,
.nav-lang > ul li a:hover { color: var(--rust); }
/* Active / current language */
.nav-lang a.lang-active,
.nav-lang > ul li.current-lang a,
.nav-lang > ul li a.lang-active { color: var(--white); border-color: rgba(200,191,176,0.3); }

/* Hamburger */
.nav-burger { display: none; flex-direction: column; justify-content: space-between; width: 28px; height: 18px; background: none; border: none; cursor: pointer; padding: 0; opacity: 0; }
.nav-burger span { display: block; width: 100%; height: 1px; background: var(--warm-gray); transition: all 0.3s ease; }
.nav-burger.open span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* Mobile overlay menu */
.mobile-menu { display: none; position: fixed; inset: 0; z-index: 490; background: rgba(13, 13, 13, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); padding: 100px 32px 48px; flex-direction: column; justify-content: center; }
.mobile-menu.open { display: flex; }
/* Scope border rules to the nav links list only, not the lang switcher list */
.mobile-menu > ul { list-style: none; margin: 0 0 48px; padding: 0; }
.mobile-menu > ul > li { border-top: 1px solid rgba(200,191,176,0.1); }
.mobile-menu > ul > li:last-child { border-bottom: 1px solid rgba(200,191,176,0.1); }
.mobile-link { display: block; font-family: 'Bebas Neue', sans-serif; font-size: 48px; letter-spacing: 0.05em; color: var(--white); text-decoration: none; padding: 16px 0; transition: color 0.2s; }
.mobile-link:hover { color: var(--rust); }
/* Mobile language switcher — handles Polylang <ul> and fallback <a> */
.mobile-lang { display: flex; gap: 12px; align-items: center; }
.mobile-lang > ul { display: flex; gap: 12px; list-style: none; margin: 0; padding: 0; }
.mobile-lang > ul li { margin: 0; padding: 0; }
.mobile-lang a,
.mobile-lang > ul li a { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--warm-gray); text-decoration: none; padding: 6px 10px; border: 1px solid rgba(200,191,176,0.2); transition: all 0.2s; opacity: 1 !important; display: inline-block; }
.mobile-lang a:hover,
.mobile-lang > ul li a:hover { color: var(--rust); border-color: var(--rust); }
.mobile-lang a.lang-active,
.mobile-lang > ul li.current-lang a,
.mobile-lang > ul li a.lang-active { color: var(--white); border-color: rgba(200,191,176,0.4); }

/* ─── HERO ─── */
#hero { position: relative; height: 100vh; display: flex; align-items: flex-end; padding: 0 48px 64px; overflow: hidden; background: var(--ink); }
.hero-bg-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: 'Bebas Neue', sans-serif; font-size: clamp(160px, 22vw, 320px); color: transparent; -webkit-text-stroke: 1px rgba(138, 122, 94, 0.18); white-space: nowrap; pointer-events: none; user-select: none; letter-spacing: -0.02em; }
.hero-stitch-line { position: absolute; top: 0; bottom: 0; width: 1px; background: repeating-linear-gradient(to bottom, var(--rust) 0px, var(--rust) 6px, transparent 6px, transparent 14px); opacity: 0; }
.stitch-1 { left: 24px; } .stitch-2 { right: 24px; }
.hero-year { position: absolute; top: 48px; right: 48px; font-size: 11px; letter-spacing: 0.2em; color: var(--khaki); text-transform: uppercase; opacity: 0; }
.hero-content { position: relative; z-index: 2; }
.hero-tag { font-size: 11px; letter-spacing: 0.25em; color: var(--rust); text-transform: uppercase; margin-bottom: 20px; opacity: 0; }
.hero-title { font-family: 'Bebas Neue', sans-serif; font-size: clamp(72px, 11vw, 160px); line-height: 0.9; color: var(--white); letter-spacing: -0.01em; overflow: hidden; }
.hero-title .line { display: block; transform: translateY(110%); opacity: 0; }
.hero-subtitle { margin-top: 32px; font-size: 13px; line-height: 1.7; color: var(--warm-gray); max-width: 380px; opacity: 0; }
.hero-scroll { position: absolute; bottom: 64px; right: 48px; display: flex; flex-direction: column; align-items: center; gap: 10px; opacity: 0; }
.hero-scroll span { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--khaki); writing-mode: vertical-lr; }
.scroll-line { width: 1px; height: 60px; background: linear-gradient(to bottom, var(--rust), transparent); animation: scrollPulse 1.8s ease-in-out infinite; }
@keyframes scrollPulse { 0%, 100% { transform: scaleY(1); opacity: 1; } 50% { transform: scaleY(0.6); opacity: 0.4; } }

/* ─── TICKER ─── */
.ticker-wrap { background: var(--rust); overflow: hidden; padding: 14px 0; white-space: nowrap; }
.ticker-track { display: inline-flex; animation: ticker 20s linear infinite; }
.ticker-item { font-family: 'Bebas Neue', sans-serif; font-size: 18px; letter-spacing: 0.1em; color: var(--white); padding: 0 32px; }
.ticker-sep { color: rgba(255,255,255,0.4); padding: 0 4px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ─── ABOUT / STATS ─── */
#about { padding: 120px 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; position: relative; }
#about::before { content: '02'; position: absolute; top: 40px; right: 48px; font-family: 'Bebas Neue', sans-serif; font-size: 200px; color: transparent; -webkit-text-stroke: 1px rgba(138,122,94,0.1); pointer-events: none; }
.section-label { font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--rust); margin-bottom: 24px; display: flex; align-items: center; gap: 12px; }
.section-label::before { content: ''; width: 32px; height: 1px; background: var(--rust); flex-shrink: 0; }
.about-title { font-family: 'Playfair Display', serif; font-size: clamp(36px, 4vw, 56px); line-height: 1.15; color: var(--white); font-weight: 900; }
.about-title em { font-style: italic; color: var(--khaki); }
.about-body { font-size: 13px; line-height: 1.85; color: var(--warm-gray); margin-top: 28px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.stat-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(200,191,176,0.1); padding: 36px 28px; position: relative; overflow: hidden; transition: background 0.3s; }
.stat-card:hover { background: rgba(184,76,30,0.06); }
.stat-card::after { content: ''; position: absolute; bottom: 0; left: 0; height: 2px; width: 0; background: var(--rust); transition: width 0.4s ease; }
.stat-card:hover::after { width: 100%; }
.stat-number { font-family: 'Bebas Neue', sans-serif; font-size: 64px; line-height: 1; color: var(--white); letter-spacing: -0.02em; }
.stat-number span { color: var(--rust); font-size: 40px; }
.stat-label { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--khaki); margin-top: 8px; line-height: 1.5; }

/* ─── SERVICES ─── */
#services { padding: 80px 48px 120px; position: relative; }
.services-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 64px; border-top: 1px solid rgba(200,191,176,0.15); padding-top: 48px; }
.services-title { font-family: 'Bebas Neue', sans-serif; font-size: clamp(52px, 7vw, 96px); color: var(--white); letter-spacing: -0.01em; line-height: 0.9; }
.services-desc { font-size: 12px; line-height: 1.8; color: var(--warm-gray); max-width: 280px; text-align: right; }
.services-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.service-item { background: rgba(255,255,255,0.02); border: 1px solid rgba(200,191,176,0.08); padding: 48px 32px 40px; position: relative; overflow: hidden; transition: all 0.4s ease; cursor: default; }
.service-item:hover { background: rgba(255,255,255,0.05); transform: translateY(-4px); border-color: rgba(184,76,30,0.3); }
.service-num { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--rust); letter-spacing: 0.15em; margin-bottom: 24px; opacity: 0.8; }
.service-icon { width: 40px; height: 40px; margin-bottom: 24px; opacity: 0.7; }
.service-name { font-family: 'Bebas Neue', sans-serif; font-size: 28px; letter-spacing: 0.05em; color: var(--white); margin-bottom: 14px; line-height: 1.1; }
.service-text { font-size: 12px; line-height: 1.75; color: var(--warm-gray); }
.service-item .hover-line { position: absolute; top: 0; left: 0; width: 0; height: 3px; background: var(--rust); transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }
.service-item:hover .hover-line { width: 100%; }
.service-item { filter: brightness(1); transition: filter 0.3s ease;}

/* ─── PRODUCTS ─── */
#products { padding: 80px 0 120px; overflow-x: auto; overflow-y: hidden; cursor: grab; }
.products-header { padding: 0 48px; margin-bottom: 48px; }
.products-scroll-wrap {  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.products-track { display: flex; gap: 3px; padding: 0 48px; width: max-content; }
.product-card { flex-shrink: 0; width: 260px; height: 340px; background: rgba(138,122,94,0.1); border: 1px solid rgba(200,191,176,0.1); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px 24px; transition: all 0.4s ease; }
.product-card:hover { border-color: var(--rust); transform: scale(1.02); }
.product-card-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 100px; opacity: 0.06; transition: opacity 0.4s, transform 0.4s; user-select: none; }
.product-card:hover .product-card-bg { opacity: 0.12; transform: scale(1.1) rotate(-5deg); }
.product-card-name { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: 0.08em; color: var(--white); position: relative; }
.product-card-tag { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--khaki); margin-top: 6px; position: relative; }

/* ─── PROCESS ─── */
#process { padding: 80px 48px 120px; background: rgba(255,255,255,0.015); border-top: 1px solid rgba(200,191,176,0.08); border-bottom: 1px solid rgba(200,191,176,0.08); }
.process-title { font-family: 'Bebas Neue', sans-serif; font-size: clamp(48px, 6vw, 80px); color: var(--white); margin-bottom: 72px; letter-spacing: -0.01em; }
.process-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.process-steps::before { content: ''; position: absolute; top: 28px; left: 72px; right: calc(20% - 16px); height: 1px; background: repeating-linear-gradient(to right, var(--rust) 0px, var(--rust) 8px, transparent 8px, transparent 16px); opacity: 0.4; }
.process-step { padding: 0 16px; position: relative; }
.step-dot { width: 56px; height: 56px; border: 2px solid rgba(184,76,30,0.4); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; position: relative; background: var(--ink); transition: all 0.3s; }
.process-step:hover .step-dot { background: var(--rust); border-color: var(--rust); transform: scale(1.1); }
.step-dot-num { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--rust); transition: color 0.3s; }
.process-step:hover .step-dot-num { color: var(--white); }
.step-name { font-family: 'Bebas Neue', sans-serif; font-size: 18px; letter-spacing: 0.05em; color: var(--white); margin-bottom: 10px; }
.step-desc { font-size: 11px; line-height: 1.7; color: var(--khaki); }

/* ─── CONTACT / FOOTER ─── */
#contact { padding: 120px 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.contact-title { font-family: 'Bebas Neue', sans-serif; font-size: clamp(52px, 7vw, 96px); line-height: 0.9; color: var(--white); letter-spacing: -0.01em; }
.contact-title .accent { color: var(--rust); }
.contact-subtitle { margin-top: 28px; font-size: 13px; line-height: 1.8; color: var(--warm-gray); max-width: 400px; }
.contact-info { margin-top: 56px; }
.contact-info-row { display: flex; flex-direction: column; border-top: 1px solid rgba(200,191,176,0.1); padding: 20px 0; }
.contact-info-row:last-child { border-bottom: 1px solid rgba(200,191,176,0.1); }
.ci-label { font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--rust); margin-bottom: 6px; }
.ci-value { font-family: 'DM Mono', monospace; font-size: 14px; color: var(--white); }
.cta-btn { display: inline-flex; align-items: center; gap: 16px; background: var(--rust); color: var(--white); font-family: 'DM Mono', monospace; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; text-decoration: none; padding: 18px 36px; margin-top: 48px; transition: all 0.3s; position: relative; overflow: hidden; }
.cta-btn::before { content: ''; position: absolute; inset: 0; background: var(--ink); transform: translateX(-100%); transition: transform 0.4s cubic-bezier(0.4,0,0.2,1); }
.cta-btn:hover::before { transform: translateX(0); }
.cta-btn span { position: relative; z-index: 1; }
.cta-btn svg { position: relative; z-index: 1; transition: transform 0.3s; }
.cta-btn:hover svg { transform: translateX(6px); }

footer { border-top: 1px solid rgba(200,191,176,0.1); padding: 28px 48px; display: flex; justify-content: space-between; align-items: center; }
.footer-logo { font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 0.1em; color: var(--khaki); }
.footer-copy { font-size: 11px; color: rgba(138,122,94,0.5); letter-spacing: 0.1em; }
.footer-est { font-size: 11px; color: rgba(138,122,94,0.5); letter-spacing: 0.1em; }

@media (max-width: 900px) {
  nav { padding: 20px 24px; }
  .nav-links { display: none; }
  .nav-lang { display: none; }
  .nav-burger { display: flex; }
  #hero { padding: 0 24px 48px; }
  .hero-stitch-line { display: none; }
  #about { grid-template-columns: 1fr; gap: 48px; padding: 80px 24px; }
  #services { padding: 60px 24px 80px; }
  .services-list { grid-template-columns: 1fr; }
  .services-header { flex-direction: column; align-items: flex-start; gap: 20px; }
  .services-desc { text-align: left; }
  #process { padding: 60px 24px 80px; }
  .process-steps { grid-template-columns: 1fr 1fr; gap: 32px; }
  .process-steps::before { display: none; }
  #contact { grid-template-columns: 1fr; gap: 48px; padding: 80px 24px; }
  footer { flex-direction: column; gap: 12px; padding: 24px; text-align: center; }
  .products-track { padding: 0 24px; }
  /* Smaller emoji bg on mobile to prevent overflow */
  .product-card-bg { font-size: 64px; }
  /* Single column for service items on small screens */
  .services-list { grid-template-columns: 1fr; }
}