/* ---- Fonts ---- */
@font-face {
  font-family: "Archive";
  src: url("fonts/archive-font-family/archive-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archive";
  src: url("fonts/archive-font-family/archive-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archive";
  src: url("fonts/archive-font-family/archive-extrabold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset-ish ---- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* beat display:grid/flex on toggled panels */
html, body { height: 100%; }
body {
  margin: 0;
  background: #ffffff;
  color: #1a1a1a;
  font-family: "Archive", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

/* ---- Layout ---- */
.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "sidebar  stage"
    "controls stage";
  min-height: 100vh;
}
.sidebar  { grid-area: sidebar; }
.stage    { grid-area: stage; }
.controls { grid-area: controls; }

/* ---- Sidebar ---- */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 52px 40px 0 56px;
}

.brand a {
  font-family: "Archive", sans-serif;
  font-weight: 800;
  font-size: 34px;
  line-height: 0.98;
  letter-spacing: 0.2px;
  color: #111;
  display: inline-block;
}

.categories {
  margin-top: 58px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.categories a {
  font-size: 17px;
  color: #1a1a1a;
  transition: color 0.15s ease;
  width: fit-content;
}
.categories a:hover { color: #888; }
.categories a.active { color: #b3b3b3; }

.pages {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pages a {
  font-size: 17px;
  color: #1a1a1a;
  width: fit-content;
  transition: color 0.15s ease;
}
.pages a:hover { color: #888; }
.pages a.active { color: #b3b3b3; }

.controls {
  padding: 40px 40px 44px 56px;
}
.caption {
  font-family: "Archive", sans-serif;
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 18px 0;
  color: #111;
  min-height: 1.2em;
}
.pager, .thumbs-toggle {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.4px;
  color: #333;
}
.pager { margin-bottom: 14px; }
.pager a:hover, .thumbs-toggle a:hover { color: #999; }
.pager .sep { color: #bbb; margin: 0 2px; }

/* ---- Stage ---- */
.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 72px;
  background: #ffffff;
}

.viewer {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 120px);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7% 9%;
}
.viewer img {
  max-width: 58%;
  max-height: 74vh;
  object-fit: contain;
  box-shadow: 0 22px 45px -20px rgba(0, 0, 0, 0.35);
  display: block;
}

/* ---- Thumbnails overlay ---- */
.thumbnails {
  position: absolute;
  inset: 60px 72px;
  background: #ffffff;
  overflow-y: auto;
  padding: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 30px;
  align-content: start;
}
.thumbnails button {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  display: block;
}
.thumbnails img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #fff;
  transition: transform 0.15s ease, opacity 0.15s ease;
  opacity: 0.92;
}
.thumbnails button:hover img { transform: translateY(-3px); opacity: 1; }
.thumb-label {
  font-family: "Archive", sans-serif;
  font-size: 13px;
  color: #444;
  margin-top: 8px;
  text-align: left;
}

/* ---- Text panel (CV / Contact) ---- */
.text-panel {
  position: absolute;
  inset: 60px 72px;
  background: #ffffff;
  overflow-y: auto;
  padding: 8% 10%;
}
.text-panel h1 {
  font-family: "Archive", sans-serif;
  font-weight: 800;
  font-size: 30px;
  margin: 0 0 28px 0;
}
.text-panel h2 {
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #888;
  margin: 34px 0 10px 0;
}
.text-panel p, .text-panel li {
  font-size: 16px;
  line-height: 1.6;
  color: #2a2a2a;
  max-width: 620px;
}
.text-panel ul { padding-left: 18px; margin: 0; }
.text-panel a { border-bottom: 1px solid #bbb; }

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "sidebar"
      "stage"
      "controls";
  }
  .sidebar { padding: 34px 28px 0; }
  .categories { margin-top: 30px; gap: 14px; }
  .pages { margin-top: 24px; }
  .controls { padding: 20px 28px 40px; }
  .stage { padding: 32px 16px 0; }
  .viewer {
    min-height: auto;
    padding: 0;
    align-items: flex-start;
  }
  .viewer img { max-width: 100%; max-height: 82vh; box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.35); }
  .thumbnails, .text-panel { position: static; inset: auto; margin-top: 20px; }
  .thumbnails { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; padding: 10px 0; }
  .thumbnails img { height: 280px; }
}

/* Touch devices: don't let :hover stick after a tap */
@media (hover: none) {
  .categories a:hover,
  .pages a:hover { color: #1a1a1a; }
  .categories a.active:hover { color: #b3b3b3; }
  .pager a:hover,
  .thumbs-toggle a:hover { color: #333; }
  .thumbnails button:hover img { transform: none; opacity: 0.92; }
}
