:root {
  --ink: #1f1f1f;
  --muted: #6b6b6b;
  --rule: #a3b18a;
  --accent: #4f6f52;
  --btn: #b8a26c;
  --btn-hover: #a7915c;
  --max: 900px;
  --nav-safe: 5px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: white;
  line-height: 1.35;
}

/* =========================
   SIDEBAR TAB NAV
   ========================= */

.side-tabs {
  position: fixed;
  top: 120px;
  left: 0px;
  padding-left: 8px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  z-index: 1000;
}

/* --- Load animation (tabs pop in) --- */
@keyframes tabIn {
  0% {
    opacity: 0;
    transform: translateX(-18px) translateY(6px) rotate(var(--rot, 0deg)) scale(0.98);
  }
  70% {
    opacity: 1;
    transform: translateX(0px) translateY(0px) rotate(var(--rot, 0deg)) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateX(0px) translateY(0px) rotate(var(--rot, 0deg)) scale(1);
  }
}

/* individual tab */
.side-tabs .tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 140px;
  min-height: 85px;

  padding: 16px 26px;

  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 800;
  font-size: 22px;
  line-height: 1;

  color: var(--accent);
  background: #f5f7f2;

  text-decoration: none;
  text-align: center;

  border: 2px solid var(--rule);
  border-radius: 16px;

  box-shadow: 0 8px 18px rgba(0,0,0,0.10);

  transform-origin: left center;

  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    background 200ms ease;

  /* load animation */
  animation: tabIn 650ms cubic-bezier(.2,.9,.2,1) both;
}

.side-tabs .tab.t1 { --rot: 5deg;  animation-delay: 120ms; }
.side-tabs .tab.t2 { --rot: 6deg;  animation-delay: 260ms; }

.side-tabs .tab:hover {
  background: #e6eddc;
  transform: translateX(8px) rotate(var(--rot, 0deg)) scale(1.02);
  box-shadow: 0 12px 26px rgba(0,0,0,0.14);
}

/* active tab */
.side-tabs .tab.active {
  background: var(--rule);
  color: #1f1f1f;
  box-shadow: 0 14px 30px rgba(0,0,0,0.18);
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .side-tabs .tab {
    animation: none;
  }
}

/* mobile: move nav to top and remove rotation */
@media (max-width: 700px) {
  .side-tabs {
    position: static;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
    padding: 18px 0;
  }

  .side-tabs .tab {
    min-width: 140px;
    min-height: 60px;
    transform: none !important;
    animation: none;
  }
}

/* =========================
   PAGE WRAPPER
   ========================= */

.wrap {
  max-width: var(--max);
  margin: 65px auto;
  padding: 0 32px;


  padding-left: calc(32px + var(--nav-safe));


  transform: none;
}


/* =========================
   MAIN LAYOUT
   ========================= */

.profile {
  display: flex;
  gap: 56px;
  align-items: flex-start;
}

/* =========================
   LEFT COLUMN
   ========================= */

.left {
  flex: 1 1 0;
  min-width: 640px;
}

.name {
  margin: 0 0 8px;
  font-size: 42px;
  font-weight: 800;
  color: var(--accent);
}

.section {
  margin-bottom: 32px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 800;
}

/* =========================
   TABLE STYLE
   ========================= */

.table {
  border-top: 1.5px solid var(--rule);
}

.table + .table {
  margin-top: 40px;
}

.row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1.5px solid var(--rule);
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.value {
  font-weight: 700;
}

.value .detail {
  font-weight: 400;
  color: var(--muted);
}

.value a {
  color: #1a73e8;
  text-decoration: none;
}

.value a:hover {
  text-decoration: underline;
}

@media (min-width: 1100px) {
  .thesis-one-line .value {
    white-space: nowrap;
  }
}

/* =========================
   RIGHT COLUMN
   ========================= */

.right {
  flex: 0 1 460px;
  max-width: 460px;

  margin-left: auto;

}

.photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 400px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e6e6e6;
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
  max-width: 360px;
  margin-left: auto;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================
   POLAROID PHOTOS
   ========================= */

.polaroid-stack {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin-top: 24px;
}

.polaroid {
  position: relative;
  width: 88%;
  max-width: 380px;
  background: #fff;
  padding: 14px 14px 100px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 14px 30px rgba(0,0,0,0.14);
  transform-origin: center;
}

.polaroid img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}


.polaroid figcaption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 30px;

  font-family: "Charm", cursive;
  font-size: 23px;
  color: #333;
  letter-spacing: 0.3px;

  line-height: 1.15;
  max-height: calc(2 * 1.35em);
  transform: rotate(-1deg);
  text-align: center;
}

.polaroid.p1 { transform: rotate(-5deg); }
.polaroid.p2 { transform: rotate(5deg); }
.polaroid.p3 { transform: rotate(-7deg); }
.polaroid.p4 { transform: rotate(7deg); }

.polaroid:hover {
  box-shadow: 0 20px 36px rgba(0,0,0,0.28);
}

.polaroid.p2 { margin-left: 8%; }
.polaroid.p3 { margin-left: 3%; }

.polaroid::before,
.polaroid::after {
  content: "";
  position: absolute;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.25) 0px,
      rgba(255,255,255,0.25) 2px,
      rgba(255,255,255,0.1) 4px,
      rgba(255,255,255,0.1) 10px
    ),
    rgba(163, 177, 138, 0.85);
  box-shadow: 0 2px 5px rgba(0,0,0,0.18);
  border-radius: 3px;
  pointer-events: none;
  z-index: 2;

  clip-path: polygon(
    0% 0%,
    96% 2%,
    92% 18%,
    100% 35%,
    93% 55%,
    100% 75%,
    92% 92%,
    4% 100%,
    0% 85%,
    6% 65%,
    0% 45%,
    6% 25%
  );
}

/* top-left tape */
.polaroid::before {
  width: 100px;
  height: 45px;
  top: -15px;
  left: -35px;
  transform: rotate(-20deg);
}

/* bottom-right tape */
.polaroid::after {
  width: 100px;
  height: 45px;
  bottom: -5px;
  right: -35px;
  transform: rotate(-30deg);
}

/* =========================
   SCROLL REVEAL
   ========================= */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 800ms ease, transform 800ms ease;
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1000px) {
  .wrap { transform: none; }
  .right {
    flex: 0 0 380px;
    max-width: 380px;
  }
}

@media (max-width: 860px) {
  .profile { flex-direction: column; }
  .right {
    max-width: 420px;
    width: 100%;
  }
  .photo { min-height: auto; }
}

@media (max-width: 520px) {
  .row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}


/* =========================
   PROJECTS PAGE
   ========================= */

.projects-page {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.projects-title {
  margin: 0 0 6px;
  font-size: 44px;
  color: var(--accent);
  font-weight: 900;
}

.projects-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-weight: 600;
  max-width: 52ch;
}

/* =========================
   PROJECT GRID
   ========================= */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

/* =========================
   PROJECT CARD
   ========================= */

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  will-change: transform, opacity;
}

.project-card.c1 { transform: rotate(-1.2deg); }
.project-card.c2 { transform: rotate( 1.0deg); }
.project-card.c3 { transform: rotate(-0.8deg); }

/* =========================
   CARD INNER
   ========================= */

.card-inner {
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 14px 30px rgba(0,0,0,0.10);
  padding: 14px;

  transition:
    transform 260ms cubic-bezier(.22,1,.36,1),
    box-shadow 260ms cubic-bezier(.22,1,.36,1);
}

.project-card:hover .card-inner {
  transform: scale(1.04);
  box-shadow: 0 24px 48px rgba(0,0,0,0.18);
}

/* =========================
   PROJECT IMAGE
   ========================= */

.project-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #f5f7f2;
  border: 2px solid rgba(163, 177, 138, 0.35);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease;
}


/* =========================
   TITLE
   ========================= */

.project-name {
  margin: 14px 6px 4px;
  font-size: 18px;
  font-weight: 900;
  color: #1f1f1f;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1050px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .card-inner,
  .project-media img {
    transition: none;
  }

  .project-card:hover .card-inner {
    transform: none;
  }
}
