/* =========================
   LOCAL FONTS
   ========================= */

@font-face {
  font-family: "Inter";
  font-weight: 300;
  font-style: normal;
  src: url("fonts/inter-v13-latin-300.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-style: normal;
  src: url("fonts/inter-v13-latin-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-style: normal;
  src: url("fonts/inter-v13-latin-500.woff2") format("woff2");
}

/* =========================
BASE
========================= */

html,
body {
  margin: 0;
  padding: 0;
  /* smooth anchor navigation */
  scroll-behavior: smooth;
}

body {
  /* use the locally hosted Inter family */
  font-family: "Inter", Arial, sans-serif;
  font-size: 13px;
  font-weight: 300;

  color: #111;

  background: #f3f3f3;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  background: #111;
  color: #fff;
  padding: 10px 14px;
  z-index: 2000;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

a:focus-visible {
  outline: 3px solid #111;
  outline-offset: 3px;
}

/* =========================
BACKGROUND ENGINE (LAYERED)
========================= */

.bg-container {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.bg-layer {
  position: absolute;
  inset: 0;

  opacity: 0;

  transition: opacity 4s linear;
}

/* =========================
CONTENT
========================= */

.container {
  margin-top: 10px;

  margin-left: 320px;

  /* stretch across page with 10px margin on right */
  width: calc(100% - 320px - 10px);
  padding-right: 10px;
}

/* logo */

.logo {
  font-size: 26px;

  font-weight: 400;

  margin-bottom: 70px;
}

/* title */

h1 {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: 45px;
  margin-top: 50px;
}

h2 {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: 30px;
}

/* section */

.section {
  margin-bottom: 32px;
 padding: 0 75px;
}

/* section title */

.section-title {
  font-weight: 300;
  letter-spacing: 0.2em;
  margin-bottom: 6px;
  font-size: 22px;
}

/* section text */

.section-text {
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: 0.1rem;
}

/* map */

.map {
  margin-top: 6px;

  display: inline-block;

  border-bottom: 1px solid #111;
}

/* =========================
DIVIDER LINES
========================= */

.divider {
  /* almost full‑width but with 10px space either side */
  width: calc(100% - 20px);
  height: 1px;

  background: #000;

  margin: 35px 10px;
}

/* small sidebar menu separators */
.sidebar a {
  border-bottom: 1px solid #000;
}
.sidebar a:last-child {
  border-bottom: none;
}

/* =========================
FOOTER (FIXED)
========================= */

.fixed-footer {
  background: transparent;
  padding: 20px 30px;
  border-top: 2px solid #777;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 60px;
}

.fixed-footer a {
  text-decoration: none;
  color: #111;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.3s ease;
  font-size: 13px;
}

.fixed-footer a:hover {
  border-bottom: 1px solid #111;
}

.fixed-footer .copy {
    margin-left: auto;
    color: black;
    font-size: 11px;
}

/* legacy footer (keep for reference, now hidden) */

/* =========================
TECHNOLOGIES GRID SECTION
========================= */

.technologies-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 40px;
  margin-top: 40px;
  margin-bottom: 60px;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.tech-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.tech-item img:hover {
  transform: scale(1.1);
}

.tech-label {
  display: none;
  font-size: 13px;
  font-weight: 400;
  color: #111;
}

/* =========================
MY WORK GRID SECTION
========================= */

.my-work {
  margin-bottom: 60px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 30px;
}

.work-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

#my-work .work-grid {
  grid-auto-flow: dense;
  grid-auto-rows: 110px;
}

#my-work .work-item {
  aspect-ratio: auto;
  height: 100%;
}

#my-work .work-item:nth-child(6n + 1) {
  grid-row: span 3;
}

#my-work .work-item:nth-child(6n + 2) {
  grid-row: span 2;
}

#my-work .work-item:nth-child(6n + 3) {
  grid-row: span 2;
}

#my-work .work-item:nth-child(6n + 4) {
  grid-row: span 3;
}

#my-work .work-item:nth-child(6n + 5) {
  grid-row: span 2;
}

#my-work .work-item:nth-child(6n + 6) {
  grid-row: span 2;
}

.work-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 1px so;
  transition: transform 0.3s ease;
}

.work-item:hover img {
  transform: scale(1.05);
}

.work-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: background 0.3s ease;
}

.work-item:hover .work-overlay {
  background: rgba(0, 0, 0, 0.75);
}

.work-overlay-title {
  color: #fff;
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  padding: 40px;
  border: none;
  transition: font-size 0.3s ease;
}

.made-for-fun .work-item-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.made-for-fun .work-item-description {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #111;
  letter-spacing: 0.03em;
}

/* =========================
RESPONSIVE
========================= */

@media (max-width: 1444px) {
  .work-overlay-title {
    font-size: 24px;
  }
}

@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #my-work .work-grid {
    grid-auto-rows: 105px;
  }

  #my-work .work-item:nth-child(4n + 1) {
    grid-row: span 3;
  }

  #my-work .work-item:nth-child(4n + 2) {
    grid-row: span 2;
  }

  #my-work .work-item:nth-child(4n + 3) {
    grid-row: span 2;
  }

  #my-work .work-item:nth-child(4n + 4) {
    grid-row: span 3;
  }

  .technologies-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  body {
    font-size: 12px;
  }

  h1 {
    font-size: 22px;
    letter-spacing: 0.04em;
    margin-top: 24px;
    margin-bottom: 28px;
  }

  .section {
    padding: 0 16px;
  }

  .section-title {
    font-size: 18px;
    letter-spacing: 0.08em;
  }

  .section-text {
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: 0.02em;
  }

  .container {
    margin-left: 30px;
    width: auto;
  }
  .technologies-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .tech-item img {
    width: 70px;
    height: 70px;
  }
}
/* =========================
SIDEBAR
========================= */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 310px;
  height: 100%;
  /* let the layered background show through */
  background: transparent;
  border-right: 1px solid #000;
  box-sizing: border-box;
  z-index: 1000;
  /* use same fonts as body */
  font-family: inherit;
  display: flex;
  flex-direction: column;
}

.menu-toggle {
  display: none;
}

.sidebar-links {
  display: contents;
}

.sidebar-logo {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #000;
}

.sidebar-logo img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

.sidebar a {
  display: block;
  padding: 18px 16px;
  color: #111;
  text-decoration: none;
  font-weight: 300;
  font-size: 20px;
  font-family: inherit;
  border-bottom: 1px solid #000;
}

.sidebar a:last-child {
  border-bottom: none;
}

/* push the content over */
.container {
  margin-left: 320px; /* width + some gap */
  width: calc(100% - 320px - 10px);
}

@media (max-width: 700px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #000;
    padding: 0;
    display: block;
  }

  .menu-toggle {
    width: 100%;
    display: block;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 400;
    text-align: center;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #000;
    color: #111;
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
  }

  .sidebar-links {
    display: none;
  }

  .sidebar-links.is-open {
    display: block;
  }

  .sidebar-links a {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid #000;
    border-right: none;
    font-size: 14px;
  }

  .sidebar-links a:last-child {
    border-bottom: none;
  }
  .container {
    margin-left: 0;
    margin-top: 0;
    width: calc(100% - 20px);
    padding: 20px 10px;
  }
  .fixed-footer {
    flex-direction: column;
    gap: 8px;
    padding: 12px 20px;
  }

  .fixed-footer .copy {
        font-size: 11px;
    margin-left: 0;
  }
  .work-grid {
    grid-template-columns: 1fr;
  }

  #my-work .work-grid {
    grid-auto-rows: auto;
  }

  #my-work .work-item {
    aspect-ratio: 16 / 10;
  }

  #my-work .work-item:nth-child(n) {
    grid-row: auto;
  }

  .work-overlay-title {
    font-size: 18px;
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  body {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
