/* Variables Declaration - Colors, Font Stacks, and Sizes */
:root {
  --black: #0f0f0f;
  --dark: #050505;
  --grey: #bcbcbc;
  --blue: #4e9ffc;
  --dark-grey: #161b22;
  --dark-grey:#1f1f1f;
  --purple: #a78bfa;;
  --lila: #a78bfa;
  --x: #c4b5fd;
  --white: #e6edf3;
  --font-size: 1.3rem;

  --font-primary: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
    font-primary-serif;
  --font-accent: "Courgette", cursive, font-primary-serif;
  --font-garet: "Garet", sans-serif;
}

/* Box Model Setup */
html {
  font-size: 16px;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

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

/* Utility Classes */
.section-black {
  background-color: var(--black);
}

.section-grey {
  background-color: var(--dark-grey);
}

.gradient {
  height: 2px;
  opacity: 0.7;
  background: linear-gradient(
    90deg,
    var(--purple) 2%,
    var(--blue) 16%,
    #a1ffff 32%,
    var(--purple) 49%,
    var(--blue) 66%,
    #a1ffff 82%,
    var(--purple) 98%
  );
}

/* Global Styles */
body {
  padding: 0;
  margin: 0;
  font-family: var(--font-primary);
  background: var(--black);
  color: var(--grey);
  font-size: var(--font-size);
  font-weight: 400;
  line-height: 1.6;
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

@media (max-width: 400px) {
  body {
    font-size: 1rem;
  }
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--white);
}

img {
  width: 100%;
}

/* Navbar Styles */
nav {
  font-family: var(--font-primary);
  font-size: 80%;
  padding: 1rem;
  background-color: rgba(15, 15, 15, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(5px);
}

nav .logo {
  position: relative;
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 600;
}

nav .logo a {
  font-size: 1.25rem;
  font-weight: 600;
  color: inherit;
  display: flex;
  align-items: center;
  display: inline-block;
  text-decoration: none;
  position: relative;
  z-index: 2;
}

nav .logo .svg-path {
  display: none;
  position: absolute;
  bottom: -2rem;
  width: 160px;
  height: auto;
  pointer-events: none;
}

nav [class*="fa-"] {
  font-size: 150%;
  color: var(--white);
  transition: color 0.3s ease;
}

nav [class*="fa-"]:hover {
  color: var(--purple);
}

nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

nav li:first-child {
  flex-basis: 100%;
  text-align: center;
}

nav a {
  color: var(--grey);
  text-decoration: none;
  display: block;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

nav a:hover,
nav svg:hover {
  color: var(--purple);
  text-shadow: 0 0 5px var(--purple);
}

.button {
  background-color: var(--purple);
  color: #fff;
  border: 1px solid var(--purple);
  text-align: center;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;

}

.button:hover {
  background-color: var(--lila);
  color: #fff;
}

@media (min-width: 850px) {
  nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;
  }

  nav ul {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  nav li:first-child {
    flex-basis: auto;
    text-align: left;
    margin-right: auto;
    width: auto;
  }
}

/* Footer Styles */
footer {
  text-align: center;
  padding: 4rem 0;
}

footer h2 {
  border-bottom: none;
  padding-bottom: 0;
}

footer ul {
  list-style-type: none;
  padding: 0;
  margin: 2rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

footer ul a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease,
    transform 0.2s ease;
}

footer ul a:hover {
  background: rgba(140, 121, 250, 0.15);
  border-color: var(--purple);
  color: var(--purple);
  transform: translateY(-2px);
}

footer ul a svg {
  width: 20px;
  height: 20px;
}

/* Intro and Contact Sections */

#intro {
  padding: 7rem 1rem 10rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.intro-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row-reverse;
  gap: 4rem;
  flex-wrap: wrap;
}

.profile-photo-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4rem;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  z-index: 0;
}

.profile-photo-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(20, 20, 20, 0.55) 0%,   /* alt kısmı biraz daha şeffaf */
    rgba(40, 40, 40, 0.35) 50%,  /* orta tonları açtık */
    rgba(60, 60, 60, 0.15) 100%  /* üstte oldukça açık */
  );  
  z-index: 10;
  pointer-events: none;
}

.intro-text {
  flex: 1;
  min-width: 280px;
}

#intro .name {
  font-family: var(--font-primary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

#intro .name span {
  font-family: var(--font-accent);
  font-size: 3rem;
  color: var(--purple);
  display: block;
  font-weight: 300;
  margin-bottom: 1rem;
}

#intro h2 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--white);
}

#intro p,
#about p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--grey);
}

#intro a {
  color: var(--lila);
  text-decoration: underline;
  transition: color 0.3s ease;
}

#intro a:hover {
  color: var(--x);
}

#contact {
  max-width: 1200px;
  text-align: center;
  padding: 4rem 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

#contact address {
  font-style: normal;
}

#contact a {
  text-decoration: none;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  transition: all 0.5s;
  background-color: transparent;
  color: var(--purple);
  border: 1px solid var(--purple);
}

#contact a:hover {
  color: var(--black);
  background-color: var(--purple);
}

#contact p:last-child {
  margin-top: 3rem;
}

@media (max-width: 768px) {
  #intro .intro-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .intro-text {
    padding: 0 1rem;
  }

  .profile-photo {
    width: 300px;
    height: 300px;
    object-fit: cover;
  }
}

/* Projects and About Sections */
#projects,
#about {
  padding: 4rem 1rem;
}

#projects h2,
#about h2 {
  font-size: 2.25rem;
  font-weight: 600;
  margin-bottom: calc(2.5rem * 1.5);
}

#projects article {
  display: block;
  margin-bottom: 4rem;
  padding: 0;
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  background-color: var(--dark-grey);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

#projects article {
  min-height: 450px;
}

@media (min-width: 640px) {
  #projects article {
    min-height: 550px;
  }
}

@media (min-width: 768px) {
  #projects article {
    min-height: 600px;
  }
}

@media (min-width: 1024px) {
  #projects article {
    min-height: 500px;
  }
}

#projects .header {
  margin-bottom: 1rem;
  padding: 2.5rem 2.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  padding: 0;
  color: #000;
}

.link-icon svg {
  width: 25px;
  height: 25px;
}

.link-icon:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

#projects .header-top {
  display: flex;
  justify-content: space-between;
  flex-direction: row-reverse;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
}

#projects .header h3 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  padding-bottom: 0;
}

#projects article.reverse .header-top {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

#projects .header .icons {
  display: flex;
  gap: 15px;
  align-items: center;
}

#projects .header .icon-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

#projects .header .icon-link:hover {
  color: #007bff;
}

#projects .header .tech-list {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

#projects article.reverse .header .tech-list {
  margin-left: auto;
  justify-content: flex-end;
}

#projects ul .item {
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  letter-spacing: 0.05em;
}

#projects .project-content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
}

@media (min-width: 640px) {
  #projects img {
    width: 75%;
  }
}

@media (min-width: 768px) {
  #projects img {
    width: 60%;
  }
}

@media (min-width: 1024px) {
  #projects img {
    width: 55%;
  }
}

#projects .text {
  width: 90%;
  /* max-w-[90%] */

  z-index: 10;
  text-align: left;
  padding: 0.25rem 2.5rem;
}

@media (min-width: 1024px) {
  #projects .text {
    max-width: 45%;
  }
}

@media (min-width: 768px) {
  #projects h3 {
    font-size: 2.5rem;
  }
}

#projects .blackbox {
  /* The project description text is NOT a blackbox card anymore. It's just a paragraph. */
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  margin-top: 1rem;
}

#projects .blackbox p {
  color: var(--grey);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 0;
  font-size: 1rem;
}

#projects .link-bar {
  position: absolute;
  top: 0;
  left: 0;
  margin-left: 1.5rem;
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

@media (min-width: 1024px) {
  #projects .link-bar {
    margin-left: 2.5rem;
    margin-top: 2.5rem;
  }
}

#projects .link-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--white);
  color: var(--black);
  padding: 0;
  transition: transform 0.2s ease;
  z-index: 20;
}

#projects .link-bar a:hover {
  transform: scale(1.1);
  background-color: var(--purple);
  color: var(--white);
}

#projects .link-bar svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}

/* 5. Tech Stack Styling */

/* The .link container is no longer needed but its inner link styling is used for consistency */
#projects .link a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

#projects .link:hover a {
  color: var(--purple);
}

/* --- Clean Up Old Project Styles --- */
/* Remove old styles that conflict with absolute positioning */
#projects .reverse {
  order: initial;
}

#projects article:last-child {
  margin-bottom: 4rem;
}

#projects h4 {
  display: none;
}

#projects .link {
  display: none;
}

#about .tech-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  max-height: 5rem;
}

#about h3 span {
  background-image: linear-gradient(to top, var(--purple) 50%, transparent 50%);
  background-size: 100% 4px;
  background-repeat: no-repeat;
  background-position: bottom;
  transition: background-size 0.4s ease-in-out,
    background-color 0.4s ease-in-out;
}

#about h3 span:hover {
  background-size: 100% 100%;
  background-color: var(--purple);
  color: var(--black);
  text-decoration: none;
}

#about .tech-list .item {

  display: inline-block;
  min-width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;

  text-align: center;
  font-size: 0.75rem;
  line-height: 1.25rem;
  font-weight: 400;
}

#about .tech-list .item span {
  background-color: #14532d;
  color: #4ade80;
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

}


.projects-list {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
}

.projects-list .item {
  display: inline-block;
}

.projects-list > a {
  display: inline-flex;
  align-items: center;
  font-size: 18px;
  font-weight: 500;
  color: var(--grey);
  text-decoration: none;
  position: relative;
  transition: all 0.3s ease-in-out;
}

.projects-list a:hover {
  color: var(--white);
}

.projects-list svg {
  font-size: 0.8rem;
  margin-right: 0.1rem;
  transition: transform 0.3s ease-in-out;
}

.projects-list a:hover svg {
  transform: translate(3px, -3px);
}

/* Timeline/Experience Section (Unchanged) */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  position: relative;
}

.timeline-item {
  position: relative;
}

.content-column {
  padding: 1rem;
}

.item-title {
  font-weight: 500;
  line-height: 1.3;
}

.date-range {
  display: inline-block;
  padding: 0 1rem;
}

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

.title-container {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
}

.date-range {
  letter-spacing: 0.025em;
  color: var(--grey);
  font-size: 0.75rem;
  text-transform: uppercase;
  position: relative;
}

.date-range .date-now {
  color: var(--purple);
  font-weight: 300;
}

/* Typography normalization for timeline */
.timeline-container,
.timeline-item,
.content-column,
.content-item {
  font-size: 1rem;
  line-height: 1.6;
}

.item-title {
  font-size: 1rem;
}

.content-item p {
  font-size: 1rem;
  line-height: 1.6;
}

.date-column {
  font-size: 1rem;
  line-height: 1.6;
}

.content-item a {
  text-decoration: none;
  color: var(--grey);
}

.title-container [class*="fa-"] {
  color: var(--white);
}

.title-container [class*="fa-"]:hover {
  color: var(--purple);
  transition: all 0.2s;
}

.item-description {
  color: var(--grey);
  margin: 0px;
  margin-top: 0.5rem;
}

/* Photo Gallery (Unchanged) */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0px;
  width: 100%;
  max-width: 100%;
  margin: auto;
  padding: 10px;
  justify-items: center;
}

.photo {
  width: 100%;
  height: auto;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 1;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.photo-1 {
  grid-column: 1 / 2;
  transform: rotate(-5deg) translate(-20px, 10px);
  z-index: 3;
}

.photo-2 {
  grid-column: 2 / 3;
  transform: rotate(3deg) translate(-15px, -10px);
  z-index: 4;
}

.photo-3 {
  grid-column: 3 / 4;
  transform: rotate(-3deg) translate(-10px, 20px);
  z-index: 2;
}

.photo-4 {
  grid-column: 4 / 5;
  transform: rotate(4deg) translate(-5px, -20px);
  z-index: 5;
}

.photo-5 {
  grid-column: 5 / 6;
  transform: rotate(-2deg) translate(-10px, 15px);
  z-index: 6;
}

.photo-6 {
  grid-column: 6 / 7;
  transform: rotate(5deg) translate(-8px, -12px);
  z-index: 4;
}

.icon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: inherit;
}

.icon-text {
  font-size: 12px;
  font-family: Arial, sans-serif;
  font-weight: bold;
}

.icon-container:hover .icon-wrapper {
  background: rgba(140, 121, 250, 0.1);
  border-radius: 4px;
}

.content-wrapper {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: stretch;
}

.experience {
  flex: 3;
}

.skills {
  flex: 1;
  min-width: 250px;
}

.skills h4 {
  padding-left: 5rem;
}

.skills .myskills-icons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 0rem;
  row-gap: 4.5rem;
  justify-items: center;
  align-items: center;
}

.icon-container img {
  width: 40px;
  height: auto;
}

/* Scroll to Top Button (Unchanged) */
#scrollToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  display: none;
  cursor: pointer;
  z-index: 1000;
}

#scrollToTop img {
  width: 100%;
  height: auto;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease;
}

#scrollToTop:hover img {
  opacity: 0.8;
  transform: translateY(-5px);
}

/* Media Queries - Screen Size Adjustments (Unchanged) */

@media (max-width: 480px) {
  .photo-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }

  .photo-1,
  .photo-3,
  .photo-5 {
    grid-column: 1 / 2;
  }

  .photo-2,
  .photo-4,
  .photo-6 {
    grid-column: 2 / 3;
  }
}

@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column;
  }

  .experience {
    margin-right: 0;
    margin-bottom: 20px;
  }

  .skills {
    margin-bottom: 20px;
  }

  .timeline-item {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .timeline-item::before {
    left: calc(1rem - 6px);
    top: 30px;
  }

  .date-column {
    order: -1;
    width: 100%;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
    padding-top: 0;
  }

  .content-column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
  }

  .content-item {
    display: flex;
    flex-direction: column;
  }

  .photo-gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .timeline-container {
    grid-template-columns: 1fr;
    padding-left: 1rem;
  }

  .timeline-container::before {
    left: 1rem;
  }

  .date-column {
    text-align: left;
    padding-right: 0;
  }
}

@media (min-width: 800px) {
  #projects,
  #about {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* 🔗 Floating Icon Links (GitHub + Demo) */
#projects .link-bar {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: flex;
  gap: 1rem;
  z-index: 20;
}

@media (min-width: 1024px) {
  #projects .link-bar {
    top: 2rem;
    left: 2rem;
  }
}

#projects .link-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  color: var(--black);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

#projects .link-bar a:hover {
  transform: scale(1.15);
  background-color: var(--purple);
  color: var(--white);
}

#projects .link-bar svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* 🧾 Optional: Better mobile fallback (stack below image) */
@media (max-width: 640px) {
  #projects .link-bar {
    position: static;
    margin: 1rem 0;
    justify-content: flex-start;
  }
}

@media (min-width: 768px) {
  #projects .header h3 {
    font-size: 2.4rem;
  }
}

/* GitHub icon styling */
#projects .header h3 a {
  color: var(--white);
  font-size: 1.4rem;
  transition: color 0.2s ease;
}

#projects .header h3 a:hover {
  color: var(--purple);
}

/* Ensure project content is flex row */
#projects article .project-content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  gap: 2rem;
}

/* Text block */
#projects article .text {
  width: 50%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Default layout: text left, image right */
#projects article:not(.reverse) .text {
  order: 1;
  padding-right: 2rem;
}

#projects article:not(.reverse) img {
  order: 2;
}

/* Reverse layout: text right, image left */
#projects article.reverse .text {
  order: 2;
  padding-left: 2rem;
  text-align: left;
}

#projects article.reverse img {
  order: 1;
}

/* Responsive: stack vertically on small screens */
@media (max-width: 900px) {
  #projects article .project-content {
    flex-direction: column;
  }

  #projects article .text,
  #projects article img {
    width: 100%;
    padding: 0;
    order: 0;
  }
}
