@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,700;1,9..144,400&family=Lato:wght@300;400;700&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --text-dark: #2f2e2e;
  --text-mid: #605e5e;
  --text-light: #999;
  --bg-gray: #e0e0e0;
  --accent: #30bfff;
  --border: #e0e0e0;
  --max-width: 980px;
}

body {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  color: var(--text-dark);
  background: #fff;
  line-height: 1.6;
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ===== HEADER ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
}

.site-logo {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 26px;
  color: #3a3520;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  letter-spacing: -0.02em;
}

.site-logo:hover {
  color: #3a3520;
}

nav {
  display: flex;
  gap: 36px;
  align-items: center;
}

nav a {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-size: 14px;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.15s;
}

nav a:hover,
nav a.active {
  color: var(--text-dark);
}

/* Mobile menu toggle (hidden by default on desktop) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 32px 0 28px;
  border-top: 1px solid var(--border);
}

.linkedin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #000;
  border-radius: 50%;
  color: #fff;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  transition: background 0.2s;
}

.linkedin-link:hover {
  background: #0a66c2;
}

.copyright {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

/* ===== HOMEPAGE ===== */
.home-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 64px;
  padding: 72px 48px 56px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.profile-photo {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #ccc;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(100%);
}

.hero-text {
  max-width: 340px;
}

.hero-text h1 {
  font-family: 'Fraunces', serif;
  font-size: 72px;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero-text .tagline {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.hero-text .description {
  font-size: 14px;
  line-height: 1.75;
}

/* Per-word rainbow coloring */
.hero-text .description .w1  { color: #4285f4; }
.hero-text .description .w2  { color: #e06b00; }
.hero-text .description .w3  { color: #0f9d58; }
.hero-text .description .w4  { color: #ea4335; }
.hero-text .description .w5  { color: #9c27b0; }
.hero-text .description .w6  { color: #4285f4; }
.hero-text .description .w7  { color: #0f9d58; }
.hero-text .description .w8  { color: #e06b00; }
.hero-text .description .w9  { color: #ea4335; }
.hero-text .description .w10 { color: #00897b; }
.hero-text .description .w11 { color: #9c27b0; }
.hero-text .description .w12 { color: #4285f4; }
.hero-text .description .w13 { color: #e06b00; }
.hero-text .description .w14 { color: #0f9d58; }
.hero-text .description .w15 { color: #ea4335; }

/* Circle navigation buttons */
.circle-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 8px 48px 72px;
  flex-wrap: wrap;
}

.circle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-dark);
  text-decoration: none;
  text-align: center;
  transition: transform 0.2s, filter 0.2s;
}

.circle-btn:hover {
  transform: scale(1.06);
  filter: brightness(0.93);
}

.circle-work    { background: #a8b4e0; }
.circle-projects { background: #e54535; color: #fff; }
.circle-talks   { background: #48c8c0; }
.circle-fun     { background: #c8a840; }
.circle-contact { background: #e0a895; }

/* ===== GRAY BANNER (used on Fun stuff, Talks) ===== */
.page-banner {
  background: var(--bg-gray);
  padding: 72px 48px 64px;
}

.page-banner-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-banner h1 {
  font-family: 'Fraunces', serif;
  font-size: 44px;
  font-weight: 300;
  color: var(--text-mid);
  margin-bottom: 16px;
  line-height: 1.15;
}

.page-banner p {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.7;
}

.page-banner a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Talks banner specific (centered not left-aligned for the sub-heading) */
.talks-banner-text {
  max-width: 600px;
}

/* ===== SECTION DIVIDER ===== */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ===== PROJECTS PAGE ===== */
.projects-hero {
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: #c8bfb0;
}

.projects-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.section-intro {
  text-align: center;
  padding: 60px 48px 48px;
  max-width: 720px;
  margin: 0 auto;
}

.section-intro h2 {
  font-family: 'Fraunces', serif;
  font-size: 40px;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-intro p {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.7;
}

.section-label {
  text-align: center;
  padding: 52px 48px 8px;
}

.section-label h2 {
  font-family: 'Fraunces', serif;
  font-size: 30px;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.section-label p {
  font-size: 14px;
  color: var(--text-mid);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding: 0 48px 60px;
}

.projects-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.project-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-card:hover .project-card-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #ddd;
  display: block;
}

.project-card-img-contain {
  object-fit: contain;
  background: #f0f0f0;
  padding: 16px;
}

.project-card-title {
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  font-size: 15px;
  color: var(--text-dark);
  margin: 12px 0 6px;
}

.project-card-desc {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.55;
}

/* Talks preview on projects page */
.talks-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding: 0 48px 16px;
}

.talk-preview-card {}

.talk-preview-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #ddd;
}

.talk-preview-title {
  font-size: 13px;
  font-style: italic;
  color: var(--text-dark);
  margin: 10px 0 3px;
}

.talk-preview-venue {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
}

.talk-preview-date {
  font-size: 12px;
  color: var(--text-mid);
  margin-bottom: 8px;
}

.talk-preview-desc {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.55;
  margin-bottom: 6px;
}

.talk-preview-link {
  font-size: 12px;
  color: var(--text-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.view-more-btn {
  display: block;
  margin: 32px auto 60px;
  padding: 12px 36px;
  background: #555;
  color: #fff;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  text-decoration: none;
  text-align: center;
  width: fit-content;
  transition: background 0.2s;
}

.view-more-btn:hover {
  background: #333;
}

/* ===== TALKS PAGE ===== */
.talk-list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
}

.talk-entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  padding: 52px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

/* Image on right: swap columns */
.talk-entry.img-right {
  direction: rtl;
}
.talk-entry.img-right > * {
  direction: ltr;
}

.talk-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: #ddd;
}

.talk-yt {
  width: 100%;
  height: 220px;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.talk-yt-text {
  color: #fff;
  font-size: 13px;
  font-style: italic;
  text-align: center;
  padding: 0 16px;
}

.talk-yt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #111;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 2px;
}

.talk-entry-text h3 {
  font-family: 'Fraunces', serif;
  font-size: 19px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-dark);
  margin-bottom: 2px;
  line-height: 1.3;
}

.talk-venue {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
}

.talk-date {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 14px;
}

.talk-desc {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 8px;
}

.summary-link {
  font-size: 13px;
  color: var(--text-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.summary-link:hover {
  color: var(--text-dark);
}

/* ===== FUN STUFF PAGE ===== */
.fun-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 40px;
  max-width: var(--max-width);
  margin: 64px auto 80px;
  padding: 0 48px;
  text-align: center;
}

.fun-card-img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  display: block;
  margin: 0 auto 16px;
}

.fun-card-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.fun-card-desc {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.55;
  margin-bottom: 10px;
}

.fun-card-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== CONTACT PAGE ===== */
.contact-section {
  background: var(--bg-gray);
  padding: 64px 48px 72px;
}

.contact-inner {
  max-width: 820px;
  margin: 0 auto;
}

.contact-section h1 {
  font-family: 'Fraunces', serif;
  font-size: 38px;
  font-weight: 300;
  color: var(--text-mid);
  margin-bottom: 8px;
}

.contact-subtitle {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 32px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 12px;
  color: var(--text-mid);
  margin-bottom: 4px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid #bbb;
  padding: 10px 12px;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 300;
  background: #fff;
  color: var(--text-dark);
  outline: none;
  border-radius: 0;
  appearance: none;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent);
}

.form-field textarea {
  height: 130px;
  resize: vertical;
  display: block;
}

.form-message {
  margin-bottom: 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-send {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 52px;
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-send:hover {
  background: #1aabee;
}

.form-success {
  display: none;
  font-size: 15px;
  color: var(--text-mid);
  margin-top: 16px;
  text-align: right;
}

/* ===== PROJECT DETAIL PAGES ===== */
.project-detail {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 72px;
  max-width: var(--max-width);
  margin: 64px auto 0;
  padding: 0 48px;
}

.project-sidebar h1 {
  font-family: 'Fraunces', serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: 28px;
}

.project-sidebar .tldr {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 12px;
}

.project-sidebar .tldr strong,
.project-sidebar .fact strong {
  font-weight: 700;
  color: var(--text-dark);
}

.project-sidebar .fact {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.65;
}

.project-content {
  padding-bottom: 0;
}

.project-content h2 {
  font-family: 'Fraunces', serif;
  font-size: 30px;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 18px;
  margin-top: 36px;
  line-height: 1.2;
}

.project-content h2:first-child {
  margin-top: 0;
}

.project-content h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  margin-top: 24px;
}

.project-content p {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 14px;
}

.project-content ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 14px;
}

.project-content ul ul {
  list-style: circle;
  margin-top: 4px;
  margin-bottom: 0;
}

.project-content li {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 4px;
}

.project-content img {
  max-width: 100%;
  display: block;
  margin: 24px 0;
}

.project-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-content em {
  font-style: italic;
}

.project-content strong {
  font-weight: 700;
  color: var(--text-dark);
}

.quote-box {
  border: 2px solid var(--text-dark);
  padding: 44px 40px 32px;
  text-align: center;
  margin: 32px 0;
}

.quote-box blockquote {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-dark);
  line-height: 1.35;
  margin-bottom: 24px;
}

.quote-box hr {
  border: none;
  border-bottom: 3px solid var(--text-dark);
  width: 100%;
}

.back-btn {
  display: block;
  margin: 48px auto 64px;
  padding: 12px 40px;
  background: var(--accent);
  color: #fff;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  text-decoration: none;
  text-align: center;
  width: fit-content;
  transition: background 0.2s;
}

.back-btn:hover {
  background: #1aabee;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  header {
    padding: 16px 24px;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border);
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }

  nav.open {
    display: flex;
  }

  nav a {
    padding: 12px 24px;
    font-size: 15px;
  }

  .menu-toggle {
    display: flex;
  }

  .home-hero {
    flex-direction: column;
    gap: 32px;
    padding: 48px 24px 32px;
    text-align: center;
  }

  .profile-photo {
    width: 220px;
    height: 220px;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-text h1 {
    font-size: 56px;
  }

  .circle-nav {
    padding: 16px 24px 48px;
    gap: 12px;
  }

  .circle-btn {
    width: 120px;
    height: 120px;
    font-size: 13px;
  }

  .page-banner {
    padding: 48px 24px;
  }

  .page-banner h1 {
    font-size: 32px;
  }

  .projects-grid,
  .projects-grid-2,
  .talks-preview-grid,
  .fun-grid {
    grid-template-columns: 1fr;
    padding: 0 24px 40px;
  }

  .section-intro,
  .section-label {
    padding-left: 24px;
    padding-right: 24px;
  }

  .talk-list {
    padding: 0 24px;
  }

  .talk-entry {
    grid-template-columns: 1fr;
    gap: 24px;
    direction: ltr !important;
  }

  .talk-entry > * {
    direction: ltr !important;
  }

  .contact-section {
    padding: 48px 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .project-detail {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 0 24px;
    margin-top: 40px;
  }

  .projects-hero {
    height: 180px;
  }
}
