@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
  --lapis: #2b4590;
  --lapis-light: #3a5ab0;
  --white: #ffffff;
  --off-white: #f7f8fc;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #dde2ef;
  --sidebar-width: 200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Helvetica Neue', Helvetica, 'Inter', Arial, sans-serif;
  background-color: var(--white);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* ── Sidebar ── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.site-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--lapis);
  text-decoration: none;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.sidebar nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: var(--lapis);
}

/* ── Main content ── */

main {
  margin-left: var(--sidebar-width);
  max-width: 660px;
  padding: 4.5rem 3rem 4.5rem 3rem;
}

/* ── Typography ── */

h1 {
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--lapis);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

h2 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

.intro-heading {
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.name-highlight {
  color: var(--lapis);
}

.welcome-text {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--lapis);
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}

h3 {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--lapis);
  margin-bottom: 0.35rem;
}

p {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 1rem;
}

a {
  color: var(--lapis);
}

/* ── Section label ── */

.section-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--lapis);
  margin-bottom: 1.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1.5px solid var(--lapis);
}

/* ── Tags ── */

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.tag {
  font-size: 0.76rem;
  background: var(--off-white);
  color: var(--lapis);
  border: 1px solid var(--border);
  padding: 0.22rem 0.6rem;
  border-radius: 3px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── Section blocks ── */

.section-block {
  margin-top: 3rem;
}

/* ── Plain lists (education, awards) ── */

.plain-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}

.plain-list li {
  font-size: 0.93rem;
  color: var(--text-muted);
}

/* ── Projects ── */

.project-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-card {
  padding: 0;
}

.project-card p {
  margin-bottom: 0.6rem;
}

.project-meta {
  font-size: 0.78rem;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.project-link {
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--lapis);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.project-link:hover {
  text-decoration: underline;
}

.project-card h3 a {
  color: var(--lapis);
  text-decoration: none;
}

.project-card h3 a:hover {
  text-decoration: underline;
}

.back-link {
  display: inline-block;
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  margin-bottom: 2.5rem;
}

.back-link:hover {
  color: var(--lapis);
}

.detail-value {
  font-size: 0.93rem;
  color: var(--text-muted);
}

/* ── Contact ── */

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.contact-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.contact-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 72px;
}

.contact-list a {
  font-size: 0.93rem;
  color: var(--lapis);
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
}

/* ── Photo gallery ── */

main.with-gallery {
  max-width: 1100px;
}

.content-row {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.text-col {
  flex: 1 1 0;
  min-width: 0;
  max-width: 560px;
}

.photo-gallery {
  flex: 0 0 380px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  align-content: start;
}

.photo-gallery img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
}

.photo-gallery img.gallery-full {
  grid-column: 1 / -1;
  height: 200px;
}

/* Profile picture (contact page) */

.profile-col {
  flex: 0 0 auto;
  align-self: center;
}

.profile-pic {
  width: 330px;
  height: 330px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Single-image gallery (finding-place-food) */
.photo-gallery.gallery-single {
  flex: 0 0 320px;
}

.photo-gallery.gallery-single img.gallery-full {
  height: 300px;
}

/* ── Responsive ── */

@media (max-width: 680px) {
  /* Sidebar becomes a two-row sticky top bar:
     row 1: site name
     row 2: nav links                           */
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
    /* vw guarantees viewport width regardless of content overflow */
    width: 100vw;
    max-width: 100vw;
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.9rem 1.25rem 0.75rem;
    gap: 0.3rem;
    background: var(--white);
  }

  .site-name {
    font-size: 0.88rem;
    line-height: 1.2;
  }

  .sidebar nav ul {
    flex-direction: row;
    gap: 0;
    margin-left: -0.5rem; /* optical alignment with site name */
  }

  /* Tap targets: min 44px height via padding */
  .sidebar nav a {
    display: block;
    padding: 0.45rem 0.5rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  main {
    margin-left: 0;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 2.25rem 1.25rem 3rem;
  }

  p, h1, h2, h3 {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  h1,
  .intro-heading {
    font-size: 1.75rem;
  }

  h2 {
    margin-bottom: 2rem;
  }

  /* Stack contact label above the value */
  .contact-list li {
    flex-direction: column;
    gap: 0.15rem;
  }

  .contact-label {
    min-width: unset;
  }

  .project-list {
    gap: 1.75rem;
  }

  main.with-gallery {
    max-width: 100vw;
  }

  .content-row {
    flex-direction: column;
  }

  .photo-gallery {
    flex: none;
    width: 100%;
  }

}

/* Extra-small phones (iPhone SE, Galaxy A series) */
@media (max-width: 380px) {
  .sidebar {
    padding: 0.8rem 1rem 0.65rem;
  }

  .sidebar nav a {
    font-size: 0.78rem;
    padding: 0.45rem 0.4rem;
  }

  h1,
  .intro-heading {
    font-size: 1.5rem;
  }

  main {
    padding: 2rem 1rem 3rem;
  }
}
