/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --blue: #2ea0ff;
  --green: #18e7b4;
  --bg: #f6f7f9;
  --text: #0c0c0d;
  --muted: #5b5b5f;
  --card: rgba(255, 255, 255, 0.7);
  --ring: 0 0 0 3px rgba(46, 160, 255, 0.25);
}

[data-theme="dark"] {
  --bg: #0b0c0f;
  --text: #f5f7fb;
  --muted: #c5c7cf;
  --card: rgba(255, 255, 255, 0.05);
}
/* ===== RESET & BASE STYLES ===== */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}
/* ===== LAYOUT ===== */
.container {
  max-width: 1150px;
  margin: auto;
  padding: 0 16px;
}
/* ===== COMPONENTS ===== */
.btn {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  border: 0;
  border-radius: 14px;
  padding: 0.5rem 0.5rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, var(--blue), #29c7e9, var(--green));
  box-shadow: 0 6px 24px rgba(41, 199, 233, 0.25);
  cursor: pointer;
  font-size: 13px;
}

.btn.ghost {
  background: transparent;
  color: inherit;
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  box-shadow: none;
}

/* Smooth hover transitions for buttons */
.btn,
.btn.ghost {
  transition: background-color 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

/* Hover highlight for theme and language buttons */
#themeBtn:hover,
#langBtn:hover {
  background: color-mix(in oklab, var(--text) 10%, transparent);
  border-color: color-mix(in oklab, var(--text) 22%, transparent);
  box-shadow: 0 6px 18px rgba(41, 199, 233, 0.18);
}

/* Primary CTA hover ("Porozmawiajmy") */
.btn:hover:not(.ghost) {
  filter: brightness(1.04) saturate(1.05);
  box-shadow: 0 10px 28px rgba(41, 199, 233, 0.28);
  transform: translateY(-1px);
}

/* Ghost button hover (same as case study) */
.btn.ghost:hover {
  background: color-mix(in oklab, var(--text) 12%, transparent) !important;
  border-color: color-mix(in oklab, var(--blue) 60%, transparent) !important;
  box-shadow: 0 4px 16px rgba(41, 199, 233, 0.2) !important;
  transform: translateY(-1px);
}

/* Case study button styling */
.case-study-btn {
  position: relative;
  font-weight: 600;
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent) !important;
}

.case-study-btn:hover {
  background: color-mix(in oklab, var(--text) 12%, transparent) !important;
  border-color: color-mix(in oklab, var(--blue) 60%, transparent) !important;
  box-shadow: 0 4px 16px rgba(41, 199, 233, 0.2) !important;
  transform: translateY(-1px);
}

.btn:focus {
  outline: var(--ring);
}
/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(1.1) blur(8px);
  background: color-mix(in oklab, var(--bg) 65%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--text) 8%, transparent);
  z-index: 50;
  transition: transform 0.15s ease-out;
}

/* Hidden state toggled by JS */
header.header-hidden {
  transform: translateY(-100%);
}
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}
nav a {
  padding: 0.5rem 0.25rem;
  margin: 0 0.5rem;
  border-radius: 10px;
}
nav a:hover {
  background: color-mix(in oklab, var(--text) 8%, transparent);
}
/* Mobile nav */
@media (max-width: 860px) {
  #menuBtn {
    display: inline-flex;
  }
  nav#mainNav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background: color-mix(in oklab, var(--bg) 95%, transparent);
    border-bottom: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
    z-index: 40;
  }
  body.nav-open nav#mainNav {
    display: flex;
  }
  header .actions {
    gap: 6px;
  }
}
@media (min-width: 861px) {
  #menuBtn {
    display: none;
  }
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand img {
  height: 40px;
}
@media (min-width: 1024px) {
  .brand img {
    height: 44px;
  }
}
.logo-header {
  display: block;
}
.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.hero {
  position: relative;
  overflow: hidden;
}
.glow {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.45;
  background: radial-gradient(
      600px 600px at 20% 15%,
      var(--blue),
      transparent 60%
    ),
    radial-gradient(480px 480px at 85% 40%, var(--green), transparent 60%);
}
.hero .grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1.05fr 0.95fr;
  padding: 64px 0;
}
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: color-mix(in oklab, var(--text) 55%, transparent);
  font-size: 0.8rem;
}
h1 {
  margin: 0.2rem 0 1rem;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.08;
}
.lead {
  color: color-mix(in oklab, var(--text) 70%, transparent);
  font-size: 1.05rem;
}
.card {
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  margin-top: 50px;
}
.ratio {
  position: relative;
  width: 100%;
  padding-top: 55%;
  padding: 12px; /* inner breathing room without breaking card background */
  box-sizing: border-box;
}
.ratio > * {
  position: absolute;
  inset: 0;
}

/* Ensure HERO logo card has a healthy height (desktop and mobile) */
.hero .ratio {
  padding: 12px;
  padding-top: 0; /* use explicit height instead of aspect padding */
  height: clamp(220px, 32vw, 380px);
}
.hero .ratio > * {
  inset: 0;
}
.hero .hero-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hero-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 20px;
  margin: 0;
}
section {
  scroll-margin-top: 80px;
}
.section {
  padding: 64px 0;
}
.section h2 {
  font-size: clamp(24px, 3.4vw, 36px);
  margin: 0 0 18px;
}
.grid-4 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 720px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}
.service {
  padding: 20px;
}
.service:hover {
  box-shadow: 0 10px 28px rgba(41, 199, 233, 0.18);
}
/* Match services hover for work grid cards */
.work-grid .card:hover {
  box-shadow: 0 10px 28px rgba(41, 199, 233, 0.18);
}
/* Center button text inside work grid cards */
.work-grid .btn,
.more-card .btn {
  justify-content: center;
  text-align: center;
}
/* "See more" card styling */
.more-card {
  display: grid;
  place-items: center;
  min-height: 160px;
  text-align: center;
  background: linear-gradient(
      135deg,
      color-mix(in oklab, var(--blue) 8%, transparent),
      transparent 60%
    ),
    linear-gradient(
      315deg,
      color-mix(in oklab, var(--green) 8%, transparent),
      transparent 60%
    ),
    var(--card);
}
.more-card .more-inner {
  display: grid;
  gap: 12px;
  padding: 16px;
}
.more-card .more-title {
  margin: 0;
  font-size: 1.06rem;
}
@media (max-width: 720px) {
  .more-card {
    min-height: 130px;
  }
  .more-card .more-title {
    font-size: 1rem;
  }
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.chips li {
  list-style: none;
}
.chip {
  font-size: 0.9rem;
  border: 1px solid color-mix(in oklab, var(--text) 14%, transparent);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}
.work-grid {
  display: grid;
  gap: 18px;
}
@media (min-width: 860px) {
  .work-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1200px) {
  .work-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
/* On work.html page: 2 columns */
.page-work .work-grid {
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 860px) {
  .page-work .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.work-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-top: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  background: color-mix(in oklab, var(--text) 4%, transparent);
  display: block;
}
.shot-wrap {
  position: relative;
  width: 100%;
  padding-top: 58%;
  border-top: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
}
.shot-wrap > img {
  position: absolute;
  inset: 0;
}
.work-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-top: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  background: color-mix(in oklab, var(--text) 4%, transparent);
}

/* Form elements */
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  color: inherit;
  border-radius: 14px;
  padding: 12px 14px;
}

input:focus,
textarea:focus {
  outline: var(--ring);
}

/* Footer */
.footer {
  border-top: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  padding: 32px 0;
  color: color-mix(in oklab, var(--text) 65%, transparent);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo-footer {
  height: 64px;
}

@media (min-width: 1024px) {
  .logo-footer {
    height: 80px;
  }
}

/* Utility classes */
.notice {
  font-size: 0.95rem;
  color: color-mix(in oklab, var(--text) 70%, transparent);
}

.grid-2 {
  display: grid;
  gap: 16px;
}

@media (min-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.highlight {
  font-weight: 700;
  font-size: 1.06rem;
  padding: 12px 16px;
  border-radius: 16px;
  color: var(--text);
  background: linear-gradient(
    90deg,
    color-mix(in oklab, var(--blue) 20%, transparent),
    color-mix(in oklab, var(--green) 20%, transparent)
  );
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  box-shadow: 0 6px 24px rgba(41, 199, 233, 0.18);
}

/* Theme toggle animation */
#themeBtn {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#themeBtn span {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  transition: transform 0.35s ease, opacity 0.25s ease;
}

#themeBtn.spin span {
  animation: spin 0.45s ease both;
}

@keyframes spin {
  from {
    transform: rotate(-180deg) scale(0.6);
    opacity: 0.2;
  }
  to {
    transform: rotate(0) scale(1);
    opacity: 1;
  }
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 10px;
}
.cookie-banner .cookie-content {
  max-width: 1150px;
  margin: auto;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cookie-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-settings {
  margin: 16px 0;
  padding: 16px;
  background: color-mix(in oklab, var(--bg) 95%, transparent);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: 12px;
}

.cookie-option {
  margin-bottom: 12px;
}

.cookie-option:last-child {
  margin-bottom: 0;
}

.cookie-option label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.cookie-option label:hover {
  background: color-mix(in oklab, var(--text) 5%, transparent);
}

.cookie-option input[type="checkbox"] {
  margin-top: 4px;
  cursor: pointer;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.cookie-option input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-option div {
  flex: 1;
}

.cookie-option strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.cookie-option .notice {
  display: block;
  font-size: 0.85rem;
  margin: 0;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 1200px) {
  .container {
    padding: 0 20px;
  }
  .section {
    padding: 56px 0;
  }
  /* Keep comfortable header spacing below 1200px */
  .head {
    padding: 12px 0;
  }
  nav a {
    padding: 0.6rem 0.35rem;
  }
}

@media (max-width: 860px) {
  .container {
    padding: 0 16px;
  }
  .hero .grid {
    grid-template-columns: 1fr;
    padding: 42px 0;
  }
  /* Center titles only on mobile/tablet */
  h1,
  .section h2 {
    text-align: center;
  }
  .logo-header {
    height: 36px;
  }
  h1 {
    font-size: clamp(28px, 6.2vw, 40px);
  }
  .lead {
    font-size: 1rem;
  }
  nav a {
    margin: 0 0.35rem;
  }
  .actions {
    gap: 0.35rem;
  }
  #themeBtn {
    width: 32px;
    height: 32px;
  }
  #themeBtn span {
    font-size: 18px;
  }
  .btn {
    padding: 0.6rem 0.8rem;
    font-size: 14px;
  }
  .shot-wrap {
    padding-top: 64%;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 14px;
  }
  .head {
    padding: 8px 0;
  }
  .section {
    padding: 48px 0;
  }
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .work-grid,
  .page-work .work-grid {
    grid-template-columns: 1fr;
  }
  .shot-wrap {
    padding-top: 54%;
  }
  .chips {
    row-gap: 6px;
  }
  .chip {
    font-size: 0.85rem;
    padding: 0.32rem 0.7rem;
  }
  input[type="text"],
  input[type="email"],
  textarea {
    padding: 10px 12px;
  }
  .work-grid {
    gap: 12px;
  }
  .service {
    padding: 14px;
  }
  .card {
    border-radius: 16px;
    margin-top: 28px;
  }
  .work-grid h4 {
    font-size: 1rem;
  }
  .section h2 {
    font-size: 28px;
  }
  .notice {
    text-align: center;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: clamp(24px, 7.5vw, 32px);
  }
  .highlight {
    font-size: 0.98rem;
    padding: 10px 12px;
  }
  .btn {
    padding: 0.55rem 0.75rem;
    font-size: 13px;
  }
  .logo-footer {
    height: 56px;
  }
  .shot-wrap {
    padding-top: 48%;
  }
  .work-grid h4 {
    font-size: 0.95rem;
  }
  .section h2 {
    font-size: 26px;
  }
  .notice {
    text-align: center;
  }
}

/* Contact form responsive override for inline grid */
@media (max-width: 720px) {
  #contactForm > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  #contactForm [style*="grid-column: span 1"] {
    grid-column: 1 / -1 !important;
  }
}

.page-cookies .card a {
  font-weight: 600;
}
