/* ---------- Design tokens ---------- */
:root {
  --color-ink: #2b2b2b;
  --color-muted: #6b7280;
  --color-purple: #454695;
  --color-purple-dark: #383a78;
  --color-section-bg: #dde6f7;
  --color-white: #ffffff;

  --font-heading: "Urbanist", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Nunito", "Helvetica Neue", Arial, sans-serif;

  --container-width: 960px;
  --container-width-wide: 1180px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-btn: 10px;

  --font-size-h3: 1.3rem;
  --font-size-subheading: clamp(1.05rem, 1rem + 0.3vw, 1.15rem);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 200;
  background: var(--color-purple-dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 16px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-purple-dark);
  outline-offset: 3px;
  border-radius: 4px;
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 {
  font-family: var(--font-heading);
  margin: 0;
  line-height: 1.15;
}
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide {
  width: 100%;
  max-width: var(--container-width-wide);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--color-purple);
  color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover {
  background: var(--color-purple-dark);
  transform: translateY(-1px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
}
.logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav {
  display: flex;
  gap: 32px;
}
.nav a {
  display: inline-block;
  padding: 10px 2px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-ink);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-ink);
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  padding: 90px 24px 110px;
  max-width: 760px;
}
.hero h1 {
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 800;
  margin-bottom: 28px;
}
.hero p {
  font-size: 1.15rem;
  color: #3d3d3d;
  margin-bottom: 40px;
  max-width: 620px;
}

/* ---------- About page ---------- */
.about-section {
  padding: 90px 0 110px;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 48px;
}
@media (min-width: 880px) {
  .about-grid {
    grid-template-columns: 1fr 380px;
    gap: 64px;
  }
}
.about-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2.4rem, 4.5vw, 3.2rem);
  margin-bottom: 28px;
}
.about-text p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #3d3d3d;
  margin-bottom: 20px;
}
.about-text .btn {
  margin-top: 8px;
}
.about-image img {
  width: 100%;
  height: auto;
  border-radius: 0;
  display: block;
}

/* ---------- Projects section ---------- */
.projects-section {
  background: var(--color-section-bg);
  border-radius: var(--radius-lg);
  margin: 0;
  padding: 64px 0 80px;
}
.section-title {
  text-align: center;
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: 40px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 42px;
}

.project-card-wrap {
  position: relative;
}

.card-glow {
  position: absolute;
  inset: -35px;
  background-size: cover;
  background-position: center;
  filter: blur(50px) brightness(0.95) saturate(1.25) contrast(1);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.45s ease, transform 0.45s ease;
  z-index: 0;
  pointer-events: none;
}
.glow-thesis { background-image: url("../img/Effects/Thesis%20Bg.png"); }
.glow-travelink { background-image: url("../img/Effects/TraveLinkBg.png"); }
.glow-uncanny { background-image: url("../img/Effects/Uncanny%20Bg.jpg"); }
.glow-makers { background-image: url("../img/Effects/Smart%20Maker%20Bg.png"); }

.project-card-wrap:hover .card-glow {
  opacity: 0.85;
  transform: scale(0.98);
}

.project-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.project-card-wrap:hover .project-card {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}
@media (min-width: 880px) {
  .project-card {
    grid-template-columns: 1.2fr 1fr;
    min-height: 460px;
  }
}

.project-text {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.project-meta {
  color: var(--color-muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.project-text h3 {
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--color-ink);
}
.project-desc {
  color: #4a4a4a;
  font-size: 1rem;
  line-height: 1.75;
}
.project-text .btn {
  align-self: flex-start;
  margin-top: 8px;
}

.project-visual {
  position: relative;
  min-height: 320px;
  overflow: hidden;
}
.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ---------- Project detail hero ---------- */
.project-hero {
  padding-top: 56px;
  padding-bottom: 96px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 40px;
}
.back-link:hover {
  color: var(--color-ink);
}
.project-hero-title {
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  margin-bottom: 12px;
}
.project-hero-meta {
  color: var(--color-muted);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 40px;
}

.project-hero-image {
  width: 100%;
  height: clamp(180px, 25vw, 400px);
  overflow: hidden;
  margin-bottom: 56px;
}
.project-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.project-overview-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 48px;
}
@media (min-width: 880px) {
  .project-overview-grid {
    grid-template-columns: 280px 1fr;
    gap: 54px;
  }
}

.project-meta-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin: 0;
}
.meta-item dt {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 6px;
}
.meta-item dd {
  margin: 0;
  font-size: 1rem;
  color: var(--color-ink);
}

.project-overview h2 {
  font-weight: 700;
  font-size: 1.75rem;
  margin-bottom: 20px;
}
.project-overview p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #3d3d3d;
  margin-bottom: 20px;
}
.project-overview p:last-child {
  margin-bottom: 0;
}
.project-overview p > strong:only-child {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--font-size-subheading);
  font-weight: 700;
  color: var(--color-ink);
}
.project-overview ul {
  margin: 0 0 20px;
  padding-left: 1.3rem;
  list-style: disc;
}
.project-overview li {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #3d3d3d;
  margin-bottom: 10px;
}
.project-overview li:last-child {
  margin-bottom: 0;
}

/* ---------- Scientific insight topics ---------- */
.insight-topic {
  margin-bottom: 32px;
}
.topic-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.topic-header h3 {
  font-weight: 700;
  font-size: var(--font-size-h3);
  line-height: 34px;
  margin: 0;
}
.topic-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-ink);
}
.topic-num-1 { background: #bfe6ba; }
.topic-num-2 { background: #d9c2f5; }
.topic-num-3 { background: #aac9f5; }
.topic-num-pink { background: #f5c2e0; }
.topic-num-yellow { background: #f6e6a3; }
.topic-num-orange { background: #f6cfa3; }

.process-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}
.process-step {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}
.process-step:hover {
  opacity: 0.65;
}
.process-step h3 {
  font-weight: 600;
  font-size: 1.15rem;
  color: #4b4b4b;
}

.scroll-dots {
  position: fixed;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.scroll-dots.visible {
  opacity: 1;
  pointer-events: auto;
}
.scroll-dot {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #dcdcdc;
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease;
}
.scroll-dot:hover {
  background: #b8b8b8;
}
.scroll-dot::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: rgba(220, 220, 220, 0.6);
  color: #000;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.scroll-dot:hover::after {
  opacity: 1;
}
.scroll-dot.active[data-color="1"]::after { background: rgba(191, 230, 186, 0.6); }
.scroll-dot.active[data-color="2"]::after { background: rgba(217, 194, 245, 0.6); }
.scroll-dot.active[data-color="3"]::after { background: rgba(170, 201, 245, 0.6); }
.scroll-dot.active[data-color="pink"]::after { background: rgba(245, 194, 224, 0.6); }
.scroll-dot.active[data-color="yellow"]::after { background: rgba(246, 230, 163, 0.6); }
.scroll-dot.active[data-color="orange"]::after { background: rgba(246, 207, 163, 0.6); }
.scroll-dot.active {
  width: 19px;
  height: 19px;
}
.scroll-dot.active[data-color="1"] { background: #bfe6ba; }
.scroll-dot.active[data-color="2"] { background: #d9c2f5; }
.scroll-dot.active[data-color="3"] { background: #aac9f5; }
.scroll-dot.active[data-color="pink"] { background: #f5c2e0; }
.scroll-dot.active[data-color="yellow"] { background: #f6e6a3; }
.scroll-dot.active[data-color="orange"] { background: #f6cfa3; }

@media (max-width: 1320px) {
  .scroll-dots {
    display: none;
  }
}

.insight-topic p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #3d3d3d;
  margin-bottom: 20px;
}
.insight-topic p:last-child {
  margin-bottom: 0;
}

.stage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px 64px;
  margin-top: 40px;
}
@media (min-width: 700px) {
  .stage-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.citation {
  color: var(--color-purple);
  font-weight: 600;
  text-decoration: none;
}
.citation:hover {
  text-decoration: underline;
}
.project-overview p a:not(.citation) {
  color: var(--color-purple);
  text-decoration: underline;
}
.project-overview p a:not(.citation):hover {
  color: var(--color-purple-dark);
}
#references:target {
  background: var(--color-section-bg);
  border-radius: 8px;
  padding: 4px 8px;
  margin-left: -8px;
}

/* ---------- Scientific insight box ---------- */
.insight-box {
  border: 15px solid #a9d3f5;
  border-radius: 20px;
  padding: 60px;
  margin: 32px 0;
}
.insight-box h3 {
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.insight-box > p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #3d3d3d;
  margin-bottom: 16px;
}
.insight-box > p:last-of-type {
  margin-bottom: 0;
}
.insight-steps {
  list-style: none;
  margin: 28px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.insight-steps li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.insight-steps p {
  margin: 0;
  padding-top: 3px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #3d3d3d;
}
.step-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-ink);
}
.step-purple { background: #d9c2f5; }
.step-yellow { background: #f6e6a3; }
.step-orange { background: #f6c8a3; }
.step-blue { background: #aac9f5; }

.insight-box img {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
  margin: 24px auto 0;
}

.insight-box-green {
  border-color: #bfe6ba;
}
.insight-box-yellow {
  border-color: #f6e6a3;
}

.example-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.insight-box .example-panel h3 {
  margin-bottom: 0;
}
.example-panel img {
  width: 100%;
  height: auto;
  margin-top: 16px;
  border-radius: 0;
}
@media (max-width: 700px) {
  .example-compare {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.insight-box-split {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
}
.insight-box-split .insight-box-text h3 {
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.insight-box-split .insight-box-text p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #3d3d3d;
  margin-bottom: 16px;
}
.insight-box-split .insight-box-text p:last-child {
  margin-bottom: 0;
}
.insight-box-split img {
  width: 280px;
  max-width: 40vw;
  height: auto;
  margin: 0;
  border-radius: 0;
}
@media (max-width: 700px) {
  .insight-box-split {
    grid-template-columns: 1fr;
  }
  .insight-box-split img {
    width: 100%;
    max-width: 100%;
    margin-top: 24px;
  }
}

/* ---------- Project content block (placeholder) ---------- */
.project-content {
  padding-bottom: 96px;
}
.section-divider {
  height: 60px;
}

.small-section-divider {
  height: 30px;
}

.image-placeholder {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  background: #f0f1f5;
  border: 2px dashed #c7cbe0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 40px;
}
.image-placeholder span {
  color: var(--color-muted);
  font-weight: 500;
  font-size: 1rem;
}
.concept-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.concept-image-flat {
  border-radius: 0;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 24px;
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.exhibition-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.gallery-img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.gallery-img-wide {
  grid-column: 1 / -1;
  aspect-ratio: 1280 / 1698;
}
@media (max-width: 640px) {
  .exhibition-gallery {
    grid-template-columns: 1fr;
  }
}

/* ---------- Other projects ---------- */
.other-projects {
  padding: 80px 24px 100px;
}
.other-projects .section-title {
  margin-bottom: 48px;
}
.other-projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 700px) {
  .other-projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .other-projects-grid { grid-template-columns: repeat(3, 1fr); }
}

.other-projects .card-glow {
  inset: -18px;
  filter: blur(28px) brightness(0.95) saturate(1.25) contrast(1);
}

.other-project-card {
  position: relative;
  z-index: 1;
  display: block;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.other-project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}
.other-project-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.other-project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.other-project-info {
  padding: 24px 24px 32px;
}
.other-project-info .project-meta {
  margin-bottom: 10px;
}
.other-project-info h3 {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-ink);
  min-height: 2.7rem;
}

/* ---------- Contact ---------- */
.contact {
  text-align: center;
  padding: 110px 24px;
}
.contact-eyebrow {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}
.contact-question {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 36px;
}
.social-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}
.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.social-icon:hover {
  transform: translateY(-3px);
  opacity: 0.75;
}
.social-icon img {
  width: clamp(22px, 5vw, 30px);
  height: auto;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 28px 0;
}
.site-footer p {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    padding: 16px 24px 24px;
    display: none;
    gap: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }
  .nav.open { display: flex; }
  .project-visual { min-height: 220px; }
}

/* Tablet: tighten section rhythm between the mobile stack and the two-column desktop layout */
@media (min-width: 600px) and (max-width: 879px) {
  .project-text { padding: 40px 36px; }
  .section-divider { height: 45px; }
}

@media (max-width: 599px) {
  .hero { padding: 56px 20px 72px; }
  .project-text { padding: 32px 24px; }
  .contact { padding: 72px 20px; }
  .contact-question { font-size: 1.2rem; }
  .section-divider { height: 30px; }
}
