/*
Theme Name: Quentin Sebire
Theme URI:
Author: Quentin Sebire
Author URI:
Description: Custom theme to showcase my work, expertise and services.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quentin-sebire-theme
*/

/* Global styles shared by every page; page-specific CSS lives in assets/css/ */

/* ----- FONTS AND VARIABLES ----- */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src:
    url("assets/fonts/bricolage-grotesque/BricolageGrotesque-Variable.woff2")
      format("woff2-variations"),
    url("assets/fonts/bricolage-grotesque/BricolageGrotesque-Variable.woff2")
      format("woff2");
}

/* Material Icons (self-hosted) */
@font-face {
  font-family: "Material Icons";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("assets/fonts/material-icons/MaterialIcons-Regular.woff2")
    format("woff2");
}

.material-icons {
  font-family: "Material Icons";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

/* Registered as <length> so it can be transitioned */
@property --btn-h {
  syntax: "<length>";
  inherits: true;
  initial-value: 50px;
}

:root {
  /* Colors */
  --color-primary: #8b7fd9;
  --color-primary-dark: #6e5fc4;
  --color-primary-light: #efebfb;
  --color-primary-soft: #c9c2f0; /* between primary-light and primary */
  --color-accent-yellow: #f5e08a;
  --color-accent-dark: #e3b90d; /* darker yellow, for borders on yellow */
  --color-accent-green: #a9d8b8;
  --color-accent-yellow-light: color-mix(in srgb, var(--color-accent-yellow) 55%, #fff); /* lighter yellow, like the creature's center particle */
  --color-bg: #fdfcfb;
  --color-surface: #fdfcfb; /* same warm white as --color-bg */
  --color-black: #2b2740;
  --color-text: #2b2740;
  --color-text-muted: #6b6580;
  --color-border: #2b2740;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(43, 39, 64, 0.06);
  --shadow-md: 0 12px 30px rgba(43, 39, 64, 0.1);

  /* Layout */
  --container-width: 1920px;

  /* Side gutters; --bleed lets blocks overflow the gutter */
  --gutter: clamp(2rem, 6vw, 4rem);
  --edge: max(2.5vw, 1.5rem); /* gap between the screen edge and .container */
  --container-w: calc(100% - 2 * var(--edge));
  --bleed: calc(var(--gutter) - 1rem);

  /* Breakpoints (media queries can't read variables): 1280 / 1024 / 768 / 480 */
  --section-padding: clamp(3rem, 6vw, 6rem);

  --font-sans:
    "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
}

/* ----- RESET ----- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Text selection */
::selection {
  background: var(--color-accent-yellow-light);
  color: var(--color-text);
}

body {
  margin: 0;
  /* Guard against horizontal overflow (full-bleed 100vw elements) */
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
  max-width: 100%;
  display: block;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* ----- TYPOGRAPHY ----- */

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}

/* Shared H1 style */
h1 {
  /* Fluid size: fixed base + share of the viewport width */
  font-size: clamp(2.2rem, 1.5rem + 3vw, 5.6rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
/* Smaller than the h1 */
h2 {
  font-size: clamp(1.9rem, 1.4rem + 2.5vw, 4.5rem);
}
h3 {
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 2.2rem);
}
h4 {
  font-size: 1.4rem;
  font-weight: 600;
}

.text-primary-color {
  color: var(--color-primary);
}

p {
  color: var(--color-text);
  margin: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  padding: 0.3em 0.9em;
  border-radius: var(--radius-pill);
  margin-bottom: 1em;
}

/* SEO keyword shown as a label inside the h1 */
.h1-eyebrow {
  display: block;
  width: fit-content;
  margin-bottom: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
}

.lead {
  font-size: 1.15rem;
  color: var(--color-text-muted);
}

.unbreackable-word {
  white-space: nowrap;
}

/* ----- LAYOUT ----- */

.container {
  width: var(--container-w);
  max-width: var(--container-width);
  margin-inline: auto;
}
@media (max-width: 768px) {
  :root {
    --edge: var(--gutter);
  }
}

.section {
  padding-block: var(--section-padding);
}

.section-header.center {
  margin-inline: auto;
  text-align: center;
}

/* ----- BUTTONS ----- */

/* Common base: the circle is absolute, the button gains padding-right on hover */
/* Fixed px sizes: label and circle inherit different font sizes */
.btn {
  --btn-h: 50px;
  --btn-gap: 6px;
  --label-pad: 1.4em;
  /* Dedicated bounce curve for the padding */
  --pad-bounce: cubic-bezier(0.22, 2.6, 0.4, 1);
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding-right: 0;
  transition: padding-right 0.4s var(--pad-bounce);
}
.btn:hover {
  padding-right: calc(var(--btn-h) + var(--btn-gap));
}

.btn__label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: var(--btn-h);
  padding-left: var(--label-pad);
  padding-right: var(--label-pad);
  border-radius: 100px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  background: var(--btn-bg, transparent);
  color: var(--btn-text, inherit);
  /* Padding-right bounce on hover */
  transition:
    padding-left 0.32s var(--pad-bounce),
    padding-right 0.32s var(--pad-bounce);
}
.btn:hover .btn__label {
  padding-right: calc(var(--label-pad) + 0.45em);
}

/* Arrow circle: absolute, anchored right, transparent at rest */
.btn__circle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--btn-h);
  height: var(--btn-h);
  border-radius: 50% 15% 15% 50%;
  line-height: 1;
  opacity: 0;
  transform-origin: left center;
  transition:
    opacity 0.3s ease,
    border-radius 0.5s ease;
}
.btn__circle span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  color: var(--btn-text, inherit);
}
.btn__circle svg {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
}
.btn:hover .btn__circle {
  opacity: 1;
  border-radius: 50%;
}

/* Liquid "drop" effect (decorative layer filtered by the SVG goo filter) */
.btn__drop {
  position: absolute;
  left: 100%;
  top: 0;
  /* Fixed width covering the filter region */
  width: calc(var(--btn-h) + var(--btn-gap) + 0.3em);
  height: 100%;
  pointer-events: none;
  filter: url(#btn-goo);
}
.btn__drop::before,
.btn__drop::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--btn-bg, transparent);
  transform: translate(-50%, -50%);
}
.btn:hover .btn__drop::before {
  animation: btn-goo-bud 0.6s ease-out forwards;
}
.btn:hover .btn__drop::after {
  width: var(--btn-h);
  height: var(--btn-h);
  left: calc(var(--btn-gap) + (var(--btn-h) / 2));
  transition:
    width 0.5s cubic-bezier(0.34, 1.6, 0.64, 1),
    height 0.5s cubic-bezier(0.34, 1.6, 0.64, 1),
    left 0.5s cubic-bezier(0.34, 1.6, 0.64, 1);
}
@keyframes btn-goo-bud {
  0% {
    width: 0;
    height: 0;
  }
  35% {
    width: 0.9em;
    height: 0.9em;
  }
  100% {
    width: 0;
    height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn__label,
  .btn__circle {
    transition: none;
  }
  .btn__drop {
    display: none;
  }
}

.btn-primary {
  --btn-bg: var(--color-primary);
  --btn-border: var(--color-primary-dark);
  --btn-text: #fff;
}

.btn-white {
  --btn-bg: #fff;
  --btn-border: var(--color-primary-light);
  --btn-text: var(--color-primary);
}

.btn-outline {
  --btn-bg: var(--color-accent-yellow);
  --btn-border: var(--color-accent-dark);
  --btn-text: var(--color-text);
}

.btn-light {
  --btn-bg: #fff;
  --btn-border: var(--color-primary-light);
  --btn-text: var(--color-primary-dark);
}

/* Small size variant */
.btn-size-s {
  --btn-h: 38px;
  --label-pad: 1em;
}
.btn-size-s .btn__label {
  font-size: 0.85rem;
}

/* ----- HEADER ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: 0;
  transition: padding-top 0.3s ease;
}

/* Floating pill on scroll */
.site-header.is-scrolled {
  --header-float-gap: 16px;
  padding-top: var(--header-float-gap);
}

/* Offset below the WordPress admin bar */
body.admin-bar .site-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  border-radius: 100px;
  transition:
    height 0.3s ease,
    width 0.3s ease;
}

/* Pill background on a pseudo-element (keeps the mobile menu positioning intact) */
.site-header__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid transparent;
  border-radius: inherit;
  pointer-events: none;
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.site-header.is-scrolled .site-header__inner {
  /* Reduce the width rather than adding a margin (the element is also .container) */
  width: calc(100% - (var(--header-float-gap) * 2));
  height: 56px;
  padding-inline: 1.25rem 0.5rem;
}
.site-header.is-scrolled .site-header__inner::before {
  background: rgba(253, 252, 251, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-primary-light);
}

/* Logo: 9-dot grid + text, two accent dots */
.qst-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.qst-logo__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  flex-shrink: 0;
}
.qst-logo__dot {
  width: 7px;
  height: 7px;
  aspect-ratio: 1/1;
  border-radius: 100%;
  background: var(--color-primary);
  transition: background 0.2s ease;
}
.qst-logo__dot--accent {
  background: var(--color-accent-yellow);
}
.qst-logo__text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  color: var(--color-text);
  transition: color 0.2s ease;
}
/* Final period of the name */
.qst-logo__period {
  color: var(--color-accent-yellow);
}

/* Header over a dark section (see header-theme.js) */
.site-header.is-on-dark .qst-logo__dot {
  background: #fff;
}
.site-header.is-on-dark .qst-logo__dot--accent {
  background: var(--color-accent-yellow);
}
.site-header.is-on-dark .qst-logo__text {
  color: #fff;
}
.site-header.is-on-dark .primary-nav a {
  color: #fff;
}
.site-header.is-on-dark .primary-nav a:hover {
  color: var(--color-primary-light);
}
.site-header.is-on-dark .nav-toggle {
  color: #fff;
}
.site-header.is-on-dark.is-scrolled .site-header__inner::before {
  background: rgba(110, 95, 196, 0.85);
  border-color: var(--color-primary);
}
.site-header.is-on-dark .header-cta {
  --btn-bg: var(--color-accent-yellow);
  --btn-border: #fff;
  --btn-text: var(--color-text);
}

/* Header CTA shrinks on scroll */
.header-cta {
  transition:
    padding-right 0.4s var(--pad-bounce),
    font-size 0.2s ease,
    --btn-h 0.2s ease;
}
.header-cta .btn__label {
  transition:
    padding-left 0.2s ease,
    padding-right 0.2s ease,
    height 0.2s ease;
}

.site-header.is-scrolled .header-cta {
  --btn-h: 42px;
  --label-pad: 1.1em;
  font-size: 0.88rem;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.primary-nav a {
  font-weight: 500;
  color: var(--color-text);
  position: relative;
}
.primary-nav a:hover {
  color: var(--color-primary-dark);
}

/* Mobile menu CTA, hidden on desktop */
.primary-nav__cta {
  display: none;
}

/* Burger turns into a cross */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
}
.nav-toggle__bars {
  position: relative;
  display: block;
  width: 26px;
  height: 18px;
}
.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transition:
    top 0.3s ease,
    transform 0.35s ease,
    opacity 0.2s ease;
}
.nav-toggle__bars span:nth-child(1) {
  top: 0;
}
.nav-toggle__bars span:nth-child(2) {
  top: 8px;
}
.nav-toggle__bars span:nth-child(3) {
  top: 16px;
}
.site-header.is-menu-open .nav-toggle__bars span:nth-child(1) {
  top: 8px;
  transform: rotate(45deg);
}
.site-header.is-menu-open .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}
.site-header.is-menu-open .nav-toggle__bars span:nth-child(3) {
  top: 8px;
  transform: rotate(-45deg);
}

/* ----- MOBILE MENU (<= 768px) ----- */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    /* Bars centered in a 44px button: compensate to align with the gutter */
    margin-right: -9px;
  }
  /* Scrolled header: bars as far from the edge as the logo */
  .site-header.is-scrolled .site-header__inner {
    padding-right: calc(1.25rem - 9px);
  }
  .site-header.is-scrolled .nav-toggle {
    margin-right: 0;
  }
  .header-cta {
    display: none;
  }

  .primary-nav {
    position: fixed;
    inset: 0;
    z-index: -1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Links vertically centered, same gap between items */
    --menu-gap: 1.75rem;
    gap: var(--menu-gap);
    justify-content: safe center;
    /* Same gutter as the header logo */
    padding: 72px var(--gutter);
    overflow-y: auto;
    background: var(--color-primary);
    /* Circle reveal from the burger */
    clip-path: circle(0 at calc(100% - 2.2rem) 2.2rem);
    visibility: hidden;
    transition:
      clip-path 0.55s cubic-bezier(0.77, 0, 0.18, 1),
      visibility 0s linear 0.55s;
  }
  body.admin-bar .primary-nav {
    padding-top: calc(72px + 32px);
  }
  .primary-nav.is-open {
    clip-path: circle(150% at calc(100% - 2.2rem) 2.2rem);
    visibility: visible;
    transition:
      clip-path 0.55s cubic-bezier(0.77, 0, 0.18, 1),
      visibility 0s;
  }

  .primary-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--menu-gap);
  }
  /* One font size for all menu links */
  .primary-nav {
    --menu-font: clamp(2rem, 9vw, 3rem);
  }
  .primary-nav a:not(.btn) {
    display: block;
    color: #fff;
    font-size: var(--menu-font);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-transform: uppercase;
  }
  .primary-nav a:not(.btn):hover {
    color: var(--color-accent-yellow);
  }

  /* Staggered appearance */
  .primary-nav li,
  .primary-nav__cta {
    opacity: 0;
    transform: translateY(24px);
    transition:
      opacity 0.3s ease,
      transform 0.3s ease;
  }
  .primary-nav.is-open li,
  .primary-nav.is-open .primary-nav__cta {
    opacity: 1;
    transform: translateY(0);
    transition:
      opacity 0.45s ease calc(0.2s + var(--i, 0) * 0.07s),
      transform 0.45s ease calc(0.2s + var(--i, 0) * 0.07s);
  }
  .primary-nav li:nth-child(1) { --i: 0; }
  .primary-nav li:nth-child(2) { --i: 1; }
  .primary-nav li:nth-child(3) { --i: 2; }
  .primary-nav li:nth-child(4) { --i: 3; }
  .primary-nav li:nth-child(5) { --i: 4; }
  /* CTA link: like the others, in yellow */
  .primary-nav__cta {
    --i: 5;
  }
  /* Prefixed to win over .is-on-dark */
  .site-header .primary-nav a.primary-nav__cta {
    color: var(--color-accent-yellow);
  }
  .site-header .primary-nav a.primary-nav__cta:hover {
    color: #fff;
  }

  /* Open menu: header geometry reset, white logo and cross */
  .site-header.is-menu-open {
    padding-top: 0;
  }
  .site-header.is-menu-open .site-header__inner {
    width: var(--container-w);
    height: 72px;
    padding-inline: 0;
  }
  .site-header.is-menu-open .nav-toggle {
    margin-right: -9px;
  }
  .site-header.is-menu-open .site-header__inner::before {
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    border-color: transparent;
  }
  .site-header.is-menu-open .qst-logo__dot {
    background: #fff;
  }
  .site-header.is-menu-open .qst-logo__dot--accent {
    background: var(--color-accent-yellow);
  }
  .site-header.is-menu-open .qst-logo__text,
  .site-header.is-menu-open .nav-toggle {
    color: #fff;
  }
}
/* Lock page scroll behind the open menu */
body.has-menu-open {
  overflow: hidden;
}

/* ----- FOOTER ----- */

.site-footer {
  background: var(--color-primary-light);
  padding-block: 3rem 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand p {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  max-width: 360px;
}
.footer-col__title {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.footer-col ul li {
  align-items: end;
}
.footer-col a {
  color: var(--color-text-muted);
}
.footer-col a:hover {
  color: var(--color-primary-dark);
}
/* Button keeps its own colors */
.footer-col a.btn {
  margin-top: 0.5rem;
  color: inherit;
}
.footer-bottom {
  border-top: 1px solid rgba(43, 39, 64, 0.1);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.footer-bottom ul {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- SCROLL REVEAL ----- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ----- SIMPLE PAGES ----- */

/* Narrow centered column: title, then text */
.page-simple__header,
.page-content {
  max-width: 780px;
  margin-inline: auto;
}
.page-simple__header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}
.page-simple__header h1 {
  margin-bottom: 0;
}
.page-content h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
}
.page-content h2:first-child {
  margin-top: 0;
}
.page-content p {
  margin-bottom: 1em;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.page-content a {
  color: var(--color-primary-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.page-content ul {
  list-style: disc;
  padding-left: 1.4rem;
  margin-bottom: 1em;
}
.page-content ul li {
  margin-bottom: 0.4em;
  color: var(--color-text-muted);
}
