:root {
  --bg-deep: #0a1628;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --text: #e8eef6;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --accent-glow: rgba(56, 189, 248, 0.35);
  --content-width: 42rem;
  --content-wide: 64rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(56, 189, 248, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(14, 165, 233, 0.1), transparent),
    radial-gradient(ellipse 40% 30% at 0% 80%, rgba(56, 189, 248, 0.08), transparent);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #7dd3fc;
}

main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

header {
  margin-bottom: 2.5rem;
  animation: fade-up 0.7s ease both;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.tagline span {
  color: var(--accent);
}

.bio {
  margin-bottom: 2.5rem;
  animation: fade-up 0.7s ease 0.1s both;
}

.bio p {
  margin: 0 0 1rem;
  color: var(--text);
}

.bio p:last-child {
  margin-bottom: 0;
}

.nav-back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-back:hover {
  color: var(--accent);
}

.links-section {
  animation: fade-up 0.7s ease 0.2s both;
  margin-bottom: 2rem;
}

.links-section:last-child {
  margin-bottom: 0;
}

.links-section h2 {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-card);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.link-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px var(--accent-glow);
}

.link-card .label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.link-card .desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.link-card a {
  color: inherit;
  text-decoration: none;
}

.link-card:hover .label {
  color: var(--accent);
}

.link-card.nested {
  grid-column: 1 / -1;
  max-width: 28rem;
  margin-left: 1rem;
}

/* Article layout */

.page-header {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 3rem 1.5rem 0;
  text-align: left;
  background: transparent;
  color: var(--text);
  animation: fade-up 0.7s ease both;
}

.page-header h1,
.page-header h2 {
  background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-header h2 {
  margin: 0 0 0;
  font-size: 1rem;
  font-weight: 500;
  opacity: 1;
}

.main-content {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  word-wrap: break-word;
  animation: fade-up 0.7s ease 0.1s both;
}

.main-content :first-child {
  margin-top: 0;
}

.main-content h1,
.main-content h2,
.main-content h3,
.main-content h4 {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.main-content h2 {
  margin: 2.25rem 0 1rem;
  font-size: 1.5rem;
}

.main-content h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.2rem;
  color: var(--accent);
}

.main-content p {
  margin: 0 0 1rem;
}

.main-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

.main-content img.center,
.main-content img.small {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.main-content img.center {
  width: min(100%, 30%);
}

.main-content img:not(.small) {
  width: min(100%, 36rem);
  display: block;
  margin: 1.5rem auto;
}

.main-content img.small {
  width: min(100%, 18rem);
}

.main-content blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1.25rem;
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 0.5rem 0.5rem 0;
}

.main-content code {
  padding: 0.15rem 0.4rem;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  color: #7dd3fc;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.25rem;
}

.main-content pre {
  padding: 1rem 1.1rem;
  margin: 0 0 1.25rem;
  overflow: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.main-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.main-content table {
  display: table;
  width: 100%;
  margin: 1.25rem 0;
  overflow-x: auto;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.main-content table th,
.main-content table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.main-content table th {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 600;
}

.main-content table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.main-content table tr:last-child td {
  border-bottom: 0;
}

.main-content li {
  margin-bottom: 0.35rem;
}

.main-content hr {
  height: 1px;
  margin: 2rem 0;
  background: var(--border);
  border: 0;
}

/* PDF embed pages */

.intro {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 3rem 1.5rem 0;
  animation: fade-up 0.7s ease both;
}

.intro p {
  margin: 0 0 1rem;
}

.pdf-frame {
  display: block;
  width: calc(100% - 3rem);
  max-width: var(--content-wide);
  height: calc(100vh - 10rem);
  margin: 1.5rem auto 3rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
}

.filename-demo {
  display: inline-block;
  font-style: oblique;
  border-radius: 0.35rem;
  overflow: hidden;
}

.filename-demo .filename-part {
  float: left;
  padding: 0.2rem 0.45rem;
  font-weight: 600;
}

.filename-highlight {
  display: inline;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

.filename-part-type {
  background: rgba(248, 113, 113, 0.22);
  color: #fecaca;
}

.filename-part-id {
  background: rgba(14, 116, 144, 0.55);
  color: #e0f2fe;
}

.filename-part-ext {
  background: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}

.priority-cell {
  font-weight: 700;
  text-align: center;
}

.priority-1 {
  background: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}

.priority-2 {
  background: rgba(234, 179, 8, 0.4);
  color: #fef08a;
}

.priority-3 {
  background: rgba(249, 115, 22, 0.4);
  color: #ffedd5;
}

.priority-4 {
  background: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

textarea {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 3px var(--accent-soft);
}


input,
button,
textarea,
select {
  font: inherit;
  color: var(--text);
}

input[type="text"],
input[type="number"],
input:not([type]) {
  width: 100%;
  max-width: 16rem;
  padding: 0.65rem 0.85rem;
  margin: 0.25rem 0 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button {
  padding: 0.65rem 1.25rem;
  margin-top: 0.5rem;
  background: var(--accent-soft);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 0.5rem;
  color: var(--accent);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

button:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}

/* Interactive demo apps */

body.demo-layout {
  width: 100%;
  height: 100%;
}

body.demo-layout .main-container {
  width: 100%;
  height: 100%;
  display: table;
}

body.demo-layout .left-pane {
  display: table-cell;
  width: 31vw;
  height: 100%;
  border-right: 2px solid rgba(56, 189, 248, 0.35);
  padding: 10px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.3vw;
}

body.demo-layout .right-pane {
  display: table-cell;
  height: 100%;
  padding: 10px;
}

body.demo-layout h3 {
  font-size: 1.5vw;
  color: var(--text);
}

body.demo-layout p {
  font-size: 1.3vw;
}


.profile-card {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-card);
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.profile-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.35);
}

.profile-container {
  display: table;
}

.profile-cell {
  display: table-cell;
  vertical-align: middle;
}

.profile-text {
  padding-right: 1rem;
}

.profile-img {
  width: 5rem;
  height: 5rem;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

html[data-ref="business"] .profile-img {
  background-image: url("/Business/James.jpg");
}

html:not([data-ref="business"]) .profile-img {
  display: none;
}

html:not([data-ref="business"]) a.identity-linkedin {
  pointer-events: none;
  cursor: default;
  text-decoration: none;
  color: inherit;
}

.demo-button {
  transition: all 0.2s ease;
  color: var(--accent);
  border-radius: 0.5rem;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: var(--accent-soft);
  margin: 0.35rem 0.35rem 0.35rem 0;
  padding: 0.55rem 1rem;
  outline: 0;
  cursor: pointer;
}

.demo-button:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}

.demo-button svg {
  fill: currentColor;
  vertical-align: -2px;
  margin-right: 0.25rem;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
