:root {
  --primary: #4251f4;
  --accent: #f5a800;
  --text: #1f2336;
  --muted: #5d6487;
  --surface: #ffffff;
  --bg: #fef5e4;
  --line: #111111;
  --header: #ffffff;
  --font-sans: "Montserrat", "Segoe UI", sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-heavy: 800;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.58;
  font-weight: var(--fw-regular);
  animation: pageFade 220ms ease-out;
}

.icon-inline {
  margin-right: 0.4rem;
  font-size: 0.95em;
  vertical-align: -0.08em;
}

p,
li {
  font-weight: var(--fw-regular);
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  max-width: 1200px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  margin: auto;
  margin-top: 0.9rem;
  border-radius: 14px;
  background: var(--header);
}

.brand {
  color: var(--primary);
  text-decoration: none;
  font-weight: var(--fw-heavy);
  letter-spacing: 0.01em;
  text-shadow: 1px 1px 0 #ffffff;
}

.nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 0.7rem;
}

.nav-list a {
  text-decoration: none;
  color: var(--text);
  font-weight: var(--fw-medium);
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.24rem 0.62rem;
  background: #ffffff;
  transition: color 0.22s ease, border-color 0.22s ease;
}

.nav-list a:hover {
  color: var(--primary);
  border-color: var(--line);
}

.hero {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1rem;
}

.hero-main,
.hero-contact {
  border-radius: 16px;
  background: var(--surface);
}

.hero-main {
  padding: 1.6rem;
}

.hero-contact {
  padding: 1.4rem;
  background: linear-gradient(160deg, #4251f4 0%, #4a5cff 100%);
  color: #ffffff;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
}

h1,
h2,
h3 {
  font-family: var(--font-sans);
  line-height: 1.15;
  margin: 0;
}

h1 {
  margin-top: 0.45rem;
  font-size: clamp(2rem, 4.8vw, 3.5rem);
  color: var(--primary);
  font-weight: var(--fw-heavy);
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  margin-bottom: 0.8rem;
  font-weight: var(--fw-bold);
}

h3 {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: var(--fw-bold);
}

.hero-role {
  margin: 0.75rem 0 0;
  font-size: 1.05rem;
  max-width: 62ch;
  font-weight: var(--fw-regular);
}

.hero-actions {
  margin-top: 1.3rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.62rem 1rem;
  font-weight: var(--fw-semibold);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px) translateX(-1px);
  filter: brightness(1.02);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-accent {
  background: #fff8e7;
  color: #6a4a00;
  border-color: var(--line);
}

.hero-contact h2 {
  color: #ffcf52;
}

.hero-contact ul {
  margin: 0;
  padding-left: 1.1rem;
}

.hero-contact li {
  margin: 0.2rem 0;
}

.grid-intro {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  border-radius: 14px;
  background: var(--surface);
  padding: 1.2rem;
}

.line-item {
  margin: 0.35rem 0;
}

.tag-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-list li {
  border: 2px solid var(--accent);
  color: var(--primary);
  font-weight: bold;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.86rem;
  background: #ffffff;
}

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

.project-intro {
  margin-top: 0;
  color: var(--muted);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  margin-top: 0.95rem;
  border: 2px solid var(--accent);
  border-bottom: 5px solid var(--accent);
  border-radius: 14px;
  padding: 1rem;
  background: #ffffff;
  transition: transform 0.4s ease, 
              border 0.1s ease,
              padding 0.2s ease;
}

.project-card:hover {
  transform: translateY(-1.5em);
  transition: transform 0.4s ease, 
              border 0.1s ease,
              padding 0.2s ease;
  border: 4px solid var(--accent);
  border-bottom: 8px solid var(--accent);
  padding: 0.8rem;
  font-weight: bold;
}

.project-preview {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.preview-media {
  border-radius: 12px;
  overflow: hidden;
  display: block;
  background: #ffffff;
}

.preview-media img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.preview-media:hover img {
  transform: scale(1.02);
}

.project-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.project-meta {
  margin: 0.4rem 0 0;
  color: #2f3a70;
  font-weight: var(--fw-medium);
}

.detail-list {
  margin: 0.65rem 0;
  padding-left: 1.1rem;
}

.detail-list li {
  margin: 0.3rem 0;
}

.project-links {
  margin: 0.2rem 0 0;
  color: #33407a;
}

.text-link {
  color: var(--primary);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

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

.project-page {
  margin-top: 1rem;
  padding-bottom: 0.5rem;
}

.project-hero {
  border-top: 4px solid var(--primary);
}

.meta-pills {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.meta-pills span {
  border: 2px solid var(--accent);
  border-radius: 999px;
  padding: 0.32rem 0.68rem;
  font-size: 0.85rem;
  font-weight: var(--fw-medium);
  color: #303c72;
  background: #ffffff;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.case-figure {
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.case-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.case-figure figcaption {
  padding: 0.72rem 0.78rem 0.82rem;
  font-size: 0.86rem;
  color: var(--muted);
  border-top: 2px solid var(--line);
}

.timeline-item {
  margin-top: 0.95rem;
  border-top: 2px dashed #818181;
  padding-top: 0.95rem;
}

.experience-logo {
  width: 50%;
  display: block;
  margin: 0 0 0.55rem;
  background: #ffffff;
  padding: 0.25rem 0.45rem;
}

.contact-links {
  margin-top: 0.7rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.contact-links a {
  text-decoration: none;
  color: var(--primary);
  border: 2px solid var(--accent);
  background-color: transparent;
  border-radius: 999px;
  padding: 0.48rem 0.8rem;
  font-weight: var(--fw-semibold);
  display: inline-flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: border 0.4s ease;
}

.contact-links a::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--primary);
  transform: translateX(-100%);
  z-index: -1;
  transition: transform 0.4s ease;
}

.contact-links a:hover::before {
  transform: translateX(0);
}

.contact-links a:hover {
  border: 2px solid var(--primary);
  color: #ffffff;
  z-index: 1;
}

.site-footer {
  padding: 1.5rem 0 2rem;
  color: var(--muted);
}

@keyframes pageFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body {
    animation: none;
  }

  .btn,
  .preview-media img,
  .nav-list a,
  .project-card {
    transition: none;
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .grid-intro {
    grid-template-columns: 1fr 1fr;
  }

  .preview-grid,
  .case-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .nav-list {
    gap: 0.55rem;
    flex-wrap: wrap;
  }

  .grid-intro {
    grid-template-columns: 1fr;
  }

  .hero-main,
  .hero-contact,
  .card {
    padding: 1rem;
  }

  .preview-media img {
    height: 200px;
  }
}

/* Shared styles for project detail pages */
body.project-case {
  --primary: #4251f4;
  --accent: #f5a800;
  --text: #25283d;
  --muted: #6e7391;
  --line: #e4e6ee;
  --surface: #ffffff;
  --bg: #f7f8ff;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", "Segoe UI", sans-serif;
  line-height: 1.58;
  font-weight: 400;
  white-space: normal;
}

body.project-case .top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffffee;
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--line);
  animation: navReveal 340ms ease-out;
}

body.project-case .top-nav-inner {
  width: min(900px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.7rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.project-case .top-nav a {
  text-decoration: none;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  transition: color 0.2s ease;
}

body.project-case .top-nav a:hover {
  color: #2d3be0;
}

body.project-case .top-nav .sep {
  color: #a6aac2;
  margin: 0 0.45rem;
}

body.project-case .page {
  width: min(900px, calc(100% - 2rem));
  margin: 1rem auto 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.35rem 1.6rem;
  animation: pageReveal 260ms ease-out;
}

body.project-case a,
body.project-case a.visited {
  color: var(--primary);
  text-decoration: none;
}

body.project-case a:hover {
  text-decoration: underline;
}

body.project-case h1,
body.project-case h2,
body.project-case h3 {
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 0;
  color: #1f2235;
  font-family: "Montserrat", "Segoe UI", sans-serif;
}

body.project-case h1 {
  font-weight: 700;
}

body.project-case h2,
body.project-case h3 {
  font-weight: 600;
}

body.project-case h1 strong,
body.project-case h2 strong,
body.project-case h3 strong,
body.project-case strong {
  font-weight: 600;
}

body.project-case p,
body.project-case li {
  font-weight: 400;
}

body.project-case .page-title {
  font-size: clamp(1.85rem, 3.6vw, 2.45rem);
  font-weight: 800;
  color: #1f2235;
  margin-top: 0;
  margin-bottom: 0.55em;
}

body.project-case .page header {
  margin-bottom: 0.7rem;
}

body.project-case .page-body {
  margin-top: 0.7rem;
}

body.project-case .page-body h1 {
  font-size: clamp(1.28rem, 2.5vw, 1.72rem);
  margin-top: 1.45rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--line);
}

body.project-case h2 {
  font-size: 1.22rem;
  margin-top: 1rem;
}

body.project-case h3 {
  font-size: 1.05rem;
  margin-top: 0.9rem;
}

body.project-case .properties {
  border: 1px solid #e9e9e6;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #fff;
}

body.project-case .properties th,
body.project-case .properties td {
  border: none;
  border-bottom: 1px solid #efefec;
  padding: 0.52rem 0.7rem;
}

body.project-case .properties tr:last-child th,
body.project-case .properties tr:last-child td {
  border-bottom: none;
}

body.project-case .properties th {
  color: var(--muted);
  width: 170px;
  font-weight: 500;
}

body.project-case .callout {
  border: 1px solid #e9e9e6;
  border-radius: 8px;
  padding: 0.72rem 0.9rem;
  background: #fff;
}

body.project-case .callout + .callout {
  margin-top: 0.45rem;
}

body.project-case p {
  margin-top: 0.42em;
  margin-bottom: 0.48em;
  font-weight: 400;
}

body.project-case figure {
  margin: 1rem 0;
  page-break-inside: avoid;
}

body.project-case .image {
  text-align: center;
}

body.project-case img {
  max-width: 100%;
  border-radius: 10px;
  border: none;
  display: block;
  margin: 0 auto;
}

body.project-case figcaption {
  opacity: 1;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.55em;
  font-weight: 400;
}

body.project-case .indented {
  padding-left: 1rem;
}

body.project-case hr {
  border: none;
  border-bottom: 1px solid var(--line);
  margin: 0.9rem 0;
}

body.project-case table,
body.project-case th,
body.project-case td {
  border: 1px solid var(--line);
  border-collapse: collapse;
}

body.project-case table {
  border-left: none;
  border-right: none;
}

body.project-case th,
body.project-case td {
  font-weight: 400;
  padding: 0.25em 0.5em;
  line-height: 1.5;
  min-height: 1.5em;
  text-align: left;
}

body.project-case .column-list {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

body.project-case .column {
  min-width: 0;
  overflow: hidden;
}

body.project-case .column > *:first-child {
  margin-top: 0;
}

body.project-case .selected-value {
  display: inline-block;
  padding: 0 0.5em;
  background: rgba(245, 168, 0, 0.18);
  border-radius: 3px;
  margin-right: 0.5em;
  margin-top: 0.3em;
  margin-bottom: 0.3em;
  white-space: nowrap;
}

@keyframes pageReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes navReveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.project-case .top-nav,
  body.project-case .page {
    animation: none;
  }

  body.project-case .top-nav a {
    transition: none;
  }
}

@media (max-width: 900px) {
  body.project-case .top-nav-inner,
  body.project-case .page {
    width: calc(100% - 1rem);
  }

  body.project-case .page {
    padding: 1rem 0.85rem 1.2rem;
    border-radius: 8px;
  }

  body.project-case .column-list {
    flex-direction: column;
    gap: 0.25rem;
  }

  body.project-case .column {
    width: 100% !important;
  }
}
