/* ==========================
   Global / Layout
========================== */
:root {
  --bg: #0e0f13;
  --fg: #e9edf2;
  --muted: #a5adba;
  --card: #13151b;
  --border: #252834;
  --primary: #d9564a;
  --accent: #f2dc99;
  --radius: 12px;
  --header-height: 96px;
}

body:has(.theme-switch:checked) {
  --bg: #ffffff;
  --fg: #0e0f13;
  --muted: #616977;
  --card: #f4f6f8;
  --border: #e5e8ee;
  --primary: #d9564a;
  --accent: #d9564a;
}

img {
  display: block;
  max-width: 100%;
}

/* sidebar / TOC */
.sidebar {
  position: sticky;
  top: var(--header-height);
  align-self: start;
}

/* Four-grid layout */
.four-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  margin-top: 56px;
}

.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 40px;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.left-column .block,
.right-column .block {
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.left-column .block:last-child,
.right-column .block:last-child {
  border-bottom: none;
}

.right-column {
  position: relative;
  z-index: 2;
}

/* Responsive grid */
@media (max-width: 992px) {
  .four-grid {
    grid-template-columns: 1fr;
  }
  .left-column,
  .right-column {
    gap: 32px;
  }
}

/* ==========================
   Polaroids / Shuffle
========================== */
.polaroids {
  display: flex;

  position: relative;
  height: 210px;
}

.polaroid {
  position: absolute;
  width: 180px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  padding: 6px;
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1;
}

.polaroid .ph {
  border-radius: 10px;
  aspect-ratio: 4/5;
  overflow: hidden;
  position: relative;
}

.polaroidimage {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}

.polaroid:hover {
  z-index: 10 !important;
  transform: scale(1.05) !important;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.polaroids:hover .polaroid {
  transition: all 0.5s ease;
}

.polaroids:hover .polaroid:nth-child(1) {
  left: 80px !important;
  top: 60px !important;
  transform: rotate(12deg);
  z-index: 3;
}
.polaroids:hover .polaroid:nth-child(2) {
  left: 100px !important;
  top: 30px !important;
  transform: rotate(-15deg);
  z-index: 2;
}
.polaroids:hover .polaroid:nth-child(3) {
  right: 100px !important;
  top: 80px !important;
  transform: rotate(-8deg);
  z-index: 1;
}

/* Polaroid responsiveness */
@media (max-width: 992px) {
  .polaroids {
    height: 220px;
  }
  .polaroid {
    width: 140px;
  }
}
@media (max-width: 768px) {
  .polaroids {
    height: 170px;
  }
  .polaroid {
    width: 108px;
  }
}
@media (max-width: 640px) {
  .polaroids {
    height: 180px;
  }
  .polaroid {
    width: 110px;
  }
}

/* ==========================
   Main content padding
========================== */
main#content {
  padding-top: var(--header-height);
}
@media (min-width: 768px) {
  main#content {
    padding-top: calc(var(--header-height) + 24px);
  }
}
@media (max-width: 480px) {
  main#content {
    padding-top: calc(var(--header-height) + 16px);
  }
}

/* ==========================
   Education section
========================== */
#education {
  padding-top: 32px;
}
@media (min-width: 992px) {
  #education {
    padding-top: 48px;
  }
}
@media (max-width: 640px) {
  #education {
    display: none;
    padding-top: 24px;
  }
}

/* ==========================
   Timeline
========================== */
/* Timeline container */
.list {
  position: relative;
  list-style: none;
  padding-left: 20px; /* space for line */
  margin: 0;
}

/* Vertical line */
.list::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px; /* vertical line position */
  width: 2px;
  height: 100%;
  background: var(--border);
}

/* Timeline entry wrapper */
.row,
.row-line {
  position: relative;
  margin-bottom: 24px;
  width: 100%;
}

/* Content inside row-line */
.row-line p.role,
.row-line span.date {
  margin-left: 12px; /* space for dot */
}

/* Role / Position / Degree */
.role {
  font-weight: 500;
  font-size: 16px;
  color: var(--fr);
  margin-bottom: 4px;
}

/* Date */
.date {
  font-size: 14px;
  color: var(--muted);
}

/* Hover effect */
.row-content:hover,
.row-line-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .list {
    padding-left: 24px;
  }
  .list::before {
    left: 12px;
  }
  .row::before,
  .row-line::before {
    left: 12px;
    width: 10px;
    height: 10px;
  }
  .row-content,
  .row-line-content {
    margin-left: 14px;
  }
}

.company {
  color: var(--fg);
}

.company:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ==========================
   Contact Section
========================== */
#contact {
  padding: 60px 16px;
}

#contact .container {
  max-width: 800px; /* constrain width */
  margin: 0 auto; /* center horizontally */
  text-align: center;
}

#contact h2.section-title {
  font-size: 28px;
  color: var(--fg);
  margin-bottom: 24px;
}

#contact .btn-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

#contact .btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
