/* style.css — reset + base. Layout, components, and interactions arrive in later phases. */

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

html {
  -webkit-text-size-adjust: 100%;
}

body,
h1, h2, h3, h4,
p,
figure,
blockquote,
dl, dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  margin: 0;
  padding: 0;
}

html:focus-within {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  text-rendering: optimizeSpeed;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration-color: var(--color-accent);
}

a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.75em;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Skip link */

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-decoration: none;
  transform: translateY(-200%);
}

@media (prefers-reduced-motion: no-preference) {
  .skip-link {
    transition: transform 0.15s ease;
  }
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* Spotlight — Phase 3 */

.spotlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(600px circle at var(--x) var(--y), rgb(96 200 240 / 0.15), transparent 80%);
}

@media (prefers-reduced-motion: reduce) {
  .spotlight {
    display: none;
  }
}

/* Layout shell — Phase 1 */

.layout {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--space-16);
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-8);
}

.sidebar {
  flex: 0 0 auto;
  width: 25%;
  max-width: 480px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-block: var(--space-12);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.identity-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: var(--leading-tight);
}

.profile-photo {
  position: relative;
  width: var(--space-24);
  height: var(--space-24);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--color-accent);
  margin-inline-start: var(--space-1);
}

.profile-photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-img--secondary {
  opacity: 0;
}

@media (hover: hover) {
  .sidebar:hover .profile-photo-img--secondary {
    opacity: 1;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .profile-photo-img {
    transition: opacity 0.2s ease;
  }
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.resume-link--pending {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: default;
}

.socials {
  display: flex;
  gap: var(--space-4);
}

.socials a {
  display: inline-flex;
  align-items: center;
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
}

nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  transition: color 0.2s ease;
}

.nav-indicator {
  display: inline-block;
  width: 2rem;
  height: 1px;
  background-color: var(--color-text-muted);
  transition: width 0.2s ease, background-color 0.2s ease;
}

nav a.is-active {
  color: var(--color-text);
}

nav a.is-active .nav-indicator {
  width: 4rem;
  background-color: var(--color-accent);
}

main {
  flex: 1 1 0%;
  min-width: 0;
  padding-block: var(--space-12);
}

@media (max-width: 1024px) {
  .layout {
    flex-direction: column;
    gap: var(--space-8);
  }

  .sidebar {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    overflow-y: visible;
  }
}

/* Content sections — Phase 2 */

main section {
  max-width: 65ch;
}

main section + section {
  margin-top: var(--space-24);
}

main section h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-6);
}

main section p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

main section p:last-child {
  margin-bottom: 0;
}

main section ul:not([role="list"]) {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

main section ul:not([role="list"]) > li {
  margin-bottom: var(--space-2);
}

main section ul:not([role="list"]) > li:last-child {
  margin-bottom: 0;
}

main section code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* How I Work — inline token */

.inline-token {
  display: inline-flex;
  align-items: center;
  gap: 5px; /* intentional: between --space-1 (4px) and --space-2 (8px) for icon+text optical fit */
  vertical-align: middle;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2px var(--space-2); /* 2px intentional: half --space-1 for compact pill height */
}

.inline-token svg {
  flex-shrink: 0;
}

/* How I Work — command list */

.workflow-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
}

.workflow-row {
  display: flex;
  gap: var(--space-8);
  align-items: flex-start;
}

.workflow-cmd {
  flex: 0 0 140px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-top: 0.2em; /* optical nudge: aligns mono baseline with adjacent h3 cap-height */
}

.workflow-body h3 {
  font-size: var(--text-base);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.workflow-body p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .workflow-row {
    flex-direction: column;
    gap: var(--space-2);
  }

  .workflow-cmd {
    flex: none;
  }
}

/* Experience timeline */

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.experience-dates {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.experience-entry h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

ul.badges,
ul.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-block: var(--space-2);
  margin-top: var(--space-2);
  margin-bottom: var(--space-4);
}

ul.badges + ul.tags {
  margin-top: 0;
}

.badges li,
.tags li {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.badges li {
  color: var(--color-accent);
}

/* Projects */

#projects {
  max-width: none;
}

.project-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-6);
}

@media (max-width: 900px) {
  .project-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .project-cards {
    grid-template-columns: 1fr;
  }
}

.project-card {
  display: flex;
  flex-direction: column;
}

.project-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background-color: var(--color-border);
  margin-bottom: var(--space-3);
}

.project-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.project-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}

.project-links a {
  padding-block: var(--space-2);
}

.link-pending {
  color: var(--color-text-muted);
}

.project-card--featured {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  overflow: hidden;
}

.featured-card-top {
  display: flex;
  flex-direction: row;
}

.project-thumb-wrap {
  flex: 0 0 33.333%;
  position: relative;
  overflow: hidden;
  margin: var(--space-6) 0 var(--space-6) var(--space-6);
  border-radius: var(--radius);
}

.project-card--featured .project-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  object-fit: cover;
  object-position: center top;
  border-radius: 0;
  margin-bottom: 0;
}

.project-card-body {
  flex: 1;
  min-width: 0;
  padding: var(--space-6);
}

.featured-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.featured-card-footer {
  padding: var(--space-3) var(--space-6) var(--space-4);
  border-top: 1px solid var(--color-border);
}

.featured-card-footer .tags {
  margin-top: 0;
  margin-bottom: 0;
}

@media (max-width: 580px) {
  .featured-card-top {
    flex-direction: column;
  }

  .project-thumb-wrap {
    flex: none;
    width: auto;
    margin: var(--space-6) var(--space-6) 0 var(--space-6);
    aspect-ratio: 16 / 9;
  }
}

/* Edison Dental case study page */

.case-study {
  position: relative;
  z-index: 1;
  max-width: 65ch;
  margin-inline: auto;
  padding: var(--space-16) var(--space-8);
}

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  margin-bottom: var(--space-8);
}

.case-study-header {
  margin-bottom: var(--space-16);
}

.case-study-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.case-study-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-2);
}

.case-study-meta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.case-study-links {
  display: flex;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
}

.pending-note {
  font-style: italic;
  color: var(--color-text-muted);
}

.case-study footer {
  margin-top: var(--space-24);
}

/* Footer */

main > footer {
  margin-top: var(--space-16);
}

footer p {
  margin-bottom: var(--space-2);
}

footer p:last-child {
  margin-bottom: 0;
}

.build-credit,
.footer-date {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer-date {
  font-family: var(--font-mono);
}

/* Group-hover dim — Phase 3 */

@media (hover: hover) {
  .timeline:hover > .experience-entry,
  .project-cards:hover > .project-card,
  .workflow-list:hover > .workflow-row {
    opacity: 0.5;
  }

  .timeline:hover > .experience-entry:hover,
  .project-cards:hover > .project-card:hover,
  .workflow-list:hover > .workflow-row:hover {
    opacity: 1;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .timeline > .experience-entry,
  .project-cards > .project-card,
  .workflow-list > .workflow-row {
    transition: opacity 0.2s ease;
  }
}
