/* linkprofile "bento" theme: frosted tiles in a two-column grid, the first link spanning both. */

/*
 * Colours. Light is the base; dark applies when the theme option "mode" is "dark" (the
 * default) or "auto" and the system prefers dark. The palette sits on body, where the
 * accent is set, so the glow can be mixed from it.
 */
body {
  --bg: #f8fafc;
  --glow: color-mix(in srgb, var(--accent) 12%, transparent);
  --glow-2: rgb(59 130 246 / 0.08);
  --card-bg: rgb(255 255 255 / 0.8);
  --card-hover: rgb(255 255 255 / 0.95);
  --card-border: rgb(0 0 0 / 0.08);
  --card-border-hover: rgb(0 0 0 / 0.18);
  --chip-bg: rgb(15 23 42 / 0.03);
  --chip-hover: rgb(15 23 42 / 0.07);
  --ink: #0f172a;
  --muted: #64748b;
}

:root {
  color-scheme: light;
}

:root[data-mode="dark"] {
  color-scheme: dark;
}

:root[data-mode="auto"] {
  color-scheme: light dark;
}

/* The dark palette: keep in sync with the prefers-color-scheme block below. */
:root[data-mode="dark"] body {
  --bg: #09090b;
  --glow: color-mix(in srgb, var(--accent) 18%, transparent);
  --glow-2: rgb(59 130 246 / 0.12);
  --card-bg: rgb(24 24 27 / 0.65);
  --card-hover: rgb(39 39 42 / 0.85);
  --card-border: rgb(255 255 255 / 0.1);
  --card-border-hover: rgb(255 255 255 / 0.22);
  --chip-bg: rgb(255 255 255 / 0.04);
  --chip-hover: rgb(255 255 255 / 0.1);
  --ink: #f4f4f5;
  --muted: #a1a1aa;
}

@media (prefers-color-scheme: dark) {
  :root[data-mode="auto"] body {
    --bg: #09090b;
    --glow: color-mix(in srgb, var(--accent) 18%, transparent);
    --glow-2: rgb(59 130 246 / 0.12);
    --card-bg: rgb(24 24 27 / 0.65);
    --card-hover: rgb(39 39 42 / 0.85);
    --card-border: rgb(255 255 255 / 0.1);
    --card-border-hover: rgb(255 255 255 / 0.22);
    --chip-bg: rgb(255 255 255 / 0.04);
    --chip-hover: rgb(255 255 255 / 0.1);
    --ink: #f4f4f5;
    --muted: #a1a1aa;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 50% 0%, var(--glow), transparent 70%), radial-gradient(circle at 100% 100%, var(--glow-2), transparent 50%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 20px;
  -webkit-font-smoothing: antialiased;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bento-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hero tile */
.bento-hero {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.2);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bento-hero-top {
  display: flex;
  align-items: center;
  gap: 22px;
}

.bento-avatar {
  display: block;
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  object-fit: cover;
  border: 2px solid var(--card-border);
  box-shadow: 0 8px 16px -4px rgb(0 0 0 / 0.3);
}

.bento-hero-text {
  flex: 1;
  min-width: 0;
}

.bento-name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.bento-accent-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.bento-bio {
  margin: 8px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Socials */
.bento-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
}

.bento-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--chip-bg);
  border: 1px solid var(--card-border);
  color: var(--ink);
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.bento-social-link:hover {
  transform: translateY(-2px);
  background: var(--chip-hover);
  border-color: var(--card-border-hover);
}

.bento-social-link svg {
  width: 18px;
  height: 18px;
}

/* Links heading */
.bento-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.bento-section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.bento-section-line {
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

/*
 * Grid: one column on phones, two from 600px with the first link spanning both. With an even
 * number of links the last one would sit alone, so it spans both too.
 */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 600px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-cell--featured,
  .bento-cell:last-child:nth-child(even) {
    grid-column: span 2;
  }
}

.bento-cell {
  display: flex;
}

.bento-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-height: 116px;
  padding: 18px 20px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: var(--ink);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.bento-card:hover {
  transform: translateY(-3px);
  background: var(--card-hover);
  border-color: var(--card-border-hover);
  box-shadow: 0 12px 30px -10px rgb(0 0 0 / 0.25);
}

.bento-card:active {
  transform: translateY(0);
}

.bento-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bento-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--chip-bg);
  border: 1px solid var(--card-border);
  color: var(--ink);
}

.bento-icon-badge svg {
  width: 20px;
  height: 20px;
}

/* A link's own colour fills the badge; on a dark colour (the build works it out) the glyph turns white. */
.is-colored {
  background: var(--link-color);
  border-color: transparent;
  color: #0f172a;
}

.ink-light {
  color: #ffffff;
}

.is-image {
  overflow: hidden;
}

.is-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bento-initial {
  font-size: 14px;
  font-weight: 700;
}

.bento-arrow {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.bento-card:hover .bento-arrow {
  color: var(--ink);
  transform: translate(3px, -3px);
}

.bento-card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

/* Focus */
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .bento-social-link,
  .bento-card,
  .bento-arrow {
    transition: none;
  }

  .bento-social-link:hover,
  .bento-card:hover,
  .bento-card:active,
  .bento-card:hover .bento-arrow {
    transform: none;
  }
}
