:root {
  --content-width: 70%;
  --header-height-logo: 80px;
  --header-bg: rgba(255, 255, 255, 1);
  --header-bg-scrolled: rgba(255, 255, 255, 0.3);
  --transition: 0.4s ease;
  --link-underline-duration: 1s;
  --accent: #111;
  --muted: #666;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent !important;
}

html {
  position: relative;
  min-height: 100%;
  scroll-behavior: smooth;
}

@font-face {
  font-family: "Poppins-ExtraLight";
  src: url("fonts/Poppins-ExtraLight.ttf");
}

@font-face {
  font-family: "Poppins-Light";
  src: url("fonts/Poppins-Light.ttf");
}

@font-face {
  font-family: "Poppins-Regular";
  src: url("fonts/Poppins-Regular.ttf");
}

@font-face {
  font-family: "Poppins-Medium";
  src: url("fonts/Poppins-Medium.ttf");
}

body {
  margin: 0;
  font-family: "Poppins-Light";
  color: var(--accent);
  background-color: #f4f4f4;
  -webkit-font-smoothing: antialiased;
}

body p {
  color: var(--muted);
}

/* page container */
.page {
  max-width: var(--max-page-width);
  margin: 0 auto;
  padding: 0 10px;
}

/* header */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--header-bg);
  transition: background var(--transition), padding var(--transition);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

/*
header.site-header.scrolled {
  background: var(--header-bg-scrolled);
  backdrop-filter: blur(6px);
}
  */

/* header content that respects content width 80% */
.header-inner {
  width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all var(--transition);
  padding: 16px 0 28px 0;
}

/* logo */
.logo {
  height: var(--header-height-logo);
  padding-top: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height var(--transition), transform var(--transition);
}

.logo img {
  max-height: 100%;
  display: block;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

/* menu sits 100px below logo in desktop initial state */
nav.main-nav {
  margin-top: 100px;
  width: 100%;
}

/* desktop menu style */
.menu {
  font-size: 1rem;
  display: flex;
  justify-content: center;
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu > li {
  position: relative;
}

.menu a {
  text-decoration: none;
  padding: 8px 4px;
  color: var(--accent);
  position: relative;
  display: inline-block;
}

.menu a:hover {
  color: #25949c;
}

/* underline effect from center */
.menu a::after {
  content: "";
  position: absolute;
  height: 2px;
  left: 50%;
  right: 50%;
  bottom: -2px;
  background: #25949c;
  transform-origin: center;
  transition: left var(--link-underline-duration) ease,
    right var(--link-underline-duration) ease;
}

.menu a:hover::after,
.menu a:focus::after {
  left: 0;
  right: 0;
}

/* submenu (desktop) - vertically stacked */
.submenu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 160px;
  background-color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 8px 0;
  display: none;
  flex-direction: column;
}

.submenu a {
  display: block;
  padding: 10px 14px;
  color: var(--accent);
}

/* show on hover for desktop */
.menu > li.portfolio:hover > .submenu.openonhover,
.menu > li.portfolio:focus-within > .submenu.openonhover {
  display: flex;
}

/* when scrolled: change layout to logo left and menu right, both aligned to content width */
header.site-header.scrolled .header-inner {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

header.site-header.scrolled .logo {
  transform: translateX(0) scale(40%);
  padding-top: 0;
  margin-right: 12px;
}

header.site-header.scrolled nav.main-nav {
  margin-top: 0;
}

/* back to top button */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1200;
  /*box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);*/
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

/* main content */
main {
  padding-top: calc(var(--header-height-logo) + 100px);
  width: 100%;
  text-align: center;
}

.content {
  width: var(--content-width);
  margin: 0 auto 100px auto;
  padding: 0;
}

/* section styles */
section {
  padding: 48px 0;
}

section p {
  line-height: 1.6;
}

/* main h2 on landing page */
.welcome {
  font-family: "Poppins-Regular";
  font-size: 28px;
  font-weight: 400;
  color: #25949c;
}

/* section expertise */

.expertise .expertise-icon {
  width: 10%;
  display: block;
  margin: 80px auto 20px auto;
}

.expertise h3 {
  text-transform: uppercase;
  width: 25%;
  margin: 0 auto 30px auto;
  padding-bottom: 10px;
}

.expertise .petrol {
  color: #44a8a5;
  border-bottom: 3px solid #44a8a5;
}

.expertise .rose {
  color: #cf868c;
  border-bottom: 3px solid #cf868c;
}

.expertise .violet {
  color: #7d667f;
  border-bottom: 3px solid #7d667f;
}

.expertise .marine {
  color: #4f9c9c;
  border-bottom: 3px solid #4f9c9c;
}

.expertise ul {
  list-style-type: none;
  padding: 0;
}

.expertise ul li {
  margin-bottom: 10px;
}

/* my Work grid */
.work-grid {
  margin-top: 50px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.work-item {
  perspective: 1200px;
  cursor: pointer;
  position: relative;
  min-height: 160px;
  overflow: visible;
  margin-top: 16px;
}

.flip-card {
  width: 100%;
  height: 110%;
  transform-style: preserve-3d;
  transition: transform 0.7s;
  position: relative;
}

.flip-card .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.flip-card .front img,
.flip-card .back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flip-card .back {
  transform: rotateY(180deg);
}

#workGrid .flip-card.flip {
  transform: rotateY(180deg);
}

/* intro animation */
.reveal {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* portfolio grid */
.portfolio-grid {
  margin-top: 50px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.portfolio-item {
  position: relative;
  min-width: 220px;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* portfolio intro title*/
.portfolio-intro-title {
  grid-column: 1 / -1;
  margin-bottom: 0;
  text-align: left;
}

/* portfolio intro paragraph*/
.portfolio-intro {
  grid-column: 1 / -1;
  font-family: "Poppins-Regular";
  font-size: 16px;
  line-height: 1.6;
  margin: 10px 0 20px 0;
  text-align: left;
}

/* lightbox h3 */

h3 {
  margin-bottom: 50px;
}

/* lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 2000;
}

.lightbox.open {
  display: flex;
}

.lightbox .lb-inner {
  position: relative;
  max-width: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: 0;
  color: rgb(110, 107, 107);
  font-size: 20px;
  cursor: pointer;
}

.lightbox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgb(110, 107, 107);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 10px;
}

.lightbox .nav.prev {
  left: 10px /* default margin 50px */;
}

.lightbox .nav.next {
  right: 10px /* default margin 50px */;
}

.lightbox .nav.prev.hidden {
  display: none;
}

.lightbox .nav.next.hidden {
  display: none;
}

/* software & web technologies */
.technologies .techno-title {
  margin: 50px 0 20px 0;
}

.technologies img {
  display: block;
  width: 100px;
  margin: 30px auto;
}

.technologies a {
  font-family: "Poppins-Regular";
  display: block;
  text-decoration: none;
  color: #25949c;
  margin-bottom: 5px;
}

.technologies a:hover {
  color: #cf868c;
}

/* contact form */
.contact-form {
  max-width: 720px;
  margin: 50px auto 0 auto;
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  gap: 12px;
}

.row .col {
  flex: 1;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 14px;
  font-family: "Poppins-Light";
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

::placeholder {
  font-family: "Poppins-Regular";
}

button.btn {
  padding: 10px 20px;
  font-family: "Poppins-Light";
  border: 0;
  border-radius: 10px;
  background-color: #25bfbf;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

button.btn:hover {
  background-color: #fabeac;
  color: #000;
}

.highlighted {
  font-family: "Poppins-Medium";
}

/* footer */
footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  background-color: #fff;
  margin-top: 32px;
}

.footer-inner {
  width: var(--content-width);
  margin: 0 auto;
  text-align: center;
}

a.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* hover flip on non-touch devices */
@media (hover: hover) {
  .work-item:hover .flip-card {
    transform: rotateY(180deg);
  }
}

/* mobile / responsive adjustments */
@media (max-width: 600px) {
  .portfolio-grid {
    grid-template-columns: 1fr; /* 1 per row */
  }
}

@media (max-width: 768px) {
  .content {
    margin-bottom: 150px;
  }

  .lightbox .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .lightbox .nav {
    display: none;
  }

  .lightbox .lb-inner {
    max-width: 100%;
  }

  .expertise .expertise-icon {
    width: 45%;
  }

  .expertise h3 {
    width: 75%;
  }
}

@media ((min-width: 769px) and (max-width: 991px)) {
  .work-item {
    width: 100%;
    margin: 0 auto;
    margin-bottom: 16px;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 per row */
  }

  .lightbox .lb-inner {
    max-width: 100%;
  }

  .expertise .expertise-icon {
    width: 20%;
  }

  .expertise h3 {
    width: 50%;
  }
}

@media (max-width: 991px) {
  :root {
    --header-height-logo: 50px;
  }

  /* logo smaller on mobile */
  .header-inner {
    width: 100%;
    padding: 12px;
    align-items: stretch;
  }

  .logo {
    height: var(--header-height-logo);
    justify-content: flex-start;
    padding-left: 16px;
  }

  /* menu becomes hamburger */
  .menu {
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .menu.open {
    display: flex;
  }

  nav.main-nav {
    margin-top: 0;
  }

  /* mobile menu full width when opened */
  .mobile-menu-wrap {
    width: 100%;
  }

  .menu > li {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding: 12px 18px;
  }

  .menu a {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
  }

  .submenu {
    position: static;
    display: none;
    padding-left: 14px;
    background: transparent;
    box-shadow: none;
  }

  .submenu.open {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .hamburger {
    background: none;
    border: 0;
    padding: 10px;
    margin-right: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-right: 16px;
  }

  .header-inner.scrolled-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  /* menu when visible should be full width */
  .menu-panel {
    width: 100%;
    background-color: rgba(255, 255, 255, 1);
    transition: opacity var(--transition);
  }
  .content {
    width: 100% !important;
  }
}

@media (max-width: 991px) {
  header.site-header {
    padding: 40px 0;
  }

  header.site-header.scrolled {
    padding: 20px 20px 20px 0;
  }

  header.site-header.scrolled .logo {
    transform: scale(60%);
  }

  .header-inner {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 0;
  }

  #logoWrap {
    margin-top: 0;
    padding: 30px 20px;
  }

  .logo {
    padding: 20px 10px;
  }

  .logo img {
    height: 80px;
    width: auto;
  }

  .hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0 0 8px;
  }

  /* hamburger and X same size and same position */
  .hamburger svg {
    width: 24px;
    height: 24px;
  }

  /* mobile menu overlay below the header */
  .mobile-menu-wrap {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
  }

  .menu {
    font-size: 1.1rem;
  }

  .submenu {
    display: none;
  }

  .submenu.open {
    display: block;
  }

  .portfolio .plus {
    cursor: pointer;
    font-size: 20px;
    margin-right: 8px;
    user-select: none;
  }

  .content {
    font-size: 1.1rem;
    width: 90% !important;
    padding-bottom: 50px;
  }
}

@media ((min-width: 992px) and (max-width: 1199px)) {
  .menu {
    font-size: 1.1rem;
  }

  .content {
    font-size: 1.1rem;
  }

  .lightbox .lb-inner {
    width: 100%;
  }

  .expertise .expertise-icon {
    width: 20%;
  }

  .expertise h3 {
    width: 50%;
  }
}

/* when scrolled on wide screens menu to right respecting 80% content width */
@media (min-width: 992px) {
  .header-inner {
    flex-direction: column;
    align-items: center;
    padding-top: 12px;
    padding-bottom: 30px;
  }

  header.site-header.scrolled .header-inner {
    flex-direction: row;
  }

  header.site-header.scrolled nav.main-nav {
    width: 60%;
  }

  header.site-header.scrolled .menu {
    justify-content: flex-end;
  }

  .hamburger,
  .plus {
    display: none;
  }
}

@media ((min-width: 1200px) and (max-width: 1400px)) {
  .menu {
    font-size: 1.1rem;
  }

  .content {
    font-size: 1.1rem;
    padding-bottom: 50px;
  }

  .expertise .expertise-icon {
    width: 20%;
  }

  .expertise h3 {
    width: 50%;
  }
}

@media (min-width: 1401px) {
  .content {
    padding-bottom: 50px;
  }
}
