/* cally.dev. The grid is the page; everything else is a label stuck on top of it. */
:root {
  --ink: #111114;
  --paper: #F1EFEA;
  --hot: #FF4B1F;
  --go: #2EBD6B;
  --pad: 18px;
  --wm: clamp(40px, 5.2vw, 76px);
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
[data-hud="dark"] { --ink: #F1EFEA; --paper: #111114; }
@media (min-width: 720px) { :root { --pad: 26px; } }

* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: #E7E4DD; }
body {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #E7E4DD;
  color: var(--ink);
  font: 500 11px/1.2 var(--mono);
  letter-spacing: .06em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; letter-spacing: inherit; color: inherit; }

#field { position: fixed; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
#field:active { cursor: grabbing; }
#field.pointing { cursor: pointer; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px 7px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: 500 11px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .25s, color .25s, opacity .3s, transform .7s var(--ease);
}
.chip.quiet {
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  color: var(--ink);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: default;
}
button.chip:hover, a.chip:hover { background: var(--hot); color: #111114; }
.chip:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; }
.narrow { display: none; }
@media (max-width: 719px) { .wide { display: none; } .narrow { display: inline; } }

/* ---------- wordmark: blends with whatever tile is under it ---------- */
.wordmark {
  position: fixed;
  z-index: 5;
  left: var(--pad);
  top: calc(var(--pad) - var(--wm) * .16 + env(safe-area-inset-top));
  margin: 0;
  font: italic 400 var(--wm)/1 var(--serif);
  letter-spacing: -.02em;
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  white-space: nowrap;
  transform-origin: 0 0;
  transition: transform 1.25s cubic-bezier(.7, 0, .15, 1), opacity .4s;
  will-change: transform;
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding:
    calc(var(--pad) + env(safe-area-inset-top))
    calc(var(--pad) + env(safe-area-inset-right))
    calc(var(--pad) + env(safe-area-inset-bottom))
    calc(var(--pad) + env(safe-area-inset-left));
  pointer-events: none;
}
.hud a, .hud button { pointer-events: auto; }
.hud-top, .hud-bottom { display: flex; justify-content: space-between; gap: 12px; }
.hud-top { align-items: flex-start; justify-content: flex-end; }
.hud-bottom { align-items: flex-end; }
.role {
  position: absolute;
  left: calc(var(--pad) + env(safe-area-inset-left));
  top: calc(var(--pad) + env(safe-area-inset-top) + var(--wm) * .92 + 6px);
}
.hud-right { display: flex; gap: 6px; }
.status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--go);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--go) 70%, transparent);
  animation: ping 2.2s infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--go) 70%, transparent); }
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}

.index { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.idx .n { opacity: .55; }
.idx.on, .idx:hover, .idx:focus-visible { background: var(--c, var(--hot)); color: var(--ct, #111114); }
.idx.on .n, .idx:hover .n { opacity: .8; }
.index.has-focus .idx:not(.on) { opacity: .38; }

/* Boot: the HUD waits while the name holds the middle of the screen. */
body.boot .hud .chip { opacity: 0; transform: translateY(14px); }
.hud .chip { transition-delay: calc(var(--i, 0) * 45ms); }
body:not(.boot) .hud .chip:hover { transition-delay: 0s; }
body.covered .wordmark, body.covered .hud { opacity: 0; pointer-events: none; }
body.covered .hud a, body.covered .hud button { pointer-events: none; }
.hud { transition: opacity .3s; }

/* Cursor label */
.label {
  position: fixed;
  z-index: 7;
  left: 0; top: 0;
  display: flex; flex-direction: column; align-items: flex-start;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s;
  will-change: transform;
}
.label.show { opacity: 1; }
.label-head { background: var(--c, var(--ink)); color: var(--ct, var(--paper)); transition: none; }
.label .n { opacity: .6; }
/* The stat swells up like a balloon each time the pointer lands on a new tile. */
.label-stat {
  display: none;
  flex-direction: column;
  padding: 2px 12px 9px 10px;
  background: var(--c, var(--ink));
  color: var(--ct, var(--paper));
  transform-origin: 0 0;
}
.label.has-stat .label-stat { display: flex; }
.label-stat b {
  font: 900 64px/.9 var(--display);
  font-stretch: 125%;
  letter-spacing: -.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.label-stat span { margin-top: 5px; font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.label.puff .label-stat { animation: puff .62s cubic-bezier(.2, 1.5, .35, 1) both; }
@keyframes puff {
  0% { transform: scale(.25, .12); border-radius: 40px; }
  55% { transform: scale(1.14, 1.2); border-radius: 22px; }
  78% { transform: scale(.97, .96); border-radius: 6px; }
  100% { transform: scale(1); border-radius: 0; }
}
@media (hover: none) { .label { display: none; } }

/* ---------- project plate ---------- */
.plate, .about { position: fixed; inset: 0; z-index: 20; }
.plate { background: var(--p-paper, #111); color: var(--p-ink, #fff); }
.plate[hidden], .about[hidden] { display: none; }
.plate-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.plate-ui {
  position: absolute; inset: 0;
  padding:
    calc(var(--pad) + env(safe-area-inset-top))
    calc(var(--pad) + env(safe-area-inset-right))
    calc(var(--pad) + env(safe-area-inset-bottom))
    calc(var(--pad) + env(safe-area-inset-left));
  pointer-events: none;
}
.plate-ui a, .plate-ui button { pointer-events: auto; }
.plate .chip { background: var(--p-ink); color: var(--p-paper); }
.plate .chip.quiet { background: color-mix(in srgb, var(--p-paper) 70%, transparent); color: var(--p-ink); }
.plate .chip.cta { background: var(--p-accent); color: var(--p-paper); }
.plate button.chip:hover, .plate a.chip:hover { background: var(--p-accent); color: var(--p-paper); }
.plate a.chip.cta:hover { background: var(--p-ink); }
.plate-top { display: flex; justify-content: space-between; align-items: flex-start; }

.plate-name {
  position: absolute;
  left: calc(var(--pad) + env(safe-area-inset-left));
  right: calc(var(--pad) + env(safe-area-inset-right));
  bottom: calc(var(--pad) + env(safe-area-inset-bottom) - .08em);
  margin: 0;
  font: 900 120px/.8 var(--display);
  font-stretch: 125%;
  letter-spacing: -.035em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  mix-blend-mode: difference;
}
.plate-name .rise { padding-top: .06em; }
.plate-name .rise > span { display: inline-block; }

.plate-info {
  position: absolute;
  right: calc(var(--pad) + env(safe-area-inset-right));
  top: calc(var(--pad) + env(safe-area-inset-top) + 52px);
  width: min(380px, calc(100% - var(--pad) * 2));
  display: flex; flex-direction: column; gap: 0;
}
.plate-line { margin: 0; }
.plate-line > span {
  background: var(--p-paper); color: var(--p-ink);
  padding: 16px 16px 18px;
  font: 400 clamp(22px, 2.1vw, 30px)/1.12 var(--serif);
  letter-spacing: -.005em;
  text-transform: none;
}
.plate-meta { margin: 0; display: flex; flex-direction: column; gap: 0; }
.plate-meta .rise > span {
  display: flex; justify-content: space-between; gap: 16px;
  background: var(--p-paper); color: var(--p-ink);
  padding: 9px 16px 8px;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--p-ink) 22%, transparent);
}
.plate-meta dt { opacity: .55; }
.plate-meta dd { margin: 0; text-align: right; }
.plate-meta .rise[hidden] { display: none; }
.plate-actions > span { display: flex; gap: 3px; padding-top: 6px; }
.plate-actions .chip { padding: 11px 13px 10px; }
.plate-actions .cta { flex: 1; justify-content: space-between; }
.plate-actions .cta[hidden] { display: none; }

/* Lines rise into place once the curtain has gone. */
.rise { display: block; overflow: hidden; }
.rise > span {
  display: block;
  transform: translateY(108%);
  transition: transform .9s var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms + 60ms);
}
.in .rise > span { transform: none; }

/* ---------- info ---------- */
.about {
  background: color-mix(in srgb, #0B0B0D 80%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  color: #F1EFEA;
  overflow: auto;
  --ink: #F1EFEA; --paper: #111114;
}
.about-inner {
  min-height: 100%;
  display: flex; flex-direction: column;
  padding:
    calc(var(--pad) + env(safe-area-inset-top))
    calc(var(--pad) + env(safe-area-inset-right))
    calc(var(--pad) + env(safe-area-inset-bottom))
    calc(var(--pad) + env(safe-area-inset-left));
}
.about-name {
  margin: auto 0 .1em;
  padding-top: 40px;
  font: italic 400 clamp(72px, 14vw, 220px)/.86 var(--serif);
  letter-spacing: -.03em;
}
.about-name .rise { padding: .04em .06em .12em 0; }
.about-grid { display: grid; gap: 28px 40px; grid-template-columns: 1fr; padding-bottom: 6px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.25fr 1.1fr 1fr; } }
.about-bio { margin: 0 0 26px; font: 400 clamp(22px, 2.2vw, 34px)/1.1 var(--serif); letter-spacing: -.01em; text-transform: none; max-width: 26ch; }
.about h3 { margin: 0 0 10px; font: inherit; text-transform: uppercase; opacity: .5; }
.about-col h3:not(:first-child) { margin-top: 24px; }
.about-list { list-style: none; margin: 0; padding: 0; text-transform: uppercase; }
.about-list li > span { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0 7px; border-top: 1px solid rgba(241, 239, 234, .22); }
.about-list em { font-style: normal; opacity: .55; }
.about-skills, .about-open { margin: 0; line-height: 1.7; text-transform: uppercase; }
.about-links { margin: 14px 0 0; }
/* What I do: the title in the serif, the detail small beside it. */
.about-services li > span { align-items: baseline; padding: 7px 0 8px; }
.about-services b { font: 400 clamp(20px, 1.75vw, 26px)/1.05 var(--serif); letter-spacing: -.01em; text-transform: none; }
.about-services em { text-align: right; }
/* Contact form */
.contact { margin: 14px 0 0; opacity: 0; transition: opacity .6s .35s; }
.in .contact { opacity: 1; }
.contact[hidden] { display: none; }
.contact input, .contact textarea {
  display: block; width: 100%;
  margin: 0; padding: 11px 0 10px;
  border: 0; border-top: 1px solid rgba(241, 239, 234, .22); border-radius: 0;
  background: transparent; color: inherit;
  font: 500 12px/1.4 var(--mono); letter-spacing: .04em;
  outline: none; resize: vertical;
}
.contact textarea { border-bottom: 1px solid rgba(241, 239, 234, .22); min-height: 92px; }
.contact input::placeholder, .contact textarea::placeholder { color: rgba(241, 239, 234, .45); text-transform: uppercase; }
.contact input:focus, .contact textarea:focus { border-top-color: var(--hot); }
.contact .bad { border-top-color: #FF6B63; }
.contact .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.contact-note { margin: 0; text-transform: uppercase; opacity: .7; }
.contact button[disabled] { opacity: .5; cursor: default; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.about-links > span { display: flex; flex-wrap: wrap; gap: 3px; }
.about-links .cta, .contact .cta { background: var(--hot); color: #111114; }

#curtain { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; display: none; pointer-events: none; }

.noscript { position: fixed; inset: 0; z-index: 50; padding: 24px; background: #F1EFEA; color: #111114; font: 16px/1.5 Georgia, serif; letter-spacing: 0; }
.fallback { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }

/* ---------- small screens ---------- */
@media (max-width: 719px) {
  .hud-bottom { flex-direction: column; align-items: stretch; gap: 8px; }
  .hint { align-self: flex-end; order: -1; }
  .index {
    flex-direction: row; gap: 3px; overflow-x: auto; pointer-events: auto;
    margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad);
    scrollbar-width: none;
  }
  .index::-webkit-scrollbar { display: none; }
  .plate-info { top: auto; right: auto; left: calc(var(--pad) + env(safe-area-inset-left)); bottom: calc(var(--pad) + env(safe-area-inset-bottom) + var(--name-h, 70px) + 10px); }
  .plate-line > span { font-size: 21px; padding: 13px 13px 15px; }
  /* 16px stops iOS zooming the page when a field takes focus. */
  .contact input, .contact textarea { font-size: 16px; letter-spacing: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; transition-delay: 0s !important; }
}
