/* Reusable pieces: buttons, cards, the home page widgets, the tech stack list. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
}

.button--dark {
  background: var(--fg);
  color: var(--bg);
  padding: 11px 18px;
  font-size: 14px;
  transition: transform 0.25s ease;
}

.button--dark:hover {
  color: var(--bg);
  transform: translateY(-2px);
}

.button--accent {
  background: var(--accent);
  color: #fff;
  padding: 15px 26px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.button--accent:hover {
  color: #fff;
}

.button--quiet {
  border: 1px solid var(--border);
  padding: 15px 26px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 15px;
  transition: background 0.25s ease;
}

.icon-button:hover {
  background: var(--surface);
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.tag {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.widget-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 96px 0 40px;
  text-align: center;
}

.hero__avatar {
  width: clamp(220px, 30vw, 360px);
  animation: drift 7s ease-in-out infinite;
}

.hero__name {
  font-size: clamp(34px, 3.8vw, 48px);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.hero__role {
  margin-top: 6px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--hero-sub);
}

/* ---------- Bento grid of home page widgets ---------- */

.section {
  padding: 24px 0 72px;
}

.section--widgets {
  padding-top: 112px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-head .eyebrow {
  display: block;
  margin-bottom: 10px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--gap);
}

.bento__pair {
  display: grid;
  gap: var(--gap);
}

.bento__pair--split {
  grid-template-columns: 3fr 2fr;
}

.bento__pair--even {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

@media (min-width: 901px) {
  .bento__pair {
    grid-column: span 3;
  }

  .bento__wide {
    grid-column: span 2;
  }
}

/* Location widget: an iMessage thread ending in a map. */
.widget-location {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  min-height: 230px;
}

.widget-location__label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-location__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

.thread {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  margin: 0;
  max-width: 78%;
  padding: 9px 14px;
  font-size: 15px;
  line-height: 1.35;
}

.bubble--in {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px 18px 18px 5px;
}

.bubble--out {
  align-self: flex-end;
  background: #0071e3;
  color: #fff;
  border-radius: 18px 18px 5px 18px;
}

.bubble--map {
  position: relative;
  align-self: flex-end;
  width: 74%;
  max-width: none;
  padding: 0;
  border-radius: 18px 18px 5px 18px;
  overflow: hidden;
}

.bubble--map svg {
  width: 100%;
  height: auto;
}

.bubble--map figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 18px 12px 9px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), transparent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.thread__receipt {
  position: absolute;
  right: 0;
  bottom: -17px;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Facts widget. */
.widget-facts {
  container-type: inline-size;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 230px;
  overflow: hidden;
}

.widget-facts__body {
  flex: 1 1 240px;
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.fact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fact-list {
  margin: 0;
}

.fact dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fact dd {
  margin: 3px 0 0;
  margin-inline-start: 0;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.028em;
}

.fact dd span {
  color: var(--text-muted);
}

.widget-facts img {
  width: 232px;
  margin-left: auto;
  align-self: center;
}

/* Appearance widget: a mock editor whose toggle drives the site theme. */
.widget-theme {
  container-type: inline-size;
  height: 320px;
  padding: 85px 85px 0 20px;
  background: var(--editor-shell, #f7f7f7);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  transition: background 0.4s ease;
}

[data-theme="dark"] .widget-theme {
  --editor-shell: #101012;
  --editor-pane: rgba(255, 255, 255, 0.05);
  --editor-fg: #e8e8ed;
  --editor-rule: rgba(255, 255, 255, 0.12);
  --editor-muted: rgba(255, 255, 255, 0.45);
  --editor-track: rgba(255, 255, 255, 0.18);
}

.editor {
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
  padding: 18px 20px;
  background: var(--editor-pane, #fff);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
  transition: background 0.4s ease;
}

.editor__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--editor-rule, rgba(0, 0, 0, 0.09));
}

.editor__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.editor__file {
  margin-left: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--editor-muted, var(--text-muted));
}

.editor__spacer {
  flex: 1;
}

.editor__caption {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--editor-muted, var(--text-muted));
}

.editor code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.4px;
  line-height: 1.75;
  color: var(--editor-fg, var(--fg));
  white-space: pre;
  overflow: hidden;
}

.switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--editor-track, #d9d9de);
  transition: background 0.4s ease;
}

.switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}

[data-theme="dark"] .switch__knob {
  transform: translateX(20px);
}

/* Interests widget: a vertical reel of one-liners. */
.widget-interests {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  min-height: 320px;
}

.reel {
  align-self: stretch;
  height: 62px;
  overflow: hidden;
}

.reel__track {
  animation: reel 5.4s var(--ease-inout) infinite;
}

.reel__item {
  height: 62px;
  line-height: 62px;
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 600;
  letter-spacing: -0.035em;
}

/* Philosophy widget. */
.widget-quote {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 320px;
}

.widget-quote__text {
  font-size: clamp(26px, 2.8vw, 38px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.16;
}

.widget-quote__text span {
  color: var(--hero-sub);
}

/* Toolbox widget: glass tiles drifting behind the label. */
.widget-tools {
  position: relative;
  min-height: 320px;
  padding: 26px 0;
  overflow: hidden;
}

.widget-tools .widget-label {
  display: block;
  margin: 0 26px 18px;
}

.tool-field {
  position: absolute;
  inset: 56px 0 0;
  pointer-events: none;
}

.tool-tile {
  position: absolute;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 0.5px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.62) 46%, rgba(255, 255, 255, 0.42) 100%);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1px 1px rgba(0, 0, 0, 0.05);
  animation: drift 7s ease-in-out infinite;
}

.tool-tile img {
  width: 50px;
  height: 50px;
}

/* ---------- Project carousel ---------- */

.carousel {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 4px 0 8px;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.project-card {
  position: relative;
  flex: none;
  width: clamp(300px, calc((100% - 32px) / 2.4), 520px);
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 26px;
}

.project-card .tag {
  position: absolute;
  top: 26px;
  right: 26px;
}

.project-card h3 {
  min-height: 58px;
  padding-right: 120px;
  margin-bottom: 14px;
  font-size: 26px;
  display: flex;
  align-items: flex-start;
}

.project-card p {
  margin-bottom: 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-sub);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.project-card .text-link {
  margin-bottom: 20px;
}

.project-card__art {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ---------- Tech stack ---------- */

.stack {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  align-items: start;
}

.stack h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.stack-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.stack-item img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex: none;
}

.stack-item dl {
  margin: 0;
  min-width: 0;
}

.stack-item dt {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.stack-item dd {
  margin: 2px 0 0;
  margin-inline-start: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-sub);
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes reel {
  0%,
  22% {
    transform: translateY(0);
  }
  28%,
  50% {
    transform: translateY(-25%);
  }
  56%,
  78% {
    transform: translateY(-50%);
  }
  84%,
  100% {
    transform: translateY(-75%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__avatar,
  .tool-tile,
  .reel__track,
  .widget-location__dot {
    animation: none;
  }
}

/* The editor pane needs full width once the card gets narrow. */
@container (max-width: 470px) {
  .widget-theme {
    padding-right: 20px;
  }

  .editor {
    border-radius: var(--radius-md);
  }
}

@container (max-width: 430px) {
  .widget-facts img {
    display: none;
  }
}

@media (max-width: 900px) {
  .widget-location,
  .widget-facts,
  .widget-interests,
  .widget-quote,
  .widget-tools,
  .widget-theme {
    min-height: 0;
  }

  .bento__pair--split,
  .bento {
    grid-template-columns: 1fr;
  }

  .stack {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  /* Without room to float, the tiles read better as a simple row. */
  .tool-field {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 0 26px 4px;
  }

  .tool-tile {
    position: static;
    animation: none;
  }
}

@media (max-width: 700px) {
  .bento {
    gap: 12px;
  }

  .reel,
  .reel__item {
    height: 46px;
  }

  .reel__item {
    line-height: 46px;
    font-size: 30px;
  }

  .editor code {
    font-size: 10.5px;
  }
}

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

  .project-card {
    width: 84vw;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}
