/* ============================================================================
   QUILL STUDIO — Design System
   Cinematic / dark · brass accent · editorial typography
   Hand-built, no framework. Mobile-first, fluid scale.
   ========================================================================== */

/* ---------- 1. Tokens --------------------------------------------------- */
:root {
  /* Color — warm near-black with brass + a cool blueprint accent */
  --ink-900: #08080a;      /* deepest bg */
  --ink-850: #0b0b0e;      /* page bg */
  --ink-800: #101015;      /* raised surface */
  --ink-750: #16161c;      /* card */
  --ink-700: #1d1d25;      /* hover surface */
  --line:    rgba(237, 234, 227, 0.10);
  --line-strong: rgba(237, 234, 227, 0.18);

  --paper:   #EFEBE2;      /* primary text (warm white) */
  --paper-dim: #B7B2A7;    /* secondary text */
  --paper-faint: #6E6A62;  /* tertiary / captions */

  --brass:   #C9A35A;      /* primary accent */
  --brass-bright: #E2C079;
  --brass-deep: #9A7C3E;
  --blueprint: #6E92C9;    /* cool technical accent */

  --glow: rgba(201, 163, 90, 0.35);

  /* Type */
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Fluid type scale (min 360px → max 1440px) */
  --step--1: clamp(0.78rem, 0.74rem + 0.18vw, 0.88rem);
  --step-0:  clamp(0.95rem, 0.90rem + 0.25vw, 1.08rem);
  --step-1:  clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(2.1rem, 1.7rem + 2vw, 3.4rem);
  --step-4:  clamp(2.8rem, 2rem + 4vw, 5.4rem);
  --step-5:  clamp(3.4rem, 2.2rem + 6vw, 8rem);

  /* Spacing & layout */
  --gutter: clamp(1.25rem, 0.8rem + 2.2vw, 3.5rem);
  --maxw: 1320px;
  --radius: 14px;
  --radius-lg: 22px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0.05, 0.36, 1);
  --dur: 0.8s;

  --shadow-soft: 0 30px 80px -40px rgba(0,0,0,0.9);
}

/* ---------- 2. Reset ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
  background: var(--ink-850);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-weight: 350;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, picture, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }
::selection { background: var(--brass); color: var(--ink-900); }

/* ---------- 3. Typography ---------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 380; line-height: 1.02; letter-spacing: -0.015em; font-optical-sizing: auto; }
.display { font-size: var(--step-5); line-height: 0.96; font-weight: 360; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { text-wrap: pretty; }
.lead { font-size: var(--step-1); color: var(--paper-dim); line-height: 1.5; font-weight: 350; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.eyebrow::before {
  content: "";
  width: 2.2em; height: 1px;
  background: linear-gradient(90deg, var(--brass), transparent);
}
.serif { font-family: var(--font-display); }
.italic { font-style: italic; }
.brass { color: var(--brass); }

/* ---------- 4. Layout helpers ------------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(4.5rem, 3rem + 7vw, 9rem); position: relative; }
.section--tight { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.stack > * + * { margin-top: 1.2rem; }
.grid { display: grid; gap: clamp(1.2rem, 0.8rem + 1.5vw, 2.4rem); }
.hide { display: none !important; }

/* section header */
.sec-head { display: flex; flex-direction: column; gap: 1.1rem; max-width: 62ch; }
.sec-head.center { margin-inline: auto; text-align: center; align-items: center; }
.sec-head .num {
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--paper-faint);
  letter-spacing: 0.2em;
}

/* ---------- 5. Buttons -------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.7em;
  padding: 1.05em 1.8em;
  font-family: var(--font-sans);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 100px;
  border: 1px solid transparent;
  transition: transform 0.5s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
  will-change: transform;
  overflow: hidden;
  isolation: isolate;
}
.btn .btn-ico { transition: transform 0.5s var(--ease); }
.btn:hover .btn-ico { transform: translateX(4px); }
.btn--primary { background: var(--brass); color: var(--ink-900); }
.btn--primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, var(--brass-bright), var(--brass));
  opacity: 0; transition: opacity 0.5s var(--ease);
}
.btn--primary:hover::before { opacity: 1; }
.btn--primary:hover { box-shadow: 0 18px 50px -18px var(--glow); }
.btn--ghost { border-color: var(--line-strong); color: var(--paper); }
.btn--ghost:hover { border-color: var(--brass); color: var(--brass); }
.btn--lg { padding: 1.25em 2.3em; font-size: var(--step-0); }
.btn--block { width: 100%; justify-content: center; }

/* text link with animated underline */
.tlink { position: relative; color: var(--paper); padding-bottom: 2px; }
.tlink::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: var(--brass); transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.tlink:hover::after { transform: scaleX(1); transform-origin: left; }
.tlink:hover { color: var(--brass); }

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

/* ---------- 7. Custom cursor ------------------------------------------- */
.cursor, .cursor-dot { pointer-events: none; position: fixed; top: 0; left: 0; z-index: 9999; mix-blend-mode: difference; }
.cursor {
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 1px solid rgba(255,255,255,0.6); border-radius: 50%;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease), background 0.3s var(--ease), opacity 0.3s;
}
.cursor-dot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: #fff; border-radius: 50%; }
body.cursor-hover .cursor { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(255,255,255,0.08); }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot { display: none; } }

/* ---------- 8. Reveal animations --------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-d="1"] { transition-delay: 0.08s; }
[data-reveal][data-d="2"] { transition-delay: 0.16s; }
[data-reveal][data-d="3"] { transition-delay: 0.24s; }
[data-reveal][data-d="4"] { transition-delay: 0.32s; }
[data-reveal][data-d="5"] { transition-delay: 0.40s; }

/* line mask reveal for headlines */
.line-mask { display: block; overflow: hidden; }
.line-mask > span { display: block; transform: translateY(110%); transition: transform 1.1s var(--ease); }
.in .line-mask > span, .line-mask.in > span { transform: none; }

/* ---------- 9. Header / Nav -------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  padding-block: 1.25rem;
  transition: background 0.5s var(--ease), padding 0.5s var(--ease), border-color 0.5s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(8,8,10,0.72); backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  padding-block: 0.8rem; border-bottom-color: var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.02em; }
.brand svg { width: 26px; height: 26px; }
.brand b { font-weight: 500; }
.brand .mark-q { color: var(--brass); }
.nav-links { display: flex; align-items: center; gap: clamp(1.2rem, 0.5rem + 1.6vw, 2.6rem); }
.nav-links a { font-size: var(--step--1); letter-spacing: 0.06em; color: var(--paper-dim); transition: color 0.3s; position: relative; }
.nav-links a:hover { color: var(--paper); }
.nav-actions { display: flex; align-items: center; gap: 1rem; }

/* language toggle */
.lang {
  display: inline-flex; border: 1px solid var(--line-strong); border-radius: 100px; overflow: hidden;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em;
}
.lang button { padding: 0.45em 0.8em; color: var(--paper-faint); transition: color 0.3s, background 0.3s; }
.lang button.active { background: var(--brass); color: var(--ink-900); }

/* mobile menu */
.burger { display: none; width: 30px; height: 18px; position: relative; }
.burger span { position: absolute; left: 0; width: 100%; height: 1.5px; background: var(--paper); transition: transform 0.4s var(--ease), opacity 0.3s; }
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 8px; }
.burger span:nth-child(3) { top: 16px; }
body.menu-open .burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 999; background: var(--ink-900);
  display: flex; flex-direction: column; justify-content: center; gap: 1rem;
  padding: var(--gutter); transform: translateY(-100%); transition: transform 0.7s var(--ease);
}
body.menu-open .mobile-menu { transform: none; }
.mobile-menu a { font-family: var(--font-display); font-size: var(--step-3); color: var(--paper); }
.mobile-menu a span { color: var(--paper-faint); font-family: var(--font-mono); font-size: 0.9rem; margin-right: 0.8rem; }

/* ---------- 10. Footer -------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(3rem, 2rem + 4vw, 5rem) 2rem; background: var(--ink-900); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.footer-grid h4 { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.18em; text-transform: uppercase; color: var(--paper-faint); margin-bottom: 1.2rem; font-weight: 400; }
.footer-grid a { display: block; color: var(--paper-dim); padding: 0.3rem 0; transition: color 0.3s; }
.footer-grid a:hover { color: var(--brass); }
.footer-bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: var(--paper-faint); font-size: var(--step--1); }
.footer-big { font-family: var(--font-display); font-size: clamp(3rem, 10vw, 12rem); line-height: 0.9; color: var(--ink-800); letter-spacing: -0.02em; text-align: center; margin-top: 2rem; user-select: none; }

/* ---------- 11. Utility / misc ----------------------------------------- */
/* ---------- i18n block visibility (HR/EN) ------------------------------ */
/* Page-specific rich content wraps in [data-lang]; root html[data-lang] decides. */
html[data-lang="hr"] [data-lang="en"] { display: none !important; }
html[data-lang="en"] [data-lang="hr"] { display: none !important; }

.divider { height: 1px; background: var(--line); border: 0; }
.tag { display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.4em 0.9em; border: 1px solid var(--line-strong); border-radius: 100px; color: var(--paper-dim); }
.noscroll { overflow: hidden; }

@media (max-width: 880px) {
  .nav-links, .nav-actions .btn { display: none; }
  .burger { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
