@font-face {
  font-family: "TTCommons";
  src: url("../font/TTCommons-Light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TTCommons";
  src: url("../font/TTCommons-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TTCommons";
  src: url("../font/TTCommons-Italic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

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

:root {
  color-scheme: light dark;
  font-family: "Figtree", "TTCommons", sans-serif;
  line-height: 1.5;
  font-weight: 300;
  font-synthesis: none;
  text-rendering: optimizeLegibility;

  /*! Font vars */
  --first-family: "Figtree", sans-serif;
  --second-family: "TTCommons", sans-serif;

  /*! Colors vars */
  --bg-light: #f8f8f8;
  --bg-dark: #00080c;
  --bg-dark-blue: #02080f;
  --accent-grey: #3f3f3f;
  --accent-sub: #00577f;
  --links: #c3c3c3;
  --icon: white;

  /*! Toggle-specific */
  --toggle-track-light: oklch(80% 0.08 250);
  --toggle-track-dark: oklch(50% 0.12 250);
  --toggle-track: light-dark(
    var(--toggle-track-light),
    var(--toggle-track-dark)
  );
  --toggle-thumb-light: oklch(99% 0 0);
  --toggle-thumb-dark: oklch(30% 0.05 250);
  --toggle-thumb: light-dark(
    var(--toggle-thumb-light),
    var(--toggle-thumb-dark)
  );

  /*! Service sizes */
  --continer-width: 90rem; /* 1440px */
  --container-padding: clamp(1rem, 5vw, 3.5rem); /* 16px to 56px */
  --container-block: clamp(
    2.5rem,
    1.8rem + 3.5vw,
    4.6875rem
  ); /* 40px to 75px */
  --title-size: clamp(1.5rem, 3vw + 0.7rem, 2rem); /* 24px to  40px*/
  --font-size: clamp(1.125rem, 1rem + 0.5vw, 1.5rem); /* 18px to 24px */
  --grid-gap: clamp(0.75rem, 0.2rem + 2.5vw, 2.5rem); /* 12px to 40px */

  /* base color scheme */
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  font-family: var(--first-family);
  font-weight: 400;
  tab-size: 4;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

html.dark {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--first-family);
  color: var(--bg-light);
  background-color: light-dark(var(--bg-light), var(--bg-dark-blue));
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}

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

main {
  flex-grow: 1;
}

button {
  cursor: pointer;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

[type="button"],
[type="reset"],
[type="submit"],
button {
  -webkit-appearance: button;
}

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

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

a {
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}

.container {
  max-width: var(--continer-width);
  padding-inline: var(--container-padding);
  margin: 0 auto;
}

.hero-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__video.is-hidden {
  display: none;
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 18px 24px;
  padding-block: clamp(1.125rem, 0.85rem + 1.2vw, 2rem);
  padding-inline: var(--container-padding);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  & img {
    display: block;
    width: 77px;
    height: 97px;
  }
}

.header_logo {
  fill: white;
  height: 67px;
  width: 47px;
  @media screen and (width > 768px) {
    height: 97px;
    width: 77px;
  }
}

.header_btn {
  display: block;
  border: 1px solid var(--bg-light);
  color: var(--bg-light);
  background: none;
  cursor: pointer;
  padding: 0.5rem 2rem;
  min-width: 9rem;
  min-height: 2.5rem;
  transition:
    color ease-in-out 300ms,
    background-color ease-in-out 300ms,
    translate ease-in-out 300ms;
  &:hover {
    background: var(--bg-light);
    color: var(--bg-dark);
    translate: 0 -4px;
  }
  &:active {
    translate: 0 -2px;
  }
  @media screen and (width > 768px) {
    padding: 0.75rem 3rem;
    min-width: 12rem;
    min-height: 3rem;
  }
  &.desk {
    @media screen and (width < 767px) {
      display: none;
    }
  }
  &.mobile {
    margin: 0 auto 5rem;
    @media screen and (width > 768px) {
      display: none;
    }
  }
}

.flex-wrap {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero-nav {
  position: absolute;
  top: 50%;
  right: clamp(1.5rem, 0.5rem + 4vw, 3.5rem);
  transform: translateY(-50%);
  /* @media screen and (width < 767px) {
    top: 60%;
  } */
}

.hero-nav_item {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  &:hover {
    .hero-item_link {
      font-size: 3rem;
      color: white;
    }
    .hero--link_icon {
      opacity: 1;
      visibility: visible;
      transform: translateX(0);
    }
  }
}

.hero--link_icon {
  fill: var(--bg-light);
  width: 25px;
  height: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-40px);
  transition:
    opacity 300ms ease,
    transform 600ms ease,
    visibility 300ms ease;
}

.hero-item_link {
  font-weight: 300;
  font-family: var(--first-family);
  font-size: clamp(1.75rem, 1.55rem + 0.8vw, 2.125rem);
  color: var(--links);
  text-align: right;
  transition:
    color ease-in-out 300ms,
    font-size ease-in-out 300ms;
}

/* TODO Animations of tags */

.hero-words {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-25%, -50%);
  z-index: 2;
  font-size: clamp(1rem, 0.8rem + 1vw, 2rem);
  font-weight: 400;
  height: 1.2em;
  overflow: hidden;
  display: inline-block;
  @media screen and (width > 768px) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

.hero-words__track {
  text-align: center;
  font-weight: 300;
  display: flex;
  flex-direction: column;
  animation: words-slide 6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.hero-words__track span {
  display: block;
  height: 1.2em;
  line-height: 1.2em;
}

@keyframes words-slide {
  0%,
  25% {
    transform: translateY(0);
  }

  33%,
  58% {
    transform: translateY(-1.2em);
  }

  66%,
  91% {
    transform: translateY(-2.4em);
  }

  100% {
    transform: translateY(0);
  }
}

/* ! About Section */

.about-wrapper {
  padding-block: clamp(5rem, 3.5rem + 6.5vw, 9.375rem);
  padding-inline: var(--container-padding);
  overflow: hidden;
  & .flex {
    display: flex;
    justify-content: flex-end;
  }
}

.about-txt {
  font-weight: 400;
  font-size: var(--font-size);
  line-height: 1.4;
  text-align: right;
  color: light-dark(var(--accent-grey), var(--bg-light));
  max-width: 47rem;
}

/* ! Projects Gallery */

.projects-wrapper {
  padding-inline: var(--container-padding);
  margin-bottom: var(--container-block);
}

.gallery {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: var(--grid-gap);
  & img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    &:hover {
      transform: scale(1.02);
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    }
  }
}

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

.right-grid {
  display: grid;
  grid-template-rows: 1fr 2fr;
  gap: var(--grid-gap);
}

.left-grid {
  display: grid;
  grid-template-rows: 2fr 1fr;
  gap: var(--grid-gap);
}

.sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
}

.bottom-block {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* TODO Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-content {
  position: relative;
  max-width: 95%;
  max-height: 95vh;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 95vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.close-btn {
  position: absolute;
  top: -18px;
  right: -18px;
  background: #fff;
  color: #222;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  transition:
    color ease-in-out 300ms,
    background-color ease-in-out 300ms;
}

.close-btn:hover {
  background: #e74c3c;
  color: white;
}

/* lightbox adaptive */
@media (max-width: 900px) {
  .top-grid .bottom-block {
    grid-template-columns: 1fr 1fr;
  }
}

/* Nav arrows */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  color: var(--bg-dark);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  user-select: none;
  transition: all 300ms ease-in-out;
  z-index: 10;
}

.nav-btn:hover {
  background: var(--bg-light);
  transform: translateY(-50%) scale(1.1);
}

.prev-btn {
  left: -70px;
}

.next-btn {
  right: -70px;
}

/* arrow adaptive */
@media (max-width: 768px) {
  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 26px;
  }
  .prev-btn {
    left: -25px;
  }
  .next-btn {
    right: -25px;
  }
}

/* TODO Founder section */

.founder-wrapper {
  display: flex;
  flex-direction: column;
  padding-block: var(--container-block);
  padding-inline: var(--container-padding);
  gap: 24px;
  overflow: hidden;
  @media screen and (width > 1158px) {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.founder-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  order: 2;
  @media screen and (width > 1158px) {
    order: 1;
  }
}

.founder-img {
  object-fit: contain;
  transition: scale ease-in-out 300ms;
  order: 1;
  padding-bottom: 2rem;
  @media screen and (width > 1158px) {
    order: 2;
    padding-bottom: 0;
  }
}

.founder__title-wrap {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 0.8rem + 1vw, 1.125rem);
  margin-bottom: clamp(1rem, 1rem + 0.8vw, 2rem);
}

.founder-icon {
  width: clamp(18px, 1.2vw, 26px);
  height: auto;
  fill: light-dark(var(--bg-dark), var(--bg-light));
}

.founder-title {
  font-size: var(--title-size);
  font-weight: 500;
  color: light-dark(var(--bg-dark), var(--bg-light));
}

.founder-info {
  font-size: var(--font-size);
  font-weight: 400;
  line-height: 1.4;
  color: light-dark(var(--bg-dark), var(--bg-light));
  max-width: 39rem;
  margin-bottom: 2rem;
}

.founder_btn {
  margin-top: auto;
  text-align: center;
  background-color: transparent;
  color: light-dark(var(--bg-dark), var(--bg-light));
  border: 1px solid light-dark(var(--bg-dark), var(--bg-light));
  padding: clamp(10px, 0.8vw, 14px) clamp(32px, 3vw, 60px);
  min-width: clamp(180px, 12vw, 240px);
  min-height: clamp(44px, 3vw, 56px);
  font-size: clamp(14px, 0.9vw, 18px);
  cursor: pointer;
  transition: all ease-in-out 300ms;
  &:hover {
    background-color: light-dark(var(--bg-dark), var(--bg-light));
    color: light-dark(var(--bg-light), var(--bg-dark));
    translate: 0 -4px;
  }
  &:active {
    translate: 0 -2px;
  }
}

.footer-wrapper {
  margin-block: var(--container-block);
  padding-inline: var(--container-padding);
}

.footer-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--container-block);
}

.footer-title {
  display: flex;
  flex-direction: column;
  align-self: center;
  font-family: var(--second-family);
  font-weight: 300;
  font-size: 3.125rem;
  line-height: 1;
  color: light-dark(var(--accent-sub), var(--bg-light));
  & span {
    font-size: 1rem;
    letter-spacing: 0.0125em;
  }
}

.footer-up_icon {
  stroke: light-dark(var(--accent-sub), var(--bg-light));
  transition:
    opacity 300ms ease-in-out,
    scale 300ms ease-in-out;
}

.footer-up-link:hover {
  .footer-up_icon {
    opacity: 0.9;
    scale: 104%;
  }
}

.footer-nav {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.footer-list {
  @media screen and (width > 768px) {
    display: flex;
    align-items: flex-end;
    gap: 5rem;
  }
  @media screen and (width > 1158px) {
    gap: 9rem;
  }
  & a {
    color: light-dark(var(--bg-dark), var(--bg-light));
    font-weight: 300;
    transition: all ease-in-out 300ms;
    &:hover {
      color: var(--links);
    }
  }
}

.footer-sub--list {
  display: flex;
  flex-direction: column;
  @media screen and (width > 768px) {
    gap: 0.5rem;
  }
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-soc_icon {
  transition: stroke ease-in-out 300ms;
  fill: light-dark(var(--bg-dark), var(--bg-light));
}

.footer-soc_link {
  display: flex;
  transition: scale ease-in-out 300ms;
  &:hover {
    scale: 1.3;
    .footer-soc_icon {
      stroke: light-dark(var(--bg-dark), var(--bg-light));
    }
  }
}

#bpagency {
  color: light-dark(var(--bg-dark), var(--bg-light));
  @media screen and (width < 768px) {
    padding-top: 1.5rem;
  }
}

/* ── Toggle ── */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.75;
}

#theme-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-label {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 30px;
  cursor: pointer;
}

/* Track */
.toggle-label::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--toggle-track);
  border-radius: 999px;
  transition: background 0.4s ease;
}

/* Thumb */
.toggle-label::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--toggle-thumb);
  box-shadow: 0 1px 4px oklch(0% 0 0 / 0.25);
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.4s ease;
}

/* Checked state: slide thumb right */
#theme-toggle:checked + .toggle-label::after {
  transform: translateX(26px);
}

/* Icons inside thumb using text shadow tricks — sun ☀ / moon ☾ */
.toggle-label .icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.3s ease;
}
.icon-sun {
  left: 6px;
}
.icon-moon {
  right: 6px;
}

/* Hide moon in light mode, hide sun in dark mode */
.icon-moon {
  opacity: 0.35;
}
#theme-toggle:checked ~ .toggle-wrap .icon-sun {
  opacity: 0.35;
}
