/* 
  Theme Name:     Opitek Studio Design
  Author:         Opitek Design Studio
  Author URI:     https://www.opitek.co.uk
  Template:       Divi
  Version:        1.0
  Description:    Child Theme based on DIVI Premium Theme
*/

/* =========================================================
   GLOBAL WEBFONTS (Adobe Fonts / Typekit)
   ========================================================= */
@import url("https://use.typekit.net/sqv7psf.css");


/* =========================================================
   1) TOKENS: Colors, Typography, Cursor, Motion
   Notes:
   – Kept commented brand tokens for future use.
   – Do not change values; cascade relies on this exact set.
   – Duplicated variables later are intentional overrides.
   ========================================================= */
:root{
  /* Brand (kept commented for reference) */
  /* --brand-primary: #092E4C;       Deep Atlantic */
  /* --brand-accent:  #00B7E1;       Clear Cyan */

  /* Neutrals (kept commented for reference) */
  /* --ink:   #101418;   primary text */
  /* --ink-2: #6B7280;   secondary text */
  /* --line:  #E5E7EB;   borders */
  /* --bg:    #FFFFFF;   base background */
  /* --bg-2:  #F6F7FB;   cards/sections */
  /* --dark:  #0F1115;   dark surfaces */

  /* Focus & states (kept commented for reference)
  --focus: var(--brand-accent); */
  /* --primary-hover:  #093253; */
  /* --primary-active: #082944; */
  /* --accent-hover:   #00CCFC; */
  /* --accent-active:  #00A1C6; */

  /* Typography families
  --ff-head: "minion-3", "Minion 3", Georgia, serif;
  --ff-body: "neue-haas-grotesk-display", "Helvetica Neue", Arial, sans-serif;
  --ff-caption: "arboria", "Arboria", "Helvetica Neue", Arial, sans-serif; */
  
  --ff-head: "inter-tight-variable", Georgia, serif;
  --ff-body: "inter-tight-variable", "Helvetica Neue", Arial, sans-serif;
  --ff-caption: "inter-tight-variable", Arial, sans-serif; */
  

  /* Divi globals mapping */
  --et_global_heading_font: "neue-haas-grotesk-display", "Helvetica Neue", Arial, sans-serif !important;
  --et_global_body_font: "arboria", "Arboria", "Helvetica Neue", Arial, sans-serif !important;

  /* Base sizing */
  --fs-body: 16.5px;
  --lh-body: 1.7;

  /* Cursor (ring + dot) — defaults */
  --cursor-size: 30px;                 /* ring diameter */
  --cursor-border: 1px;                 /* ring border width */
  --cursor-color: rgba(0,0,0,.50);      /* ring color */
  --cursor-idle-opacity: 0.25;

  /* Lead dot */
  --lead-dot-size: 4px;
  --lead-dot-color: #092e4b;

  /* Secondary dot (reserved for future use) */
  --dot-size: 4px;
  --dot-size-link: 3px;

  /* Interaction behavior */
  --hover-scale: 1.25;
  --down-scale: 0.9;
  --stretch-max: 1.6;
  --stretch-response: 0.22;

  /* Magnet defaults */
  --magnet-strength: 0.18;
  --magnet-radius: 160;

  /* Badge/Icon (50% of ring) */
  --badge-size: calc(var(--cursor-size) * .5);
}


/* =========================================================
   2) MODERN CSS RESET + BASE ELEMENTS
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html:focus-within { scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .12em; }
h3, h4, h5, h6,
p, ul, ol, dl, figure { margin: 0 0 0.5em; }


/* =========================================================
   3) HEADINGS
   – Uses caption family for strong titles.
   – Optical letter-spacing tweak for compact look.
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-caption);
  font-weight: 700;
  letter-spacing: -0.0125em;
  line-height: 1.15;
}

h1 { font-size: clamp(40px, 6vw, 64px); }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: clamp(22px, 3vw, 28px); font-weight: 600; } /* Minion 3 – 600 */
h4 { font-size: 20px; font-weight: 600; }
h5 { font-size: 18px; font-weight: 600; }
h6 { font-size: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }


/* =========================================================
   4) BODY TEXT & LINKS
   ========================================================= */
small { font-size: 0.875rem; }
em, i { font-style: italic; }                 /* Arboria 400 italic is loaded */
strong, b { font-weight: 600; color: #092e4b; }  /* pseudo-semibold with tint */

/* Link colors (brand mapping kept) */
a { color: var(--brand-primary); }
a:hover { color: var(--primary-hover); }

/* Display name helper */
.name-display { font-family: var(--ff-caption); }


/* =========================================================
   5) CUSTOM CURSOR (ring + lead dot)
   Notes:
   – Hidden native cursor on precise pointers only.
   – Values overridden later are intentional (do not remove).
   ========================================================= */

/* Cursor fine-tuning / overrides (intentional duplicate :root) */
:root{
  --magnet-radius: 220;         /* wider magnet reach */
  --magnet-strength: 0.32;      /* stickiness (0.18–0.40) */
  --magnet-softness: 1.6;       /* strength curve (1..2) */
  --magnet-follow: 0.16;        /* slower follow when magnet active */
  --magnet-bounce: 0.42;        /* rebound after release */

  --cursor-size: 35px;
  --cursor-border: 1px;
  --cursor-color: #8b8c89;
  --lead-dot-size: 3px;
  --lead-dot-color: #274c77;
  --badge-size: 35px;

  --hover-scale: 1.35;
  --down-scale: 0.90;
  --stretch-max: 1.50;          /* smaller elongation to avoid “needle” */
  --stretch-response: 0.22;     /* grows quicker with tension */
  --stretch-compress: 0.22;     /* 0..0.5 – vertical squash amount */
}

/* [OPITEK] Cursor theme bridge: auto light/dark from <html> */
html.cursor-theme-dark .custom-cursor{ --cursor-color:#ffffff; }
html.cursor-theme-light .custom-cursor{ --cursor-color:#111111; }
html.cursor-theme-dark .cursor-dot-lead{ --lead-dot-color:#ffffff; }

/* Hide native cursor only on precise pointers (keeps touch cursors visible) */
@media (pointer: fine) {
  body.use-custom-cursor { cursor: none; }
  body.use-custom-cursor :is(a,button,[role="button"],[role="link"],.cursor-link,.cursor-zoom),
  body.use-custom-cursor :is(a,button,[role="button"],[role="link"],.cursor-link,.cursor-zoom) * {
    cursor: none !important;
  }
}
/* Allow native cursor inside form fields/editables */
input, textarea, select, [contenteditable="true"] { cursor:auto !important; }

/* Ring */
.custom-cursor{
  position: fixed; top:0; left:0;
  width:var(--cursor-size); height:var(--cursor-size);
  border:var(--cursor-border) solid var(--cursor-color);
  border-radius:50%;
  transform: translate(-50%,-50%);
  opacity:0; pointer-events:none; z-index:99999;
  transition: opacity 180ms ease, border-color 180ms ease;
  will-change: transform, opacity;
}
.custom-cursor.is-active{ opacity:1; }
.custom-cursor.is-idle{ opacity:var(--cursor-idle-opacity); }
.custom-cursor.is-hidden{ opacity:0; }
.custom-cursor.over-text{ opacity:0; }              /* don’t disturb over text inputs */
.custom-cursor.blend-diff{ mix-blend-mode:difference; }

/* Lead dot */
.cursor-dot-lead{
  position: fixed; left:0; top:0;
  width:var(--lead-dot-size); height:var(--lead-dot-size);
  margin: 0; border-radius:50%;
  background: var(--lead-dot-color);
  transform: translate(-50%,-50%);
  opacity: 1; pointer-events: none; z-index:99999;
  will-change: transform;
}

/* [OPITEK] Cursor badge — no-flash mask logic (fix on hide) */
.custom-cursor .cursor-badge{
  position:absolute; right:-10px; top:-2px;
  width:var(--badge-size); height:var(--badge-size);
  border-radius:3px; display:block; overflow:hidden;
  opacity: var(--badge-visible, 0);
  transform: translate(40%, -40%) scale(0.9);
  transition: opacity 180ms ease, transform 240ms ease;
  /* mask as before */
  -webkit-mask: var(--badge-url) center/contain no-repeat;
          mask: var(--badge-url) center/contain no-repeat;
  -webkit-mask-repeat: no-repeat;       mask-repeat: no-repeat;
  -webkit-mask-position: center;        mask-position: center;
  -webkit-mask-size: contain;           mask-size: contain;

  /* KLUCZ: gdy NIE ma .show-badge → tło przezroczyste (nie “mignie”) */
  background-color: transparent;
}

/* pokazuj kolor tylko kiedy faktycznie pokazujemy badge */
.custom-cursor.show-badge .cursor-badge{
  background-color: var(--badge-color, var(--cursor-color, #111));
  transform: translate(40%, -40%) scale(1);
}

/* Idle breathing effect (optional) */
@keyframes cursor-breath {
  0%   { transform: var(--_tf2) scale(0.98); opacity: var(--cursor-idle-opacity); }
  50%  { transform: var(--_tf2) scale(1.23); opacity: calc(var(--cursor-idle-opacity) + 0.15); }
  100% { transform: var(--_tf2) scale(0.98); opacity: var(--cursor-idle-opacity); }
}
.custom-cursor.is-breath{ animation: cursor-breath 2.6s ease-in-out infinite; }

/* Optional themes */
.custom-cursor.theme-dark{ --cursor-color:#fff; }
.custom-cursor.theme-brand{ --cursor-color:#111; }


/* =========================================================
   6) BACKGROUND EFFECT (page-level) + DIVI CLEANUP
   Notes:
   – Make Divi containers transparent so the body background shows.
   – Variables control cross-fade + presets below.
   ========================================================= */

/* Base gradients + transition timing */
:root{
  --bgfx-base: linear-gradient(180deg,#e7ecef,#fafdff);
  --page-bg: var(--bgfx-base);
  --bgfx-tr-duration: 600ms;
}

body{
  background: var(--page-bg);
  transition: background var(--bgfx-tr-duration) ease;
  backface-visibility: hidden;
}

/* Clear Divi default backgrounds to reveal body backdrop */
#page-container,
#et-main-area,
.et-l .et-l--body,
#main-content{
  background: transparent !important;
}

/* Sections used to control BG transitions */
.bgfx-section{ position: relative; }

/* Ready-made gradient tokens for data-bg usage */
:root{
  --g-hero:    linear-gradient(135deg,#0e1014,#1a1f2b);
  --g-accent:  linear-gradient(135deg,#1f1630,#3a0a3f);
  --g-success: linear-gradient(135deg,#0f2a1f,#1b4332);
}


/* =========================================================
   7) PAGE CROSS-FADE OVERLAY
   Notes:
   – #page-transition covers the viewport for entry/exit fades.
   – Variables include vignette/noise/logo mask options.
   – Keep duplicates at the end (intentional overrides).
   ========================================================= */

/* Config (kept as free vars, as provided) */
/* Doodads (optional helpers) */
--page-fade-blur: 0px;                 /* backdrop blur under the veil */
--page-fade-vignette-opacity: 0;       /* 0..1 */
--page-fade-vignette-radius: 60%;      /* 55–75% */
--page-fade-noise-url: url('/wp-content/uploads/ui/noise-64.png');
--page-fade-noise-opacity: 0;          /* 0..1 */

/* Watermark/logo */
--page-fade-logo-url: url('/wp-content/uploads/branding/logo-watermark.svg');
--page-fade-logo-size: clamp(96px, 18vmin, 220px);
--page-fade-logo-opacity: .10;         /* 0..1 */
--page-fade-logo-tint: #ffffff;        /* mask fill color */
--page-fade-logo-scale-in: .98;        /* entry scale */
--page-fade-logo-scale-out: 1.03;      /* exit scale */
}

/* Overlay element */
#page-transition {
  position: fixed; inset: 0;
  background: var(--page-fade-bg);
  opacity: 0; pointer-events: none;
  z-index: 100000; /* above custom cursor */
  transition: opacity var(--page-fade-in) var(--page-fade-ease-in);
  backdrop-filter: blur(var(--page-fade-blur));
}

/* Entry — visible before JS removes it */
html.op-preload #page-transition{ opacity: 1; }

/* Exit — faster, different easing */
body.op-leaving #page-transition {
  opacity: 1;
  transition: opacity var(--page-fade-out) var(--page-fade-ease-out);
}

/* Vignette + noise */
#page-transition::before {
  content:""; position:absolute; inset:0; pointer-events:none;
  background-image:
    radial-gradient(ellipse at center,
    transparent var(--page-fade-vignette-radius),
    rgba(0,0,0,1) 100%),
    var(--page-fade-noise-url);
  background-size: 100% 100%, auto;
  background-repeat: no-repeat, repeat;
  mix-blend-mode: multiply;
  opacity: calc(var(--page-fade-vignette-opacity) + var(--page-fade-noise-opacity));
}

/* Watermark/logo (mask) */
#page-transition::after {
  content:""; position:absolute; inset:0; pointer-events:none;
  margin:auto; width: var(--page-fade-logo-size); height: var(--page-fade-logo-size);
  background: var(--page-fade-logo-tint);
  -webkit-mask: var(--page-fade-logo-url) center/contain no-repeat;
  mask: var(--page-fade-logo-url) center/contain no-repeat;
  opacity: var(--page-fade-logo-opacity);
  transform: scale(var(--page-fade-logo-scale-in));
  transition: transform var(--page-fade-out) var(--page-fade-ease-out);
}
body.op-leaving #page-transition::after { transform: scale(var(--page-fade-logo-scale-out)); }

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  #page-transition, body.op-leaving #page-transition{ transition: none !important; }
  #page-transition::after{ transition: none !important; }
}

/* ——— Presets (optional): add class on <body> ——— */
body.fade-soft{
  --page-fade-bg:#0e0e12;
  --page-fade-in:600ms; --page-fade-out:480ms;
  --page-fade-ease-in:cubic-bezier(.2,.6,.3,1);
  --page-fade-ease-out:cubic-bezier(.4,0,.2,1);
  --page-fade-blur:0px;
  --page-fade-vignette-opacity:0;
  --page-fade-noise-opacity:0;
  --page-fade-logo-opacity:.06;
}

body.fade-cine{
  --page-fade-bg:#0b0b0f;
  --page-fade-in:720ms; --page-fade-out:600ms;
  --page-fade-ease-in:cubic-bezier(.22,.61,.36,1);
  --page-fade-ease-out:cubic-bezier(.4,0,.2,1);
  --page-fade-blur:4px;
  --page-fade-vignette-opacity:.22; --page-fade-vignette-radius:62%;
  --page-fade-noise-opacity:.06;
  --page-fade-logo-opacity:.08; --page-fade-logo-size:clamp(120px,20vmin,260px);
}

body.fade-brand{
  --page-fade-bg: linear-gradient(135deg,#0e0e12 0%, #0e0e12 70%, rgba(90,0,255,.25) 100%);
  --page-fade-in:760ms; --page-fade-out:640ms;
  --page-fade-ease-in:cubic-bezier(.25,.6,.3,1);
  --page-fade-ease-out:cubic-bezier(.4,0,.2,1);
  --page-fade-logo-opacity:.12; --page-fade-logo-tint:#b9a7ff;
}
body.fade-brand #page-transition::after{
  inset:auto 3vw 3vh auto; width:auto; height:12vmin; transform:none;
}

/* Intentional final overrides (keep order) */
:root{
  --page-fade-bg:#e7ecef; 
  --page-fade-in:760ms; 
  --page-fade-out:600ms;
  --page-fade-ease-in:cubic-bezier(.22,.61,.36,1);
  --page-fade-ease-out:cubic-bezier(.4,0,.2,1);
}
#page-transition{
  position:fixed; inset:0; background:var(--page-fade-bg);
  opacity:0; pointer-events:none; z-index:100000;
  transition:opacity var(--page-fade-in) var(--page-fade-ease-in);
}
body.op-leaving #page-transition{
  opacity:1; transition:opacity var(--page-fade-out) var(--page-fade-ease-out);
}
html.op-preload #page-transition{ opacity:1; }

/* [OPITEK] Cursor badge → SVG as mask, color via CSS var */
.custom-cursor .cursor-badge{
  /* zamiast background-image używamy maski */
  background-image: none !important;
  -webkit-mask: var(--badge-url) center/contain no-repeat;
          mask: var(--badge-url) center/contain no-repeat;
  background-color: var(--badge-color, var(--cursor-color, #111));
}

/* Auto-theme bridge (współpraca z klasami z JS) */
html.cursor-theme-dark  .custom-cursor{ --cursor-color:#ffffff; --badge-color:#ffffff; }
html.cursor-theme-light .custom-cursor{ --cursor-color:#111111; --badge-color:#111111; }

/* (opcjonalnie) ręczne nadpisanie koloru badge per sekcja: 
   .op-sec-2 { --badge-color: #00B7E1; } 
*/

/* [OPITEK] Admin bar always above the page veil */
.admin-bar #wpadminbar { z-index: 2147483647 !important; position: fixed; }
.admin-bar #page-transition { z-index: 2147483646 !important; }

/* W builderze zasłona w ogóle nie istnieje wizualnie */
.et-fb #page-transition { display: none !important; }

/* End — opitek studio */
