/* garryegan.com — schematic paper */

:root {
  --paper: #EDF1F5;
  --dot: #C7D2DD;
  --ink: #16283E;
  --ink-soft: #52667C;
  --line: #9FB2C3;
  --signal: #E58A17;
  --card: #F7F9FB;
  --work: #1F4E79;
  --venture: #2E7D66;
  --skill: #55618C;
  --client: #8C5A33;
  --cred: #6B7686;
  --display: 'Bricolage Grotesque', 'Avenir Next', sans-serif;
  --body: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', monospace;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
}

#graph {
  position: fixed;
  inset: 0;
  display: block;
  cursor: grab;
  touch-action: none;
}
#graph.dragging { cursor: grabbing; }
#graph.pointing { cursor: pointer; }

/* ---------- portrait ---------- */

.portrait {
  position: fixed;
  bottom: 0;
  right: clamp(0rem, 2vw, 3rem);
  height: min(78vh, 46rem);
  max-width: 44vw;
  object-fit: contain;
  object-position: bottom right;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(-10px 12px 24px rgba(22, 40, 62, 0.18));
}

@media (max-width: 720px) {
  .portrait { height: 42vh; max-width: 60vw; right: 0; opacity: 0.95; }
}

/* ---------- masthead ---------- */

.masthead {
  position: fixed;
  top: clamp(1.25rem, 4vh, 3rem);
  left: clamp(1.25rem, 4vw, 3.5rem);
  pointer-events: none;
  z-index: 5;
}
.masthead a, .view-toggle, .panel { pointer-events: auto; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.masthead h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0.4rem 0 0.75rem;
}

.masthead .tagline {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  line-height: 1.25;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.contact { display: flex; flex-direction: column; gap: 0.2rem; }
.contact a {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  width: fit-content;
}
.contact a:hover, .contact a:focus-visible { border-bottom-color: var(--signal); color: var(--signal); }

/* ---------- legend ---------- */

.legend {
  position: fixed;
  bottom: clamp(1rem, 3vh, 2rem);
  left: clamp(1.25rem, 4vw, 3.5rem);
  z-index: 5;
  pointer-events: none;
}
.legend-hint {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}
.legend ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; max-width: 34rem; }
.legend li {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.legend .swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: inline-block;
}

/* ---------- view toggle ---------- */

.view-toggle {
  position: fixed;
  top: clamp(1.25rem, 4vh, 3rem);
  right: clamp(1.25rem, 4vw, 3.5rem);
  z-index: 6;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
}
.view-toggle:hover { border-color: var(--ink); }
.view-toggle:focus-visible, .panel-close:focus-visible, .connections button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* ---------- detail panel ---------- */

.panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(26rem, 92vw);
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 40px rgba(22, 40, 62, 0.08);
  padding: clamp(1.5rem, 4vh, 2.5rem) clamp(1.25rem, 2.5vw, 2rem);
  overflow-y: auto;
  z-index: 10;
  animation: slide-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slide-in {
  from { transform: translateX(2rem); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.panel-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  font-size: 1.4rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.panel-close:hover { color: var(--ink); }

.panel-image {
  display: block;
  width: 8.5rem;
  height: 8.5rem;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
  margin-bottom: 1rem;
}

.panel-image.panel-icon {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  padding: 0.6rem;
  background: #fff;
}

.list-icon {
  width: 2.2rem;
  height: 2.2rem;
  object-fit: contain;
  margin-bottom: 0.4rem;
}

.panel h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0.4rem 0 1rem;
}

#panel-body p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 0.8rem;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0.8rem; }
.tags span {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: 0.2rem 0.6rem;
}

.connections-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 1.2rem 0 0.5rem;
}
.connections { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.connections button {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink);
  background: none;
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}
.connections button:hover { border-color: var(--signal); color: var(--signal); }

/* ---------- list view ---------- */

.list-view {
  position: fixed;
  inset: 0;
  background: var(--paper);
  overflow-y: auto;
  z-index: 8;
  padding: 9rem clamp(1.25rem, 6vw, 4rem) 4rem;
}
.list-inner { max-width: 44rem; margin: 0 auto; }

.list-inner section { margin-bottom: 3rem; }
.list-inner h2 {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}
.list-inner article { margin-bottom: 1.8rem; }
.list-photo {
  width: 7rem;
  height: 7rem;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
  margin-bottom: 0.8rem;
}
.list-inner h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.list-inner .eyebrow { margin: 0.15rem 0 0.5rem; }
.list-inner p { font-size: 0.92rem; line-height: 1.6; margin-bottom: 0.5rem; }

/* ---------- responsive & motion ---------- */

@media (max-width: 720px) {
  .masthead h1 { font-size: 2.4rem; }
  .masthead .tagline { font-size: 0.95rem; }
  .legend ul { display: none; }
  .panel {
    top: auto;
    bottom: 0;
    width: 100vw;
    height: min(70dvh, 34rem);
    border-left: none;
    border-top: 1px solid var(--line);
    border-radius: 1rem 1rem 0 0;
    animation-name: slide-up;
  }
  @keyframes slide-up {
    from { transform: translateY(2rem); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
  .view-toggle { top: auto; bottom: clamp(1rem, 3vh, 2rem); }
}

@media (prefers-reduced-motion: reduce) {
  .panel { animation: none; }
}
