/* ============================================
   STYLE.CSS — Qiwi.ch Redesign
   Mobile first. Toutes les valeurs viennent
   de design-tokens.css.
   ============================================ */

/* ---- UTILITIES ---- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

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

.btn {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--duration-normal) var(--ease-smooth),
    box-shadow var(--duration-normal) var(--ease-smooth),
    transform var(--duration-normal) var(--ease-smooth);
}

.btn:hover {
  background: var(--color-accent-light);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  text-decoration: none;
}

.btn--large {
  padding: var(--space-md) var(--space-2xl);
  font-size: var(--text-base);
  width: 100%;
  text-align: center;
}

@media (min-width: 768px) {
  .btn--large {
    width: auto;
  }
}

/* ---- NAV ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: var(--nav-height);
  transition: background var(--duration-normal) var(--ease-smooth),
              transform var(--duration-normal) var(--ease-smooth);
}

.nav--solid {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

.nav--light.nav--solid {
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.nav--light .nav__link {
  color: var(--color-text-secondary);
}

.nav--light .nav__link:hover {
  color: var(--color-text);
}

.nav--light .nav__burger span {
  background: var(--color-text);
}

/* nav--hidden supprimé : header toujours visible */

.nav__container {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
  transition: filter var(--duration-normal) var(--ease-smooth);
}

.nav--light .nav__logo img {
  filter: none;
}

.nav__links {
  display: none;
  align-items: center;
  gap: var(--space-xl);
}

.nav__link {
  font-size: var(--text-sm);
  color: var(--color-text-on-dark-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.nav__link:hover {
  color: var(--color-text-on-dark);
}

.nav__lang {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  opacity: 0.7;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  transition: opacity var(--duration-fast) var(--ease-smooth),
              border-color var(--duration-fast) var(--ease-smooth);
}

.nav__lang:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.6);
}

.nav--light .nav__lang {
  color: var(--color-text-secondary);
  border-color: rgba(0, 0, 0, 0.2);
}

.nav--light .nav__lang:hover {
  border-color: rgba(0, 0, 0, 0.4);
}

.nav__cta {
  font-size: var(--text-xs) !important;
  padding: var(--space-xs) var(--space-lg) !important;
}

/* Burger */
.nav__burger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  position: relative;
}

/* Nav passe au-dessus du mobile-menu quand ouvert */
.nav--menu-open,
.nav:has(.nav__burger.is-open) {
  z-index: calc(var(--z-overlay) + 1);
}

@media (min-width: 768px) {
  .nav__links {
    display: flex;
  }
  .nav__burger {
    display: none;
  }
}

.nav__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-on-dark);
  transition: transform var(--duration-normal) var(--ease-smooth),
              opacity var(--duration-fast);
}

.nav__burger.is-open span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav__burger.is-open span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xl);
}

.mobile-menu__link {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--color-text-on-dark);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.mobile-menu__link:hover {
  color: var(--color-accent-light);
}

.mobile-menu__lang {
  font-size: var(--text-base);
  opacity: 0.5;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.mobile-menu__link.btn {
  font-size: var(--text-lg);
  margin-top: var(--space-lg);
}

/* ---- HERO ---- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  background: linear-gradient(145deg, var(--color-primary) 0%, var(--color-primary-dark) 50%, var(--color-primary-dark) 100%);
  overflow: hidden;
  padding-top: var(--nav-height);
}

/* Noise texture */
.hero__noise {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  pointer-events: none;
  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)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Teal glow top-right */
.hero::after {
  content: '';
  position: absolute;
  top: -15%;
  right: -5%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(0, 133, 122, 0.25) 0%, transparent 65%);
  pointer-events: none;
}

/* Secondary glow bottom-left */
.hero::before {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(15, 53, 83, 0.5) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero__container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-4xl) var(--gutter) var(--space-3xl);
}

.hero__title {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text-on-dark);
  margin-bottom: var(--space-lg);
  max-width: 800px;
}

.hero__accent {
  color: var(--color-accent-light);
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-text-on-dark-secondary);
  max-width: 500px;
  margin-bottom: var(--space-xl);
}

.hero__large-type {
  display: none;
}

@media (min-width: 1024px) {
  .hero__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: end;
    padding: var(--space-5xl) var(--gutter) var(--space-4xl);
  }

  .hero__title {
    font-size: var(--text-4xl);
  }

  .hero__large-type {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 0;
  }

  .hero__word {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3.5rem, 2.5rem + 3vw, 5.5rem);
    line-height: 1.15;
    letter-spacing: 0.04em;
    color: var(--color-primary-dark);
    -webkit-text-stroke: 1.5px var(--color-text-on-dark);
    paint-order: stroke fill;
    user-select: none;
  }

  .hero__word--filled {
    /* même style que les autres mots */
  }
}

/* ---- MISSION ---- */

.mission {
  padding: var(--space-section) 0;
  background: var(--color-surface);
  text-align: center;
}

.mission__title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-lg);
}

.mission__text {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  max-width: 650px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .mission__title {
    font-size: var(--text-5xl);
  }
}

/* ---- SERVICES ---- */

.services {
  padding: var(--space-section) 0;
  background: var(--color-surface);
}

.service {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--color-border);
}

.service:last-child {
  border-bottom: none;
}

.service__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-sm);
}

.service__desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  max-width: 550px;
}

@media (min-width: 1024px) {
  .service {
    padding: var(--space-2xl) 0;
  }

  .service__title {
    font-size: var(--text-6xl);
  }

  .service__desc {
    font-size: var(--text-lg);
  }
}

/* ---- PORTFOLIO ---- */

.portfolio {
  padding: var(--space-section) 0;
  background: var(--color-primary-dark);
}

.portfolio__title {
  font-size: var(--text-3xl);
  color: var(--color-text-on-dark);
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.portfolio__grid {
  display: flex;
  gap: var(--space-lg);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-md);
}

.portfolio__item {
  flex: 0 0 85%;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Browser frame */
.portfolio__browser {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-primary);
  border: 1px solid var(--color-border-on-dark);
  transition: transform var(--duration-normal) var(--ease-smooth),
              box-shadow var(--duration-normal) var(--ease-smooth);
}

.portfolio__item:hover .portfolio__browser {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.portfolio__browser-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--color-primary-light);
}

.portfolio__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border-on-dark);
}

.portfolio__browser-content {
  overflow: hidden;
}

.portfolio__browser-content img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  transition: transform 0.6s var(--ease-smooth);
}

.portfolio__item:hover .portfolio__browser-content img {
  transform: scale(1.03);
}

.portfolio__meta {
  padding: var(--space-md) var(--space-xs) 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.portfolio__name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-on-dark);
}

.portfolio__desc {
  font-size: var(--text-xs);
  color: var(--color-text-on-dark-secondary);
}

@media (min-width: 768px) {
  .portfolio__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
  }

  .portfolio__item {
    flex: none;
  }

}

@media (min-width: 1024px) {
  .portfolio__title {
    font-size: var(--text-4xl);
  }
}

/* ---- WHY ---- */

.why {
  padding: var(--space-section) 0;
  background: var(--color-surface-alt);
}

.why__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.why__cell {
  padding: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.why__cell:last-child {
  border-bottom: none;
}

.why__cell-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.why__cell-desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

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

  .why__cell {
    padding: var(--space-2xl);
  }

  .why__cell:nth-child(odd) {
    border-right: 1px solid var(--color-border);
  }

  .why__cell:nth-child(1),
  .why__cell:nth-child(2) {
    border-bottom: 1px solid var(--color-border);
  }

  .why__cell:nth-child(3),
  .why__cell:nth-child(4) {
    border-bottom: none;
  }

  .why__cell-title {
    font-size: var(--text-2xl);
  }
}

/* ---- ABOUT ---- */

.about {
  padding: var(--space-section) 0;
  background: var(--color-surface);
}

.about__layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xl);
}

.about__photo {
  width: 180px;
  flex-shrink: 0;
}

.about__photo img {
  border-radius: var(--radius-xl);
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
}

.about__text {
  text-align: center;
}

.about__title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-lg);
}

.about__bio {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-lg);
}

.about__link {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--duration-fast);
}

.about__link:hover {
  color: var(--color-accent-light);
}

.about__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-secondary);
}

@media (min-width: 1024px) {
  .about__layout {
    flex-direction: row;
    align-items: center;
    gap: var(--space-4xl);
  }

  .about__photo {
    width: 280px;
  }

  .about__text {
    text-align: left;
    max-width: 550px;
  }

  .about__title {
    font-size: var(--text-4xl);
  }

  .about__bio {
    font-size: var(--text-lg);
  }
}

/* ---- PROCESS ---- */

.process {
  padding: var(--space-section) 0;
  background: var(--color-primary-dark);
}

.process__title {
  font-size: var(--text-3xl);
  color: var(--color-text-on-dark);
  margin-bottom: var(--space-xs);
  text-align: center;
}

.process__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-on-dark-secondary);
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.process__steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

.process__number {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.process__step-title {
  font-size: var(--text-xl);
  color: var(--color-text-on-dark);
  margin-bottom: var(--space-xs);
}

.process__step-desc {
  font-size: var(--text-base);
  color: var(--color-text-on-dark-secondary);
  line-height: var(--leading-normal);
}

@media (min-width: 768px) {
  .process__steps {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
  }

  .process__number {
    font-size: var(--text-5xl);
  }
}

@media (min-width: 1024px) {
  .process__title {
    font-size: var(--text-4xl);
  }
}

/* ---- CONTACT ---- */

.contact {
  padding: var(--space-section) 0;
  background: var(--color-surface);
}

.contact__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3xl);
}

.contact__title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-md);
}

.contact__desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-xl);
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-accent);
  font-weight: 500;
  font-size: var(--text-base);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.contact__link:hover {
  color: var(--color-accent-light);
}

.contact__link svg {
  flex-shrink: 0;
}

/* Form */
.form-field {
  margin-bottom: var(--space-lg);
}

.form-field--honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.form-field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
  letter-spacing: var(--tracking-wide);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: var(--space-sm) 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  font-size: var(--text-base);
  color: var(--color-text);
  border-radius: 0;
  transition: border-color var(--duration-normal) var(--ease-smooth);
  -webkit-appearance: none;
}

.form-field input:focus,
.form-field textarea:focus {
  border-bottom-color: var(--color-accent);
  outline: none;
}

.form-field textarea {
  resize: vertical;
  min-height: 100px;
}

/* Erreurs custom */
.form-field--error input,
.form-field--error textarea,
.form-field--error .custom-select__trigger {
  border-bottom-color: var(--color-accent);
}

.form-field__error {
  display: none;
  font-size: var(--text-xs);
  color: var(--color-accent);
  margin-top: var(--space-xs);
}

.form-field--error .form-field__error {
  display: block;
}

/* Custom select */
.custom-select {
  position: relative;
}

.custom-select__trigger {
  width: 100%;
  padding: var(--space-sm) 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  font-size: var(--text-base);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color var(--duration-normal) var(--ease-smooth);
  font-family: var(--font-body);
  text-align: left;
  border-radius: 0;
}

.custom-select__trigger:focus {
  outline: none;
  border-bottom-color: var(--color-accent);
}

.custom-select__trigger svg {
  flex-shrink: 0;
  transition: transform var(--duration-normal) var(--ease-smooth);
  color: var(--color-text-secondary);
}

.custom-select.is-open .custom-select__trigger svg {
  transform: rotate(180deg);
}

.custom-select__value {
  color: var(--color-text-secondary);
}

.custom-select__value.has-value {
  color: var(--color-text);
}

.custom-select__dropdown {
  position: absolute;
  top: calc(100% + var(--space-xs));
  left: 0;
  right: 0;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: var(--space-xs) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity var(--duration-fast) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-smooth),
    visibility var(--duration-fast);
  z-index: 10;
}

.custom-select.is-open .custom-select__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select__option {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.custom-select__option:hover {
  background: var(--color-surface);
}

.custom-select__option.is-selected {
  color: var(--color-accent);
  font-weight: 600;
}

@media (min-width: 768px) {
  .contact__layout {
    grid-template-columns: 2fr 3fr;
    gap: var(--space-4xl);
  }

  .contact__title {
    font-size: var(--text-4xl);
  }

  .btn--large {
    width: auto;
  }
}

/* Form status messages */
.form-status {
  font-size: var(--text-sm);
  padding: var(--space-sm) 0;
  min-height: 1.5em;
}

.form-status--success {
  color: var(--color-accent);
  font-weight: 500;
}

.form-status--error {
  color: var(--color-accent);
  font-weight: 500;
}

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

.footer {
  background: var(--color-primary-dark);
  padding: var(--space-xl) 0;
}

.footer__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.footer__logo img {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer__links {
  display: flex;
  gap: var(--space-xl);
}

.footer__links a {
  color: var(--color-text-on-dark-secondary);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.footer__links a:hover {
  color: var(--color-text-on-dark);
}

.footer__copy {
  font-size: var(--text-xs);
  color: var(--color-text-on-dark-secondary);
}

@media (min-width: 768px) {
  .footer__container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}
