* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --lighter_charcoal: #353434; 
    --charcoal: #1C1C1C;
    --off-white: #F9F9F9;
    --white: #FFFFFF;
    --card-height: 50vw;
    --mobile-card-height: 150vw;
    --card-margin: 4vw;
    --card-top-offset: 1.5em;
    --numcards: 6;
    --outline-width: 0px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--off-white);
    color: var(--charcoal);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    background: transparent;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo{
    width: 80px;
    height: 80px;
    background: url("assets/Nomad-logo-white.png");
    background-size: contain;
    background-position: center;
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.6;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(180deg, var(--lighter_charcoal) 0%, var(--charcoal) 100%);
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 1;
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  color: white;
  text-align: center;
  padding: 0 2rem;
}

.hero-content h1 {
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 900;
    color: var(--white);
    margin-bottom: 30px;
    line-height: 0.9;
    letter-spacing: -0.02em;
    text-shadow: 2px 2px 4px #000000;
}

.hero-content .subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--off-white);
    opacity: 0.7;
    margin-bottom: 50px;
    font-weight: 300;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background-color: var(--white);
    color: var(--charcoal);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--white);
}

.cta-button:hover {
    background-color: transparent;
    color: var(--white);
}

/* About Section */
.about {
    padding: 120px 5%;
    background-color: var(--charcoal);
    color: var(--white);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 30px;
    line-height: 1.1;
}

.byline{
    font-size: 20px;
    margin-bottom: 30px;
}

.about-grid {
    display: grid;
    gap: 80px;
    align-items: center;
}

.about-text {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.7;
}

.about-text p {
    margin-bottom: 25px;
}

.founders{
    display: flex;
    justify-content: space-between;
}

.founder-info {
    background: rgba(255, 255, 255, 0.05);
    max-width: 600px;
    padding: 40px;
    border-left: 3px solid var(--white);
}

.founder-info .founder-title{
    display: flex;
    margin-bottom: 25px;
}

.founder-info .founder-title .founder-img {
    width: 50px;
    height: 50px;
    margin-right: 20px;
    border-radius: 23px;
}

.founder-info .founder-title h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* Services Section */
.services {
    padding: 120px 5%;
    background-color: var(--off-white);
}

/* Portfolio Section */
.phil-wrapper{
    background: #eee;
    border-radius: 8px;
    padding: 40px;
    color: #333;
    margin-bottom: 70px;
}

.portfolio {
    padding: 120px 5%;
    background-color: var(--white);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 80px;
}

.portfolio-item {
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--charcoal);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bsg{
    background: url('assets/strategy-img.jpg');
    background-size: cover;
    background-position: center;
}

.dms{
    background: url('assets/dmedia.jpg');
    background-size: cover;
    background-position: center;
}

.cp{
    background: url('assets/content-production.jpg');
    background-size: cover;
    background-position: center;
}

.bs{
    background: url('assets/brand-story.jpg');
    background-size: cover;
    background-position: center;
}

.wd{
    background: url('assets/webdev.jpg');
    background-size: cover;
    background-position: center;
}

/* Style the tab */
.tab {
  overflow: hidden;
  border-bottom: 1px solid #ccc;
  display: flex;
  max-width: 1000px;
  margin: 0 auto;
  justify-content: space-between;
}

/* Style the buttons inside the tab */
.tab button {
  background-color: inherit;
  float: left;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 16px;
  transition: 0.3s;
  font-size: 17px;
  width: calc(100%/5);
}

/* Change background color of buttons on hover */
.tab button:hover {
  background-color: #ddd;
}

/* Create an active/current tablink class */
.tab button.active {
  background-color: #ccc;
}

/* Style the tab content */
.tabcontent {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  -webkit-animation: fadeEffect 1s;
  animation: fadeEffect 1s;
  max-width: 1000px;
  margin: 0 auto;
}

.tabcontent .content{
    width: 50%;
}

.tabcontent .content h3{
    font-size: 2em;
    margin-bottom: 20px;
}

.tabcontent .content ul{
    margin-left: 20px;
}

.tabcontent .img{
    width: 40%;
}

.tabimg{
    max-width: 100%;
    border-radius: 20px;
}

/* Fade in tabs */
@-webkit-keyframes fadeEffect {
  from {opacity: 0;}
  to {opacity: 1;}
}

@keyframes fadeEffect {
  from {opacity: 0;}
  to {opacity: 1;}
}

/* Contact Section */
.contact {
    padding: 120px 5%;
    background-color: var(--charcoal);
    color: var(--white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    margin-top: 60px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-size: 1rem;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

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

.submit-btn {
    padding: 20px 40px;
    background-color: var(--white);
    color: var(--charcoal);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.contact-info p {
    margin-bottom: 20px;
    opacity: 0.9;
}

/* Footer */
.footer {
    padding: 40px 5%;
    background-color: var(--charcoal);
    color: var(--white);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-section {
  background: #121212;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6rem 2rem;
  position: relative;
  overflow: hidden;
}

.contact-container {
  width: 1200px;
  text-align: left;
  z-index: 2;
  animation: fadeInUp 0.8s ease-in-out;
}

.contact-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.contact-header h3 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff; /* accent brand color */
}

.contact-header p {
  color: #bbb;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.contact-info p {
  margin: 0.6rem 0;
  font-size: 1rem;
}

.contact-info a {
  color: #fff;
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.cta-button {
  display: inline-block;
  margin-top: 2rem;
  background: #fff;
  color: #121212;
  padding: 0.9rem 2rem;
  font-weight: 600;
  border-radius: 40px;
  text-decoration: none;
  transition: transform 0.3s ease, background 0.3s ease;
}

.cta-button:hover {
  transform: translateY(-3px);
  background: #333;
  color: #fff;
}

/* subtle moving background gradient to give depth */
.contact-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.06), transparent 70%),
              radial-gradient(circle at 80% 70%, rgba(245,196,0,0.08), transparent 70%);
  animation: moveGradient 10s linear infinite;
  z-index: 1;
}

@keyframes moveGradient {
  0% { background-position: 0 0, 100% 100%; }
  100% { background-position: 100% 100%, 0 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}


/* Smooth Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.slow {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

#cards {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: center;
  grid-gap: 30px;
}

.card {
  position: relative;
  max-width: 400px;
}

.card figure {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.card figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.5) 100%);
  z-index: 1;
  transition: background 0.3s ease;
}

.card figure img {
  display: block;
  width: 100%;
  height: auto;
}

.card figure figcaption {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  color: white;
  z-index: 2;
}

.card:hover figure figcaption{
    display: none;
}

.card .card-content div {
  position: absolute;
  bottom: 3rem;
  left: 1rem;
  width: 90%;
  color: white;
  z-index: 2;
  opacity: 0;                 /* hidden by default */
  transform: translateY(10px); /* start slightly lower */
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* On hover: darken gradient and fade in text */
.card:hover figure::after {
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,1) 100%);
}

.card:hover .card-content div {
  opacity: 1;
  transform: translateY(0);
}


/* Animation */
@supports (animation-timeline: works) {

  @scroll-timeline cards-element-scrolls-in-body {
    source: selector(body);
    scroll-offsets:
      selector(#cards) start 1,
      selector(#cards) start 0
    ;
    start: selector(#cards) start 1;
    end: selector(#cards) start 0;
    time-range: 4s;
  }

  .card {
    --index0: calc(var(--index) - 1);
    --reverse-index: calc(var(--numcards) - var(--index0));
    --reverse-index0: calc(var(--reverse-index) - 1);
  }
  
  .card__content {
    transform-origin: 50% 0%;
    will-change: transform;

    --duration: calc(var(--reverse-index0) * 1s);
    --delay: calc(var(--index0) * 1s);

    animation: var(--duration) linear scale var(--delay) forwards;
    animation-timeline: cards-element-scrolls-in-body;
  }

  @keyframes scale {
    to {
      transform:
        scale(calc(
          1.1
          -
          calc(0.1 * var(--reverse-index))
        ));
    }
  }
}

.contact-header h2::after {
  content: "";
  display: block;
  width: 80px;
  height: 2px;
  margin-top: 10px;
  background: linear-gradient(90deg, rgba(255,255,255,0.3), #fff, rgba(255,255,255,0.3));
  animation: glow 3s linear infinite;
}

@keyframes glow {
  0%,100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .services-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    #cards{
        display: flex;
        flex-direction: column;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .card{
        position: relative;
        top: 0px;
        padding-top: 0px;
        max-height: max-content;
        margin-bottom: 25px;
    }

    .card-content{
        display: flex;
        flex-direction: column-reverse;
    }

    .services{
        padding: 50px 5%;
    }

    .founders{
        flex-direction: column;
    }

    .tabcontent{
        flex-direction: column;
    }

    .tabcontent .img{
        width: 100%;
        margin-bottom: 20px;
    }

    .tabcontent .content{
        width: 100%;
        margin-bottom: 20px;
    }
}