/* Sercan Aybastı — shared layout + page-specific overrides only */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

:root {
  /* Fluid typography scale */
  --fluid-scale: clamp(
    0.85,
    calc(100vw / 1440px),
    1.35
  );

  /* Typography */
  --font-size-h1: calc(6rem * var(--fluid-scale));
  --font-size-h2: calc(4rem * var(--fluid-scale));
  --font-size-h3: calc(2rem * var(--fluid-scale));
  --font-size-body: calc(1.5rem * var(--fluid-scale));
  --font-size-body2: calc(1.125rem * var(--fluid-scale));
  --font-size-navigation: calc(1rem * var(--fluid-scale));
  --font-size-tab: calc(0.875rem * var(--fluid-scale));
  --font-size-caption: calc(1rem * var(--fluid-scale));

  /* Sticky rail / project cover alignment */
  --sticky-rail-top: 2rem;
  --home-logo-height: 127px;
  --home-filters-block: calc(36px + 41px + 62px);
}

body {
  background: #ffffff;
  color: #595856;
  font-family: "Lato", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

figure {
  margin: 0;
}

/* —— Shared tokens —— */
.page {
  width: 100%;
  margin: 0 auto;
  background: #ffffff;
  --container-width: 76.851851851852%; /* 1328 / 1728 */
  --text-column-width: 50.347222222222%; /* 870 / 1728 */
  --logo-inset: 4.166666666667%; /* 72 / 1728 */
  --rule-color: #d3d0cb;
  --color-muted: #979695;
  --color-text: #595856;
}

.container {
  width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
}

.container--text {
  width: var(--text-column-width);
}

.main {
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* —— Index: sticky logo + pagination rail —— */
.home-content-layout {
  --projects-layout-gap: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  column-gap: var(--projects-layout-gap);
  padding-left: var(--logo-inset);
  align-items: stretch;
  box-sizing: border-box;
}

.home-sticky-rail {
  width: 80px;
  min-height: 100%;
  padding-top: var(--sticky-rail-top);
  box-sizing: border-box;
}

.home-sticky-rail__inner {
  position: sticky;
  top: var(--sticky-rail-top);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 80px;
  box-sizing: border-box;
  z-index: 5;
}

.home-sticky-rail__inner .site-logo--home {
  display: block;
  width: 80px;
  height: var(--home-logo-height);
  flex: 0 0 auto;
  line-height: 0;
}

.home-sticky-rail__inner .site-logo--home img {
  width: 80px;
  height: var(--home-logo-height);
  object-fit: contain;
}

.home-content-main {
  width: 100%;
  min-width: 0;
}

.projects-list {
  width: 100%;
  min-width: 0;
}

/* Keep project containers on the original full-page measure */
.home-content-main .container {
  width: calc(100vw * 0.76851851851852);
  margin-left: calc(100vw * 0.07407407407407 - 80px);
  margin-right: auto;
}

.project-pagination {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 80px;
  margin-top: var(--home-filters-block);
  margin-bottom: 0;
  padding-top: 0;
  box-sizing: border-box;
}

.project-pagination__item {
  width: 100%;
  padding: 0;
  padding-block: 0.5rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.project-pagination__item:first-child {
  margin-top: 0;
  padding-top: 0;
}

.project-pagination__line {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--rule-color);
}

.project-pagination__item.is-active .project-pagination__line {
  background: #000000;
}

.project-pagination__item:focus-visible {
  outline: 1px solid #000000;
  outline-offset: 2px;
}

.project-section {
  scroll-margin-top: var(--sticky-rail-top);
}

/* —— Information: sticky logo rail (matches index logo geometry) —— */
.info-content-layout {
  width: 100%;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  column-gap: 0;
  padding-left: var(--logo-inset);
  align-items: stretch;
  box-sizing: border-box;
}

.info-sticky-rail {
  width: 80px;
  min-height: 100%;
  padding-top: var(--sticky-rail-top);
  box-sizing: border-box;
}

.info-sticky-rail__inner {
  position: sticky;
  top: var(--sticky-rail-top);
  width: 80px;
  box-sizing: border-box;
  z-index: 5;
}

.info-sticky-rail__inner .site-logo--info {
  display: block;
  width: 80px;
  height: var(--home-logo-height);
  line-height: 0;
}

.info-sticky-rail__inner .site-logo--info img {
  width: 80px;
  height: var(--home-logo-height);
  object-fit: contain;
}

.info-content-main {
  width: 100%;
  min-width: 0;
}

/* Header container aligns with index; text column keeps its absolute start */
.info-content-main .container {
  width: calc(100vw * 0.76851851851852);
  margin-left: calc(100vw * 0.07407407407407 - 80px);
  margin-right: auto;
}

.info-content-main .container--text {
  width: calc(100vw * 0.50347222222222);
  margin-left: calc(100vw * 0.24826388888889 - 100vw * 0.04166666666667 - 80px);
  margin-right: auto;
}

/* —— Logo (shared) —— */
.site-logo {
  flex: 0 0 auto;
  line-height: 0;
}

.site-logo img {
  width: 80px;
  height: 127px;
  object-fit: contain;
}

/* —— Header / navigation (shared) —— */
.site-header {
  width: 100%;
}

.site-header__inner {
  display: flex;
  align-items: flex-start;
}

.nav-primary,
.nav-aside {
  display: flex;
  align-items: flex-start;
  gap: 36px;
}

.nav-aside {
  margin-left: auto;
}

.nav-link {
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-size: var(--font-size-navigation);
  line-height: 1;
  letter-spacing: 0;
  color: var(--color-text);
}

/* Header: nav only — logo lives in sticky rail (shared home + info) */
.site-header--home,
.site-header--info {
  position: relative;
  padding-top: 55px;
  min-height: 182px;
}

.site-header--home .site-header__inner,
.site-header--info .site-header__inner {
  justify-content: space-between;
}

.site-header--home .nav-primary,
.site-header--home .nav-aside,
.site-header--info .nav-primary,
.site-header--info .nav-aside {
  margin-top: 1px;
}

/* —— Contact / CTA (shared) —— */
.contact-section {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  box-sizing: border-box;
}

.contact-inner {
  width: var(--container-width);
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  text-align: center;
}

.contact-center {
  grid-row: 2;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.contact-bottom {
  grid-row: 3;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: clamp(3rem, 8vh, 7rem);
}

.contact-email {
  display: inline-block;
  margin-bottom: clamp(1rem, 2vh, 1.5rem);
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-size: var(--font-size-body2);
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--color-muted);
}

.contact-title {
  margin: 0;
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-size: var(--font-size-h2);
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--color-text);
}

.contact-location {
  margin: clamp(1.5rem, 4vh, 3rem) 0 0;
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-size: var(--font-size-body2);
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--color-muted);
}

.contact-time {
  font: inherit;
  color: inherit;
}

.contact-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 4vw, 4rem);
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-size: var(--font-size-caption);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--color-text);
}

.contact-social a,
.contact-social span {
  font-size: var(--font-size-caption);
}

/* —— Home: filters / projects —— */
.filters-section {
  width: 100%;
}

.projects-area {
  width: 100%;
}

.project-filters-sentinel {
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.project-filters-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  background: transparent;
  overflow: visible;
  transition: box-shadow 220ms ease;
}

.project-filters-wrap.is-stuck {
  top: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
  /* Same as body / .page — continuous with site background */
  background: #ffffff;
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.06);
}

/* Fill the 12px viewport gap above the sticky bar with site background */
.project-filters-wrap.is-stuck::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
  background: #ffffff;
  pointer-events: none;
}

.project-filters-wrap.is-stuck .project-filters {
  margin-top: 0;
  margin-bottom: 0;
}

.project-filters {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 28px;
  margin-top: 36px;
  margin-bottom: 62px;
  overflow: hidden;
}

.filter-item {
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-size: var(--font-size-tab);
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--color-text);
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.filter-item:not(.is-active):hover {
  background: #f6f6f6;
}

.filter-item.is-active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 41px;
  padding: 0 18px;
  background: #000000;
  color: #ffffff;
}

.filter-item.is-active:hover {
  background: #000;
  color: #fff;
}

.filter-item:active {
  transform: translateY(1px);
}

.filter-item:focus-visible {
  outline: 1px solid #222;
  outline-offset: 2px;
}

.project {
  width: 100%;
  margin-bottom: 300px;
}

.project-tesla {
  margin-bottom: 120px;
}

.project-cover {
  width: 100%;
  aspect-ratio: 1328 / 747;
  overflow: hidden;
  margin: 0;
  scroll-margin-top: var(--sticky-rail-top);
}

.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-kazdaglari .project-cover img {
  object-position: 50% 25%;
}

.project-delonghi .project-cover img {
  object-position: 0% 95%;
}

.project-tesla .project-cover img {
  object-position: 45% 35%;
}

.project-content {
  width: 100%;
  display: grid;
  grid-template-columns: 40% 60%;
  column-gap: 0;
  margin-top: 108px;
  align-items: start;
}

.project-title-column {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.project-description-column {
  width: 100%;
  padding-left: 10%;
  box-sizing: border-box;
}

.project-title {
  margin: 0;
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-size: var(--font-size-h1);
  line-height: 1.1;
  color: var(--color-text);
}

.project-description {
  width: 100%;
  max-width: none;
  margin: 12px 0 0;
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-size: var(--font-size-body);
  line-height: 1.6;
  color: var(--color-text);
}

.project-meta {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 24px;
  margin: 123px 0 0;
  padding: 56px 0;
  border-top: 1px solid var(--rule-color);
  border-bottom: 1px solid var(--rule-color);
}

.meta-item {
  margin: 0;
}

.meta-item dt {
  margin: 0 0 8px;
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-size: var(--font-size-caption);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--color-text);
}

.meta-item dd {
  margin: 0;
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-size: var(--font-size-caption);
  line-height: 1.3;
  letter-spacing: 0;
  color: #1f1f1f;
}

.project-gallery {
  margin-top: 182px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  user-select: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
  touch-action: pan-y;
  container-type: inline-size;
}

.project-gallery::-webkit-scrollbar {
  display: none;
}

.project-gallery.is-dragging {
  cursor: grabbing;
}

.project-gallery-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 40px;
  width: max-content;
}

.project-gallery-item {
  margin: 0;
  flex: 0 0 38cqi;
  aspect-ratio: 652 / 367;
  overflow: hidden;
}

.project-gallery-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.project-gallery-image:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 0.25rem;
}

.project-kazdaglari .project-gallery-item:nth-child(odd) .project-gallery-image {
  object-position: 50% 20%;
}

.project-kazdaglari .project-gallery-item:nth-child(even) .project-gallery-image {
  object-position: 50% 20%;
}

.project-delonghi .project-gallery-item:nth-child(odd) .project-gallery-image {
  object-position: 35% 55%;
}

.project-delonghi .project-gallery-item:nth-child(even) .project-gallery-image {
  object-position: 0% 60%;
}

/* —— Information: page-specific content —— */
.info-portrait {
  width: 48.505747126437%; /* 422 / 870 */
  aspect-ratio: 422 / 567;
  margin: 1px auto 92px;
  overflow: hidden;
}

.info-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
}

.info-intro {
  margin: 0 0 56px;
}

.info-intro p {
  margin: 0 0 44px;
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-size: var(--font-size-body2);
  line-height: 1.85;
  letter-spacing: 0;
  color: var(--color-muted);
  text-align: left;
}

.info-intro p:last-child {
  margin-bottom: 0;
}

.info-section {
  margin: 0 0 88px;
  padding-top: 56px;
  border-top: 1px solid var(--rule-color);
}

.info-section-title {
  margin: 0 0 40px;
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-size: var(--font-size-h2);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--color-text);
}

.info-prose p {
  margin: 0 0 40px;
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-size: var(--font-size-caption);
  line-height: 1.85;
  letter-spacing: 0;
  color: var(--color-muted);
}

.info-prose p:last-child {
  margin-bottom: 0;
}

.info-columns {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
}

.info-col {
  flex: 1 1 0;
  min-width: 0;
}

.info-col-title {
  margin: 0 0 22px;
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-size: var(--font-size-caption);
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--color-text);
}

.info-list {
  margin: 0;
  padding: 0 0 0 1.1em;
  list-style: disc;
}

.info-list li {
  margin: 0 0 14px;
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-size: var(--font-size-caption);
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--color-muted);
}

.info-list li:last-child {
  margin-bottom: 0;
}

.info-skills {
  margin-bottom: 110px;
}

.info-programs {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* —— Lightbox (Index gallery) —— */
body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 420ms ease,
    visibility 0s linear 420ms;
}

.lightbox.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 18, 0.88);
  backdrop-filter: blur(2px);
}

.lightbox__content {
  position: relative;
  width: min(88vw, 88rem);
  max-height: 88vh;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  z-index: 1;
  opacity: 0;
  transform: translateY(0.75rem) scale(0.985);
  transition:
    opacity 480ms ease,
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.is-open .lightbox__content {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.lightbox__image-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
  max-height: 88vh;
}

.lightbox__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 88vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 1;
  transition: opacity 240ms ease;
}

.lightbox__image.is-changing {
  opacity: 0;
}

.lightbox__arrow {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    transform 220ms ease;
}

.lightbox__arrow:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.04);
}

.lightbox__arrow:disabled,
.lightbox__arrow[hidden] {
  visibility: hidden;
  pointer-events: none;
}

.lightbox__close {
  position: absolute;
  top: -3rem;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.lightbox__close:hover {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox__content,
  .lightbox__image {
    transition-duration: 0.01ms;
  }
}
