@import url("https://fonts.googleapis.com/css2?family=Ibarra+Real+Nova:wght@400;700&family=Public+Sans:wght@300;400;700&display=swap");

:root {
  /* Colors */
  --cyan: #5fb4a2;
  --dark-blue: #203a4c;
  --grayish-dark-blue: #33323d;
  --very-light-gray: #fafafa;
  --light-gray: #eaeaeb;
  --bright-red: #f43030;
  --white: #ffffff;
  --black: #000000;

  /* Fonts */
  --font-heading: "Ibarra Real Nova", serif;
  --font-body: "Public Sans", sans-serif;

  /* Spacing */
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 32px;
  --spacing-xl: 64px;
  --spacing-xxl: 96px;

  /* Container */
  --container-width: 1110px;
  --container-padding: 32px;
}

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

* {
  margin: 0;
  padding: 0;
}

/* Smooth scrolling for all anchor links */
html {
  scroll-behavior: smooth;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-family: var(--font-body), sans-serif;
  color: var(--grayish-dark-blue);
  background-color: var(--very-light-gray);
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading), serif;
  font-weight: 700;
  line-height: 1.1;
}

h1 {
  font-size: 50px;
  line-height: 50px;
  letter-spacing: -0.45px;
}

h2 {
  font-size: 40px;
  line-height: 42px;
  letter-spacing: -0.36px;
}

h3 {
  font-size: 32px;
  line-height: 36px;
  letter-spacing: -0.29px;
}

p {
  font-size: 16px;
  line-height: 30px;
  opacity: 0.8;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

/* Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  flex: 1;
}

.btn {
  display: inline-block;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 17px 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--dark-blue);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--cyan);
}

.btn-secondary {
  background-color: transparent;
  color: var(--grayish-dark-blue);
  border-color: var(--grayish-dark-blue);
}

.btn-secondary:hover {
  background-color: var(--grayish-dark-blue);
  color: var(--white);
}

.btn-disabled {
  background-color: var(--light-gray);
  color: var(--white);
  cursor: not-allowed;
}

.btn-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

/* Info Bar */
.info-bar {
  background-color: var(--grayish-dark-blue);
  color: var(--white);
  padding: 12px 0;
  font-size: 14px;
}

.info-bar-content {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.info-bar-left {
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.info-bar-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-bar-item a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s ease;
}

.info-bar-item a:hover {
  color: var(--cyan);
}

.info-bar-right {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.info-bar-social {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
}

.info-bar-social a {
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.info-bar-social a:hover {
  color: var(--cyan);
}

/* Mobile styles for info bar */
@media (max-width: 767px) {
  .info-bar {
    font-size: 12px;
    padding: 10px 0;
  }

  .info-bar-content {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .info-bar-left {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .info-bar-right {
    width: 100%;
  }
}

/* Navigation */
header {
  padding: 32px 0;
  margin-bottom: 40px;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Navigation Links - Desktop Default */
.nav-links {
  display: flex;
  gap: 42px;
  list-style: none;
}

.nav-links a {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--grayish-dark-blue);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--cyan);
}

/* CSS-only Hamburger Menu - Hidden on Desktop */
#menuToggle input {
  display: none;
}

#menuToggle span {
  display: none;
}

/* Footer */
footer {
  background-color: var(--grayish-dark-blue);
  color: var(--white);
  padding: 24px 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 42px;
}

.footer-links {
  display: flex;
  gap: 42px;
  list-style: none;
}

.footer-links a {
  color: var(--white);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.footer-links a:hover {
  color: var(--cyan);
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links svg {
  fill: var(--white);
  transition: fill 0.3s ease;
}

.social-links a:hover svg {
  fill: var(--cyan);
}

/* Footer Mobile Styles */
@media (max-width: 600px) {
  footer {
    padding: 56px 0;
  }

  .footer-content {
    flex-direction: column;
    gap: 40px;
    text-align: center;
  }

  .footer-left {
    flex-direction: column;
    gap: 40px;
    width: 100%;
  }

  .footer-links {
    flex-direction: column;
    gap: 32px;
  }

  .social-links {
    justify-content: center;
  }
}

/* Mobile Menu */
@media (max-width: 768px) {
  /* Show hamburger menu toggle */
  #menuToggle {
    display: block;
    position: relative;
    z-index: 1000;
    -webkit-user-select: none;
    user-select: none;
  }

  #menuToggle input {
    display: block;
    width: 40px;
    height: 32px;
    position: absolute;
    top: -7px;
    left: -5px;
    cursor: pointer;
    opacity: 0;
    z-index: 2;
    -webkit-touch-callout: none;
  }

  #menuToggle span {
    display: block;
    width: 33px;
    height: 4px;
    margin-bottom: 5px;
    position: relative;
    background: var(--grayish-dark-blue);
    border-radius: 3px;
    z-index: 1;
    transform-origin: 4px 0;
    transition:
      transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1),
      background 0.5s cubic-bezier(0.77, 0.2, 0.05, 1),
      opacity 0.55s ease;
  }

  #menuToggle span:first-child {
    transform-origin: 0 0;
  }

  #menuToggle span:nth-last-child(2) {
    transform-origin: 0 100%;
  }

  #menuToggle input:checked ~ span {
    opacity: 1;
    transform: rotate(45deg) translate(-2px, -1px);
    background: var(--grayish-dark-blue);
  }

  #menuToggle input:checked ~ span:nth-last-child(3) {
    opacity: 0;
    transform: rotate(0deg) scale(0.2, 0.2);
  }

  #menuToggle input:checked ~ span:nth-last-child(2) {
    transform: rotate(-45deg) translate(0, -1px);
  }

  /* Hide default navigation links and show as slide-out menu */
  #menu {
    position: fixed;
    top: 0;
    left: 0;
    max-width: 400px;
    width: 80vw;
    height: 100vh;
    margin: 0;
    padding: 50px 32px;
    padding-top: 125px;
    box-sizing: border-box;
    overflow-y: auto;
    background: var(--very-light-gray);
    border-right: 1px solid var(--light-gray);
    list-style-type: none;
    -webkit-font-smoothing: antialiased;
    transform-origin: 0 0;
    transform: translate(-100%, 0);
    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1);
    flex-direction: column;
    gap: 32px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
    z-index: 999;
  }

  /* Show menu when checkbox is checked */
  #menuToggle input:checked ~ ul {
    transform: translate(0, 0);
  }

  #menu li {
    padding: 10px 0;
    font-size: 18px;
    text-align: center;
  }

  .nav-links a {
    color: var(--grayish-dark-blue);
    font-size: 14px;
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--cyan);
  }
}

/* Homepage Styles */
.hero {
  position: relative;
  margin-bottom: 150px;
}

.hero-image img {
  width: 100%;
  object-fit: cover;
}

.hero-content {
  background-color: var(--white);
  padding: 56px 56px 0 0;
  max-width: 445px;
  position: absolute;
  bottom: 0;
  left: 0;
}

.hero-content h1 {
  margin-bottom: 53px;
  /* Modern text wrapping for balanced lines */
  text-wrap: balance;
  /* Better line-height using unitless value */
  line-height: 1.2;
}

.about {
  display: flex;
  gap: 125px;
  margin-bottom: 150px;
  align-items: flex-start;
}

.about-image {
  flex: 1;
}

.about-content {
  flex: 1;
  padding-top: 50px;
  border-top: 1px solid var(--light-gray);
  border-bottom: 1px solid var(--light-gray);
  padding-bottom: 50px;
}

.about-content h2 {
  margin-bottom: 28px;
}

.about-content p {
  margin-bottom: 24px;
}

/* Skills Section */
.skills {
  padding: 80px 0;
  margin-bottom: 80px;
}

.skills-header {
  text-align: center;
  margin-bottom: 64px;
}

.skills-header h2 {
  margin-bottom: 16px;
  color: var(--grayish-dark-blue);
}

.skills-header p {
  color: var(--grayish-dark-blue);
  font-size: 16px;
  opacity: 0.8;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  max-width: var(--container-width);
  margin: 0 auto;
}

.skill-card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.skill-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--cyan);
}

.skill-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: var(--very-light-gray);
  border-radius: 50%;
  color: var(--cyan);
  transition: all 0.3s ease;
}

.skill-icon img {
  transition: all 0.3s ease;
}

.skill-card:hover .skill-icon {
  background: var(--cyan);
  color: var(--white);
  transform: scale(1.1);
}

.skill-card:hover .skill-icon img {
  filter: brightness(0) invert(1);
}

.skill-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--grayish-dark-blue);
  margin: 0;
}

/* Responsive Skills */
@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .skills {
    padding: 60px 0;
    margin-bottom: 60px;
  }

  .skills-header {
    margin-bottom: 48px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .skill-card {
    padding: 24px 16px;
  }

  .skill-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
  }

  .skill-icon img {
    width: 32px;
    height: 32px;
  }

  .skill-card h3 {
    font-size: 16px;
  }
}

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

  .skill-card {
    padding: 20px;
  }
}

.contact-cta {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 150px;
}

.contact-cta h2 {
  flex-shrink: 0;
  max-width: 350px;
}

.contact-cta .line {
  height: 1px;
  background-color: var(--light-gray);
  flex-grow: 1;
}

/* Responsive Homepage */
@media (max-width: 768px) {
  .hero {
    margin-bottom: 96px;
  }

  .hero-content {
    position: static;
    max-width: 100%;
    padding: 56px 56px 0 0;
    margin-top: -50px;
    /* Overlap effect if desired, or just stack */
    background-color: var(--white);
  }

  /* Adjust for tablet layout where image is full width and content overlaps or sits below */
  .hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    margin: 0;
    padding: 56px 56px 0 0;
    max-width: 514px;
  }

  .about {
    flex-direction: column;
    /* Or keep row but adjust gap */
    gap: 48px;
    margin-bottom: 96px;
  }

  .about-image {
    width: 100%;
    /* Make image full width on tablet if needed, or keep side by side */
    /* Actually design shows side by side on tablet usually, let's check breakpoints */
  }
}

@media (max-width: 600px) {
  .hero-content {
    position: static;
    padding: 32px 0;
    max-width: 100%;
  }

  .hero-content h1 {
    font-size: 32px;
  }

  .hero-image img {
    width: 100%;
  }

  .about {
    flex-direction: column;
    gap: 32px;
    margin-bottom: 80px;
  }

  .contact-cta {
    flex-direction: column;
    text-align: center;
    gap: 24px;
    margin-bottom: 80px;
  }

  .contact-cta .line {
    display: none;
  }
}

/* Medium screens: slightly larger font */
@media (min-width: 601px) and (max-width: 768px) {
  .hero-content h1 {
    font-size: 40px;
  }
}

/* Portfolio Styles */
.portfolio-index {
  margin-bottom: 150px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.project-card {
  display: flex;
  align-items: center;
  gap: 125px;
}

.project-card.reverse {
  flex-direction: row-reverse;
}

.project-image {
  flex: 1;
}

.project-image img {
  width: 100%;
  object-fit: cover;
}

.project-content {
  flex: 1;
  padding-top: 50px;
  border-top: 1px solid var(--light-gray);
  border-bottom: 1px solid var(--light-gray);
  padding-bottom: 50px;
}

.project-content h2 {
  margin-bottom: 28px;
}

.project-content p {
  margin-bottom: 24px;
}

/* Responsive Portfolio */
@media (max-width: 900px) {
  .project-card {
    gap: 48px;
  }
}

@media (max-width: 768px) {
  .portfolio-index {
    margin-bottom: 96px;
  }

  .project-card {
    flex-direction: column;
    gap: 32px;
  }

  .project-card.reverse {
    flex-direction: column;
  }

  .project-image {
    width: 100%;
  }

  .project-content {
    width: 100%;
    padding-top: 32px;
    padding-bottom: 32px;
  }
}

@media (max-width: 600px) {
  .portfolio-index {
    margin-bottom: 80px;
  }
}

/* Project Detail Styles */
.project-detail-hero {
  margin-bottom: 115px;
}

.project-detail-hero img {
  width: 100%;
  object-fit: cover;
}

.project-intro {
  display: flex;
  gap: 125px;
  margin-bottom: 64px;
}

.project-intro-content {
  flex: 1;
  max-width: 350px;
}

.project-intro-content h1 {
  margin-bottom: 24px;
}

.project-intro-content p {
  margin-bottom: 24px;
}

.project-meta {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--light-gray);
  border-bottom: 1px solid var(--light-gray);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.meta-label {
  display: block;
  font-weight: 700;
  color: var(--cyan);
  font-size: 13px;
  margin-bottom: 16px;
}

.project-intro-background {
  flex: 2;
}

.project-intro-background h3 {
  margin-bottom: 28px;
}

.project-intro-background p {
  margin-bottom: 40px;
}

.static-previews {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 40px;
}

.static-previews img {
  width: 100%;
  object-fit: cover;
}

.project-navigation {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--light-gray);
  border-bottom: 1px solid var(--light-gray);
  margin-bottom: 115px;
}

.prev-project,
.next-project {
  flex: 1;
}

.prev-project a,
.next-project a {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 32px 0;
  width: 100%;
}

.next-project a {
  justify-content: flex-end;
  text-align: right;
  border-left: 1px solid var(--light-gray);
}

.nav-text h3 {
  font-size: 32px;
  margin-bottom: 4px;
}

.nav-text span {
  opacity: 0.5;
}

/* Responsive Project Detail */
@media (max-width: 768px) {
  .project-detail-hero {
    margin-bottom: 40px;
  }

  .project-intro {
    flex-direction: column;
    gap: 48px;
  }

  .project-intro-content {
    max-width: 100%;
  }

  .project-navigation {
    margin-bottom: 80px;
  }

  .prev-project a,
  .next-project a {
    padding: 24px 0;
  }

  .nav-text h3 {
    font-size: 24px;
  }
}

@media (max-width: 600px) {
  .project-navigation {
    flex-direction: column;
    border-bottom: none;
  }

  .prev-project,
  .next-project {
    border-bottom: 1px solid var(--light-gray);
  }

  .next-project a {
    border-left: none;
    flex-direction: row-reverse;
    justify-content: flex-end;
    text-align: right;
  }
}

/* Contact Styles */
.contact-wrapper {
  display: flex;
  gap: 125px;
  margin-bottom: 150px;
}

.contact-intro {
  flex: 1;
}

.contact-intro h1 {
  margin-bottom: 24px;
}

.contact-text p {
  margin-bottom: 24px;
}

.social-links-contact {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.social-links-contact svg {
  fill: var(--grayish-dark-blue);
  transition: fill 0.3s ease;
}

.social-links-contact a:hover svg {
  fill: var(--cyan);
}

.contact-form-container {
  flex: 1;
}

.contact-form-container h2 {
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 24px;
  position: relative;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 16px;
  background-color: var(--light-gray);
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--grayish-dark-blue);
  outline: none;
  transition: border-color 0.3s ease;
}

.form-group textarea {
  height: 96px;
  resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--cyan);
}

.form-group.error input,
.form-group.error textarea {
  border-color: var(--bright-red);
}

.error-message {
  display: none;
  color: var(--bright-red);
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  margin-top: 4px;
}

.form-group.error .error-message {
  display: block;
}

/* Responsive Contact */
@media (max-width: 768px) {
  .contact-wrapper {
    flex-direction: column;
    gap: 64px;
    margin-bottom: 96px;
  }
}

@media (max-width: 600px) {
  .contact-wrapper {
    margin-bottom: 80px;
  }
}
