/* @font-face {
  font-family: "tomhand";
  src: url("fonts/tomhand.woff2") format("woff2"),
       url("fonts/tomhand.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
} */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "degular-mono", Arial, Helvetica, sans-serif;
  color: #111111;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-image: url('../images/background.jpg');
  background-size: cover;
}

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

.page {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) clamp(20px, 6vw, 64px) clamp(60px, 10vw, 120px);
}

h2 {
  font-weight: 400;
}

/* ---------- HEADER ---------- */

header {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: clamp(40px, 8vw, 90px);
}

.name-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.title-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.greeting {
  font-size: clamp(13px, 1.4vw, 18px);
  white-space: nowrap;
  text-align: right;
  display: inline-block;
  min-width: 127px;
}

.name {
  font-size: clamp(24px, 4.2vw, 44px);
  font-weight: 400;
  letter-spacing: clamp(0.15rem, 1vw, 0.3rem);
  margin: 0 clamp(8px, 3vw, 32px) 0 8px;
  white-space: nowrap;
}

.name a {
  text-decoration: none;
}

.by-hand {
  font-size: 18px;
}

a {
  color: #111111;
}

nav {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: clamp(13px, 1.4vw, 15px);
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  line-height: 1.7;
}

nav a {
  color: #111111;
}

nav a:hover {
  text-decoration: underline;
}

#primaryNav li {
  padding-left: 22px;
}
#primaryNav li.selected {
  padding-left: 0;
}
#primaryNav li.selected::before {
  content: "→";
  margin-right: 6px;
}

/* Hamburger button: hidden on desktop, shown only at mobile breakpoint */
.menu-toggle {
  display: none;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
}

.menu-toggle .bar {
  display: block;
  width: 28px;
  height: 2px;
  background-color: #111111;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------- MAIN LAYOUT ---------- */

.layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
  padding-top: 8rem;
}

.bio {
  font-size: 14px;
  line-height: 1.8;
  position: relative;
  top: -10rem;
}

.bio p {
  margin: 0 0 28px 0;
}

.bio p:last-child {
  margin-bottom: 0;
}

/* ---------- ENTRIES ---------- */

.entries {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 6vw, 70px);
  min-width: 0;
}

.entry {
  display: grid;
  grid-template-columns: 121px 1fr;
  column-gap: 24px;
  min-width: 0;
}

.entry-year {
  font-size: 18px;
  text-align: right;
  position: relative;
  top:-6px;
}

.entry-media {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.entry-image {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a8778;
  font-size: 13px;
  text-align: center;
}

.entry-image.border {
  border: 1px solid #8a8778;
}


.entry-video {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 */
}

.entry-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.entry-caption {
  font-size: 13px;
  font-style: italic;
  text-align: right;
  margin-top: 10px;
  font-weight: 200;
}

.copyright {
  font-size: 15px;
  text-align: center;
  padding: 5rem 0;
}

.project-title {
  font-size: 25px;
  padding-left: 30px;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1100px) {
  .bio {
    top: 0;
  }
}

/* Tablet: bio moves above entries, single column layout */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .bio {
    order: -1;
    padding-bottom: 8px;
    border-bottom: 1px solid #d8d5cc;
    margin-bottom: 8px;
  }

  .entry {
    grid-template-columns: 50px 1fr;
    column-gap: 16px;
  }
}

/* Small tablet / large phone: header stacks, nav becomes a hamburger menu */
@media (max-width: 640px) {
  header {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .title-block {
    display: block;
  }

  .greeting {
    text-align: left;
  }

  .name-row {
    width: 100%;
    justify-content: space-between;
  }

  .name {
    margin: 0;
    white-space: normal;
    word-break: break-word;
  }

  .menu-toggle {
    display: flex;
    flex-shrink: 0;
  }

  nav {
    width: 100%;
    align-items: stretch;
  }

  nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid #d8d5cc;
  }

  nav ul.open {
    display: flex;
  }

  nav li {
    padding: 10px 0;
    border-bottom: 1px solid #e3e0d7;
  }

  nav li:last-child {
    border-bottom: none;
  }

  nav a {
    display: block;
    font-size: 16px;
  }
}

/* Phone: entry year moves above image instead of beside it */
@media (max-width: 480px) {
  .entry {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .entry-year {
    padding-top: 0;
    font-weight: bold;
  }

  .entry-caption {
    text-align: left;
  }

  .greeting {
    display: block;
    margin-bottom: 2px;
  }
}
