:root {
  --bg: #fbfaf7;
  --bg-deep: #f4f2ed;
  --bg-card: #ffffff;
  --ink: #14130e;
  --ink-soft: #2b2924;
  --muted: #8e887a;
  --muted-soft: #cfc9bd;
  --rule: #14130e;
  --rule-light: #e5e0d3;
  --accent: #b8624f;
  --signal: #c44a2a;
  --maxw: 640px;
  --pad-x: clamp(1.1rem, 3vw, 1.5rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 10% -5%, rgba(184,98,79,0.03), transparent 35%),
    radial-gradient(ellipse at 90% 110%, rgba(20,19,14,0.02), transparent 40%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

.mono { font-family: "IBM Plex Mono", monospace; font-feature-settings: "ss01"; }
.italic { font-family: "Fraunces", serif; font-style: italic; font-weight: 400; }
.uppercase { text-transform: uppercase; letter-spacing: 0.12em; font-size: 10px; }
.muted { color: var(--muted); }
.hide-md { display: inline; }
.ul {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
  transition: opacity 0.25s var(--ease);
}
.ul:hover { opacity: 0.6; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.78); opacity: 0.5; }
}

/* LANGUAGE SWITCH ------------------------------------------ */
.lang-switch {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  background: rgba(251, 250, 247, 0.78);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid var(--rule-light);
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.lang-opt {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: color 0.25s var(--ease);
}
.lang-opt:hover { color: var(--ink); }
.lang-opt.is-active { color: var(--ink); }
.lang-sep { color: var(--muted-soft); }

/* PAGE ----------------------------------------------------- */
.page {
  padding-top: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
}

/* INTRO ---------------------------------------------------- */
.intro {
  padding: 2.5rem var(--pad-x) 3.25rem;
}
.sig-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.sig-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  filter:
    drop-shadow(0 10px 18px rgba(20,19,14,0.10))
    drop-shadow(0 3px 6px rgba(20,19,14,0.06));
}
.sig-wrap .sig { margin-bottom: 0; }
.intro-greet {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  margin-bottom: 2rem;
}

/* ICON ROW (clickable) ------------------------------------- */
.icon-row {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.icon-tile {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 16px;
  overflow: visible;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  filter:
    drop-shadow(0 22px 32px rgba(20,19,14,0.10))
    drop-shadow(0 6px 12px rgba(20,19,14,0.06));
  transition:
    transform 0.55s var(--ease),
    filter 0.5s var(--ease),
    opacity 0.3s var(--ease);
  opacity: 0.55;
}
.icon-tile img,
.icon-tile .contain-img {
  border-radius: 16px;
  display: block;
}
.icon-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.icon-tile .contain-img {
  object-fit: contain;
  padding: 5px;
  background: #fff;
}
.icon-tile:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}
.icon-tile.is-active {
  opacity: 1;
  transform: translateY(-3px);
  filter:
    drop-shadow(0 28px 44px rgba(20,19,14,0.14))
    drop-shadow(0 10px 18px rgba(20,19,14,0.08));
}
.icon-tile.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal);
  transform: translateX(-50%);
  animation: pulse 2s ease-in-out infinite;
}

/* BLURB (click-revealed) ----------------------------------- */
.blurb {
  margin-bottom: 2.5rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--rule-light);
}
.blurb-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.55rem;
  color: var(--muted);
}
.blurb-meta #b-code { color: var(--ink); }
.blurb-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1;
  margin-bottom: 0.6rem;
}
.blurb-body {
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 0.85rem;
  max-width: 50ch;
}
.eth-amount {
  position: relative;
  border-bottom: 1px dotted currentColor;
  cursor: help;
  padding-bottom: 1px;
}
.eth-amount::after {
  content: attr(data-usd);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  background: var(--ink);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%) translateY(3px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease);
}
.eth-amount:hover::after,
.eth-amount:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.blurb-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: letter-spacing 0.35s var(--ease), opacity 0.25s var(--ease);
}
.blurb-cta:hover { letter-spacing: 0.13em; }
@keyframes flash {
  0% { opacity: 0.45; transform: translateY(3px); }
  100% { opacity: 1; transform: translateY(0); }
}
.blurb-flash { animation: flash 0.45s var(--ease); }

.icon-tile .contain-img-white {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 5px;
  background: #fff;
  border-radius: 16px;
  display: block;
}
.icon-tile .contain-img-black {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 4px;
  background: #000;
  border-radius: 16px;
  display: block;
}

/* INTRO BODY ----------------------------------------------- */
.intro-body p {
  font-size: 13px;
  line-height: 1.7;
  max-width: 52ch;
  margin-bottom: 1.1rem;
  color: var(--ink-soft);
}
.intro-body p strong {
  color: var(--ink);
  font-weight: 500;
}
.intro-segue {
  color: var(--ink) !important;
  font-weight: 400 !important;
}

/* PROJECTS LIST -------------------------------------------- */
.projects {
  padding: 1.75rem var(--pad-x) 2.25rem;
  border-top: 1px solid var(--rule-light);
}
.proj-toggle { width: 100%; }
.proj-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule-light);
  user-select: none;
  list-style: none;
  transition: color 0.25s var(--ease), border-color 0.3s var(--ease);
}
.proj-summary::-webkit-details-marker { display: none; }
.proj-summary::marker { display: none; }
.proj-summary:hover { color: var(--ink); border-color: var(--ink); }
.proj-toggle[open] > .proj-summary {
  color: var(--ink);
  border-color: var(--ink);
  margin-bottom: 0.5rem;
}
.proj-summary-right {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
}
.proj-chev {
  display: inline-block;
  width: 12px;
  text-align: center;
  font-weight: 500;
  transition: transform 0.35s var(--ease);
  color: var(--ink);
}
.proj-toggle[open] > .proj-summary .proj-chev {
  transform: rotate(45deg);
}
.proj-list {
  list-style: none;
  animation: unfold 0.45s var(--ease);
}
@keyframes unfold {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.proj {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule-light);
  align-items: start;
}
.proj:first-child { border-top: 1px solid var(--rule-light); }
.proj-tag {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding-top: 3px;
}
.proj-name {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
  letter-spacing: -0.005em;
  transition: opacity 0.25s var(--ease);
}
.proj-name:hover { opacity: 0.65; }
.proj-sub {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.55rem;
}
.proj-body {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 48ch;
}

/* OUTRO ---------------------------------------------------- */
.outro {
  padding: 2rem var(--pad-x) 2rem;
  border-top: 1px solid var(--rule-light);
}
.outro-line {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
  max-width: 52ch;
}
.sig {
  font-family: "Caveat", "Fraunces", serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2rem;
  letter-spacing: 0;
  line-height: 1;
}


/* SELECTION ------------------------------------------------ */
::selection { background: var(--ink); color: var(--bg); }

/* RESPONSIVE ----------------------------------------------- */
@media (max-width: 560px) {
  .hide-md { display: none; }
  .intro { padding: 1.5rem var(--pad-x) 2.5rem; }
  .icon-tile { width: 56px; height: 56px; }
  .blurb-title { font-size: 1.25rem; }
  .proj { grid-template-columns: 44px 1fr; gap: 0.85rem; }
}

/* REDUCED MOTION ------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .icon-tile.is-active::after { animation: none; }
}
