/* Premium portfolio design system – branding & layout */
:root {
  --primary: #2E5E4E;
  --primary-dark: #264a3e;
  --primary-light: rgba(46, 94, 78, 0.12);
  --primary-gradient: linear-gradient(135deg, #2E5E4E 0%, #3a6b5a 50%, #2E5E4E 100%);
  --dark: #1F2322;
  --background: #F2F4F3;
  --white: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.9);
  --shadow-sm: 0 2px 12px rgba(31, 35, 34, 0.06);
  --shadow: 0 8px 32px rgba(31, 35, 34, 0.08);
  --shadow-lg: 0 20px 48px rgba(31, 35, 34, 0.12);
  --shadow-hover: 0 16px 40px rgba(31, 35, 34, 0.14);
  --radius: 14px;
  --radius-sm: 12px;
  --radius-lg: 18px;
  --border: rgba(31, 35, 34, 0.1);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.18s ease;
  /* Layout rhythm */
  --section-gap: 56px;
  --card-gap: 24px;
  --card-padding: 26px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--background);
  color: var(--dark);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(160deg, #F2F4F3 0%, rgba(235, 238, 237, 0.98) 45%, #F2F4F3 100%);
  background-attachment: fixed;
}

/* Layout – intentional max-width and rhythm */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 960px;
}

/* Nav – premium hover, focus, sticky with blur */
.site-nav {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 244, 243, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.site-nav a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform var(--transition-fast);
  border-radius: 1px;
}

.site-nav a:hover {
  background: rgba(46, 94, 78, 0.08);
  color: var(--primary);
  transform: translateY(-1px);
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

.site-nav a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.site-nav a:focus-visible::after {
  transform: scaleX(0);
}

.site-nav .logo-link {
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Buttons – gradient primary, micro-animations, disabled */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition), opacity var(--transition-fast);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--white);
}

.btn-primary {
  background: var(--primary-gradient);
  background-size: 200% 200%;
  color: var(--white);
  box-shadow: var(--shadow-sm), 0 2px 0 rgba(0, 0, 0, 0.06);
}

.btn-primary:hover {
  box-shadow: var(--shadow), 0 4px 0 rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm), 0 1px 0 rgba(0, 0, 0, 0.08);
}

.btn-secondary {
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--background);
  border-color: rgba(31, 35, 34, 0.18);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn:disabled,
.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.2);
  box-shadow: none;
  transform: none;
}

.btn-disabled:hover,
.btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Cards – glass surface, hover lift, accent border */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: var(--card-padding);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
  border-color: rgba(46, 94, 78, 0.2);
}

/* Chips – interactive, polished */
.chip {
  display: inline-block;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(46, 94, 78, 0.18);
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.chip:hover {
  background: rgba(46, 94, 78, 0.18);
  border-color: rgba(46, 94, 78, 0.3);
  transform: translateY(-1px);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Typography hierarchy */
h1, h2, h3 {
  margin: 0 0 0.4em;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

h1 { font-size: clamp(28px, 4.2vw, 38px); letter-spacing: -0.04em; }
h2 { font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.03em; }
h3 { font-size: clamp(18px, 2vw, 20px); letter-spacing: -0.02em; }

/* Section spacing – consistent vertical rhythm */
.section {
  margin-bottom: var(--section-gap);
}

.section:last-child {
  margin-bottom: 0;
}

/* Section header pattern – left accent bar */
.section-title {
  margin-bottom: 22px;
  font-size: clamp(20px, 2.5vw, 24px);
  letter-spacing: -0.02em;
  line-height: 32px;
  color: var(--dark);
  padding-left: 16px;
  border-left: 4px solid var(--primary);
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border) 8%, var(--border) 92%, transparent 100%);
  margin: 0 0 28px 0;
  border: none;
}

/* Placeholder / UI preview – mockup frame with window dots */
.preview-block {
  background: linear-gradient(165deg, rgba(250,251,250,0.98) 0%, rgba(242,244,243,0.96) 50%, rgba(235,238,237,0.98) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(31, 35, 34, 0.12);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -1px 0 rgba(31,35,34,0.04);
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(31, 35, 34, 0.45);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.preview-block::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: linear-gradient(180deg, rgba(31,35,34,0.035) 0%, transparent 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 1px solid rgba(31,35,34,0.06);
}

/* Window dots (macOS-style) */
.preview-block::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 18px;
  width: 56px;
  height: 12px;
  background:
    radial-gradient(circle at 8px 6px, rgba(31,35,34,0.35), rgba(31,35,34,0.2)),
    radial-gradient(circle at 28px 6px, rgba(31,35,34,0.35), rgba(31,35,34,0.2)),
    radial-gradient(circle at 48px 6px, rgba(31,35,34,0.35), rgba(31,35,34,0.2));
  background-size: 12px 12px, 12px 12px, 12px 12px;
  background-repeat: no-repeat;
  background-position: 0 0, 20px 0, 40px 0;
  z-index: 1;
}

.preview-block img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  position: absolute;
  inset: 0;
}

/* Project page hero – eyebrow + accent + backdrop */
.hero-wrapper {
  position: relative;
  margin-bottom: var(--section-gap);
}

.hero-wrapper::before {
  content: "";
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width:  min(120%, 640px);
  height: 280px;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(46, 94, 78, 0.08) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hero {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
  line-height: 18px;
}

.hero-accent {
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: var(--primary-gradient);
  margin-bottom: 22px;
}

.hero h1 {
  line-height: 42px;
  margin-bottom: 14px;
}

.hero .tagline {
  position: relative;
  line-height: 28px;
  padding-bottom: 24px;
}

.hero .tagline::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 64px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary-gradient);
}

/* Feature cards – more distinct */
.feature-card {
  border-left: 3px solid var(--primary);
  padding: 24px 24px 24px 22px;
}

.feature-card h3 { margin-bottom: 10px; font-size: 18px; }
.feature-card p { margin: 0; font-size: 15px; opacity: 0.88; line-height: 1.55; }

.feature-card:hover {
  border-left-color: var(--primary-dark);
}

/* Links section – visual grouping */
.links-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  margin-top: 4px;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
  font-size: 15px;
  font-weight: 500;
  color: var(--dark);
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.back-link:hover {
  color: var(--primary);
  transform: translateX(-2px);
}

.back-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Home card – glass and premium */
.home-card {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition), box-shadow var(--transition);
}

.home-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.logo {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: var(--primary-gradient);
  color: var(--white);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow);
}

/* Responsive – stack, wrap, scale */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .site-nav { padding: 16px; }
  .card { padding: 20px; }
  .links-card { padding: 22px 20px; }
  .section-title { padding-left: 12px; font-size: 20px; line-height: 28px; }
  .hero h1 { font-size: 26px; line-height: 34px; }
  .hero .tagline { font-size: 16px; line-height: 26px; max-width: 100%; }
  .preview-block { aspect-ratio: 16 / 11; min-height: 200px; }
  .preview-block::after { top: 12px; left: 14px; transform: scale(0.9); }
  .links-row { flex-direction: column; align-items: stretch; }
  .links-row .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .projects-grid { grid-template-columns: 1fr; gap: var(--card-gap); }
  .project-card .btn { width: 100%; justify-content: center; }
}

/* ========== PROJECTS LIST PAGE ========== */
.projects-page {
  padding: 32px 0 64px;
}
.projects-intro {
  margin-bottom: 40px;
  max-width: 560px;
}
.projects-intro p {
  margin: 0;
  font-size: 17px;
  color: var(--dark);
  opacity: 0.85;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--card-gap);
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: stretch;
}
.projects-grid > li {
  display: flex;
  min-width: 0;
}
.project-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 0;
}
.project-card .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}
.project-card .card > .landing-project-thumb {
  flex-shrink: 0;
}
.project-card h2 {
  margin-bottom: 8px;
  font-size: 20px;
}
.project-card .description {
  flex: 1;
  margin: 0 0 16px;
  font-size: 15px;
  opacity: 0.85;
  line-height: 1.5;
}
.project-card .chips {
  margin-bottom: 12px;
}
.project-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* ========== PLACEHOLDER PROJECT PAGE (coming soon) ========== */
.placeholder-page {
  padding: 48px 0 64px;
  text-align: center;
}
.placeholder-page .card {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 32px;
}
.placeholder-page h1 {
  margin-bottom: 12px;
}
.placeholder-page p {
  margin: 0;
  opacity: 0.88;
  line-height: 1.5;
}
.placeholder-page .btn {
  margin-top: 20px;
}

/* ========== PROJECT DETAIL PAGE (e.g. product-insight-scanner) ========== */
.project-page {
  padding: 24px 0 64px;
}
.project-page .hero h1 {
  margin-bottom: 12px;
}
.project-page .hero .tagline {
  font-size: 18px;
  opacity: 0.85;
  margin: 0;
  max-width: 560px;
}
.project-page .rationale {
  max-width: 640px;
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
  opacity: 0.9;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* ========== LANDING PAGE ========== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  padding: 12px 16px;
  background: var(--primary);
  color: var(--white);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 16px;
  outline: 2px solid var(--dark);
  outline-offset: 2px;
}

.site-nav .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.site-nav .nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--dark);
}
.site-nav .nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: var(--transition-fast);
}

.landing-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 60px;
  text-align: center;
}
.landing-hero-inner {
  max-width: 560px;
}
.landing-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 44px);
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.landing-hero-role {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.02em;
}
.landing-hero-tagline {
  margin: 0 0 32px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--dark);
  opacity: 0.9;
}
.landing-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.landing-section {
  padding: 64px 0;
}
.landing-section-title {
  margin: 0 0 32px;
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: -0.03em;
  padding-left: 16px;
  border-left: 4px solid var(--primary);
}
.landing-projects {
  background: rgba(255, 255, 255, 0.4);
}
.landing-projects-more {
  margin: 28px 0 0;
  text-align: center;
}
.landing-projects-more a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}
.landing-projects-more a:hover {
  text-decoration: underline;
}
.landing-projects-more a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.landing-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--card-gap);
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: stretch;
}
/* Equal-height cards in each row: fill grid cell */
.landing-project-grid > li {
  display: flex;
  min-width: 0;
}
.landing-project-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.landing-project-card .landing-project-body {
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.landing-project-thumb {
  aspect-ratio: 16 / 10;
  min-height: 140px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.landing-project-thumb-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.landing-project-thumb-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  /* Zoom into center so thumbnail looks sharper and less cramped */
  transform: scale(1.4);
}
.landing-project-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: rgba(31, 35, 34, 0.5);
  background: linear-gradient(145deg, rgba(46, 94, 78, 0.12) 0%, rgba(31, 35, 34, 0.06) 100%);
}
.landing-project-thumb-link:hover .landing-project-thumb-placeholder { opacity: 0.9; }
.landing-project-title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.3;
}
.landing-project-desc {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.88;
}
.landing-project-body .chip-list {
  margin-bottom: 4px;
}
.landing-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}
.landing-project-card .btn { flex-shrink: 0; }

.landing-about-text {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.65;
  max-width: 560px;
  opacity: 0.92;
}
.landing-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
}
.landing-skill-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.landing-skill-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}
.landing-skill-items {
  font-size: 14px;
  opacity: 0.9;
}

.landing-footer {
  padding: 40px 0 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
}
.landing-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-bottom: 20px;
}
.landing-footer-links a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 6px 0;
  transition: color var(--transition-fast);
}
.landing-footer-links a:hover {
  color: var(--primary);
}
.landing-footer-links a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.landing-footer-copy {
  margin: 0;
  font-size: 13px;
  opacity: 0.7;
}

/* Landing: mobile nav */
@media (max-width: 768px) {
  .site-nav .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(242, 244, 243, 0.98);
    backdrop-filter: blur(10px);
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--transition), opacity var(--transition-fast);
  }
  .site-nav .nav-links.is-open {
    max-height: 320px;
    opacity: 1;
  }
  .site-nav .nav-links a {
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
  }
  .site-nav .nav-toggle {
    display: flex;
  }
  .landing-hero { padding: 60px 16px 48px; }
  .landing-section { padding: 48px 0; }
  .landing-project-grid { grid-template-columns: 1fr; }
  .landing-skills { flex-direction: column; gap: 20px; }
}

@media (max-width: 640px) {
  .landing-hero-ctas { flex-direction: column; align-items: stretch; }
  .landing-hero-ctas .btn { width: 100%; justify-content: center; }
  .landing-project-actions .btn { flex: 1; min-width: 0; justify-content: center; }
}
