body {
  margin: 0;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 17px;
  background: #fff;
  color: #111;
}

/* Layout grid */
.container {
  display: grid;
  grid-template-columns: 2.1fr 1.3fr;
  min-height: 100vh;
  width: 100vw;
}

.column-area {
  display: flex;
  flex-direction: column;
  max-width: 62vw;
  background: #fff;
}

.main-header {
  display: flex;
  align-items: center;
  width: 100%;
  background: #fff;
  padding: 0 1.5rem;
  margin-top: 2.8rem;
  margin-bottom: 2.5rem;
  min-height: 4.5rem;
  white-space: nowrap;
}

#brand-link {
  font-weight: 700;
  font-size: 1.25rem;
  flex: 2;
  text-align: left;
  cursor: pointer;
  color: #111;
  text-decoration: none;
}
#brand-link:hover {
  color: #ff5a36;
}

.nav-link {
  text-decoration: none;
  color: #111;
  font-size: 1.1rem;
  font-weight: 500;
  flex: 1;
  text-align: center;
  transition: color 0.2s;
  letter-spacing: 0.04em;
}
.nav-link:hover,
.nav-link:focus {
  color: #ff5a36;
}

.bottom-nav {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 99;
  padding: 1.2em 0 1.2em 1.5em;
  background: none;
  width: auto;
  text-align: left;
}

body { padding-bottom: 3.5em; }

.column-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  padding: 0 1.5rem;
  box-sizing: border-box;
  background: #fff;
  flex: 1;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.project-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  cursor: pointer;
  padding: 0.5em 0.3em;
  border-radius: 0;
  transition: background 0.15s;
  background: none;
  outline: none;
  margin: 0;
}

.project-title {
  font-size: 1.08rem;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-year {
  color: #111;
  font-size: 1.08rem;
  font-family: inherit;
  font-weight: 400;
  text-align: right;
  margin-right: 2rem;
  min-width: 100px;
}

.project-row:hover .project-title,
.project-row.hovering .project-title,
.project-row:focus .project-title {
  color: #1976d2;
  text-decoration: underline;
}
.project-row:hover .project-year,
.project-row.hovering .project-year,
.project-row:focus .project-year {
  color: #1976d2;
  text-decoration: underline;
}
.project-row.active .project-title,
.project-row.active .project-year {
  color: #1976d2;
  text-decoration: underline;
}
.project-row.active {
  background: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Preview area styles */
.preview-area {
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  min-width: 0;
  max-width: 38vw;
  position: relative;
  overflow: hidden;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

.header-aligned {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: #fff;
  padding-right: 2rem;
  padding-top: 2.8rem;
  margin-bottom: 2.5rem;
  font-size: 1.12rem;
  color: #444;
  font-style: italic;
  box-sizing: border-box;
}

.full-preview,
.hover-preview {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: #fff;
}
.full-scrollable,
.hover-scrollable {
  overflow-y: auto;
  max-height: calc(100vh - 8rem);
  padding: 2rem 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  width: 100%;
}
.full-scrollable img,
.hover-scrollable img {
  width: 97%;
  max-width: 97%;
  height: auto;
  border-radius: 0px;
  background: #fff;
  display: block;
}

/* Notebook styles */
.notebook-container {
  max-width: 580px;
  margin: 0 auto;
  padding: 2em 1em 4em 1em;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.notebook-header {
  text-align: center;
  margin-bottom: 2.5em;
}
.notebook-entries {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.notebook-entry {
  width: 100%;
  max-width: 510px;
  border-bottom: 1px solid #eee;
  padding-bottom: 1em;
  margin-bottom: 2em;
  position: relative;
  padding-right: 2.3em;
  min-height: 2.2em;
  background: #fff;
  border-radius: 10px;
  box-sizing: border-box;
}
.notebook-entry h2 {
  font-size: 1.13em;
  font-weight: 600;
  color: #222;
  margin: 0 0 0.7em 0;
  text-align: left;
  letter-spacing: 0.02em;
}
.notebook-entry p {
  margin-top: 0.5em;
  color: #222;
  font-size: 1.08em;
  line-height: 1.7;
}
.entry-image {
  display: block;
  margin: 0 auto 0.7em auto;
  border-radius: 7px;
  max-width: 100%;
  max-height: 330px;
}

/* --- MOBILE: visually reorder preview area above project list --- */
@media (max-width: 740px) {
  html, body {
    overflow-x: hidden !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100vh;
    position: relative;
    box-sizing: border-box;
    height: auto;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff;
  }
  .container {
    display: block;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .column-area {
    display: flex;
    flex-direction: column;
  }
  .main-header {
    order: 1;
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
    margin-top: 0;
    margin-bottom: 0.7em;
    padding-left: 3vw;
    padding-right: 3vw;
    padding-top: 2vw;
    padding-bottom: 2vw;
    box-sizing: border-box;
    justify-content: space-between;
    align-items: flex-start;
  }
  .preview-area {
    order: 2;
    min-width: 0;
    max-width: unset;
    width: 100vw;
    padding-left: 0;
    padding-right: 0;
    align-items: stretch;
    display: flex;
  }
  .column-content {
    order: 3;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff;
  }
  .project-row.item {
    display: none !important;
  }
  .mobile-project-list {
    display: block !important;
    margin: 0;
    padding: 0;
    width: 100vw;
    background: #fff;
  }
  .mobile-project-block {
    margin: 0 0 2.5em 0;
    padding: 0;
    border: none;
    background: none;
    position: relative;
    width: 100vw;
    box-sizing: border-box;
    overflow: visible;
  }
  .mobile-project-title-row {
    display: flex;
    gap: 0.5em;
    align-items: baseline;
    font-size: 1.08rem;
    font-weight: 500;
    padding: 0.6em 1.1em 0.2em 1.1em;
    background: #fff;
    color: #222;
  }
  .mobile-project-title {
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #111;
    font-size: 1.08rem;
  }
  .mobile-project-year {
    color: #888;
    font-weight: 400;
    font-size: 1.05rem;
  }
  .mobile-project-carousel-wrapper {
    width: 100vw;
    display: flex;
    justify-content: center;
    position: relative;
    align-items: center;
  }
  .mobile-project-carousel {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    width: 90vw;
    aspect-ratio: 4/5;
    background: #fff;
    border-left: 1px solid #ececec;
    border-right: 1px solid #ececec;
    align-items: stretch;
    justify-content: flex-start;
    scrollbar-width: none;
    box-sizing: border-box;
    position: relative;
  }
  .mobile-project-carousel::-webkit-scrollbar {
    height: 0;
    background: transparent;
  }
  .mobile-project-carousel img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    display: block;
    object-fit: cover;
    scroll-snap-align: center;
    background: #eee;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    opacity: 1;
    transition: opacity 0.35s cubic-bezier(.4,0,.2,1);
  }
  .mobile-project-carousel img.loaded {
    opacity: 1;
  }
  .carousel-arrow-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    font-size: 2.3em;
    color: #222;
    background: none;
    border: none;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.96;
    pointer-events: auto;
    user-select: none;
    transition: opacity 0.2s;
    box-shadow: none;
    padding: 0;
    line-height: 1;
  }
  .carousel-arrow-indicator.left {
    left: 0.5vw;
    right: auto;
  }
  .carousel-arrow-indicator.right {
    right: 0.5vw;
    left: auto;
  }
  .carousel-arrow-indicator:active {
    opacity: 1;
    background: none;
  }
  @media (max-width: 490px) {
    .mobile-project-carousel {
      width: 99vw;
    }
    .carousel-arrow-indicator.left { left: 0.2vw; }
    .carousel-arrow-indicator.right { right: 0.2vw; }
  }
  .mobile-project-desc {
    display: none !important;
  }
}