:root {
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #3e3e42;
  --color-accent: #f97316;
  --color-accent-dark: #ea580c;
  --color-border: #e5e5e7;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-code: "JetBrains Mono", monospace;
  --max-width: 1200px;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --radius: 20px;
  --radius-sm: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #222222;
    --color-surface: #151515;
    --color-text: #fafafa;
    --color-text-muted: #d4d4d7;
    --color-border: #5b5b5d;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-color: Canvas;
  color: CanvasText;
  color-scheme: light dark;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

.logo {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.tagline {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 500px;
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto auto auto;
  gap: var(--space-md);
}

.bento-item {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  position: relative;
}

.bento-item:hover {
  transform: scale(1.001);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.bento-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(170deg, var(--color-accent) 5%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.bento-item:hover::before {
  opacity: 0.06;
}

.bento-hero {
  grid-column: span 4;
  grid-row: span 1;
  background: linear-gradient(
    135deg,
    var(--color-accent),
    var(--color-accent-dark)
  );
  color: white;
  overflow: hidden /*visible*/;
}

.bento-hero .logo {
  color: white;
}

.bento-hero .tagline {
  color: rgba(255, 255, 255, 0.9);
}

.bento-hero-bg-logo {
  position: absolute;
  right: -10%;
  top: 50%;
  width: auto;
  aspect-ratio: 1 / 1;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  opacity: 0.8;
  pointer-events: none;
  mix-blend-mode: normal;
  filter: brightness(1.2);
  transform: translateY(-50%);
  z-index: 0;
}

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

.bento-services {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-bios {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-apps {
  grid-column: span 2;
  grid-row: span 1;
}

.bento-contact {
  grid-column: span 2;
  grid-row: span 1;
}

.bento-support {
  grid-column: span 4;
  grid-row: span 1;
}

.bento-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
}

.bento-header-main {
  flex: 1;
}

.bento-label {
  font-family: var(--font-code);
  font-size: 0.75rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
  display: block;
}

.bento-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  z-index: 1;
}

.bento-desc {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
}

.bento-list {
  list-style: none;
  margin: 0;
  position: relative;
  z-index: 1;
}

.bento-list li {
  padding: 0.375rem 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.bento-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
}

.bento-tag {
  display: inline-block;
  background: rgba(249, 115, 22, 0.1);
  color: var(--color-accent);
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.bento-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 0;
  transition: color 0.2s;
  position: relative;
  z-index: 1;
}

.bento-link:hover {
  color: var(--color-accent);
}

.bento-link::after {
  content: "→";
  font-size: 0.875rem;
  transition: transform 0.2s;
}

.bento-link:hover::after {
  transform: translateX(4px);
}

.bento-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-text);
  color: var(--color-surface);
  border-radius: 100px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s;
  position: relative;
  z-index: 1;
}

.bento-btn:hover {
  background: var(--color-text);
  transform: translateY(-2px);
}

.bento-btn.primary {
  background: var(--color-accent);
  color: white;
}

.bento-btn.primary:hover {
  background: var(--color-accent-dark);
}

.bento-btn.secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.bento-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.bento-btn.outline {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.bento-btn.outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.mini-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.mini-bento-item {
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mini-bento-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mini-bento-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  position: relative;
  z-index: 1;
}

.mini-bento-tag {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: var(--font-code);
  position: relative;
  z-index: 1;
}

.mini-bento-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
}

.mini-bento-item.with-icon {
  flex-direction: row;
  justify-content: start;
  align-items: center;
  gap: 0.5rem;
}

.contact-grid {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  z-index: 1;
}

.contact-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: var(--font-code);
  text-transform: uppercase;
}

.contact-value {
  font-size: 1rem;
  font-weight: 500;
}

.contact-value a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-value a:hover {
  color: var(--color-accent-dark);
}

footer {
  padding: var(--space-xl) 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.footer-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-brand {
  font-weight: 600;
  color: var(--color-text);
}

@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
  }

  .bento-hero {
    grid-column: span 2;
  }

  .bento-services,
  .bento-bios {
    grid-column: span 1;
    grid-row: span 1;
  }

  .bento-apps,
  .bento-contact {
    grid-column: span 1;
  }

  .bento-support {
    grid-column: span 2;
  }

  .bento-header {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .bento-tag {
    align-self: flex-start;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
}

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

  .bento-hero,
  .bento-services,
  .bento-bios,
  .bento-apps,
  .bento-contact,
  .bento-support {
    grid-column: span 1;
    grid-row: span 1;
  }

  .bento-btn {
    width: 100%;
  }

  .bento-header {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .bento-hero-bg-logo {
    top: 0%;
    transform: translateY(-0%);
    opacity: 0.5;
  }

  .bento-tag {
    align-self: flex-start;
  }

  .mini-bento-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/***********************************/
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

.vt-bios {
  view-transition-name: bios;
}

/***********************************/

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: var(--space-sm);
  transition: color 0.2s ease;
}

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

.back-link::before {
  content: "←";
  margin-right: 0.5rem;
}

/* Bio detail cards */
.bio-detail {
  display: flex;
  flex-direction: column;
}

.bio-preview {
  position: relative;
  height: 120px;
  border-radius: var(--radius);
  overflow: hidden;
}

.bio-gradient {
  width: 100%;
  height: 100%;
}

.bio-content h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  position: relative;
  z-index: 1;
}

.bio-content p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.bio-content .bento-list {
  margin-top: var(--space-md);
}

.bento-link {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.bento-link:hover {
  opacity: 0.8;
}
