/* Portfolio — PG-inspired, minimal. Dark default. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --accent: #f35840;
  --accent-hover: #ff6b54;
  --bg: #111111;
  --text: #e0e0e0;
  --text-muted: #888888;
  --border: #222222;
  --max-content: 680px;
  --sidebar-width: 160px;
  --font-body: 'IBM Plex Serif', Georgia, serif;
  --font-ui: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg: #fafafa;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e0e0e0;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: color 0.2s ease;
}

/* No transition on background — instant feel */
body,
[data-theme] {
  background-color: var(--bg);
}

a {
  color: #ff6b54;
  text-decoration: none;
}

a:hover,
a:active {
  color: var(--text);
}

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

/* External link icon — arrow after links that go outside the site */
a[href^="http"]::after,
a[href^="mailto"]::after {
  content: " \2197";
  font-size: 0.75em;
  opacity: 0.9;
}

/* Layout: header + sidebar + main + footer */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-ui);
}

.site-name {
  font-size: 0.95rem;
  font-weight: 500;
}

.site-name a {
  color: #ff6b54;
}

.site-name a:hover {
  color: var(--text);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--accent);
}

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

.layout {
  display: flex;
  min-height: calc(100vh - 120px);
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar nav a {
  color: var(--text-muted);
  text-transform: lowercase;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: var(--accent);
}

.main {
  flex: 1;
  padding: 2rem 1.5rem 3rem;
  max-width: var(--max-content);
}

.main--wide {
  max-width: 900px;
}

/* Essay page: no sidebar, just centered prose */
.essay-page .main--essay {
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  max-width: var(--max-content);
}

.essay-page .main--essay .essay-body {
  max-width: none;
}

/* Now blurb */
.now-label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: lowercase;
  margin-bottom: 0.25rem;
}

.now-blurb {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* Recent work on Now page */
.recent-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

.recent-item {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.recent-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.now-closing {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.now-closing a:hover {
  color: var(--accent);
}

/* Section titles */
.section-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: lowercase;
  margin-bottom: 1rem;
}

/* Essay list */
.essay-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.essay-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.essay-item:last-child {
  border-bottom: none;
}

.essay-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.essay-title {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
}

.essay-title a:hover {
  color: var(--accent);
}

.essay-date {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.essay-meta {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.essay-tag {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

/* Projects */
.projects-intro {
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  font-style: italic;
}

.projects-intro-divider {
  margin: 0 -1.5rem 2rem -1.5rem;
  border: none;
  border-top: 1px solid var(--border);
  width: calc(100% + 3rem);
  max-width: none;
}

.projects-intro-divider + .project-list {
  margin-top: 0;
}

.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.project-item {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
}

.project-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

.project-item .project-divider {
  margin: 2rem -1.5rem 0 -1.5rem;
  border: none;
  border-top: 1px solid var(--border);
  width: calc(100% + 3rem);
  max-width: none;
}

.project-item:last-child .project-divider {
  display: none;
}

.project-name {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.project-links-header {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.project-links-header a:hover {
  color: var(--text);
}

.project-tagline {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
}

.project-desc {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
}

.project-desc p {
  margin: 0 0 1rem 0;
}

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

.project-media {
  margin: 1rem 0;
}

.project-media:has(img) {
  padding: 0;
}

.project-media img {
  display: block;
  max-width: 340px;
  max-height: 340px;
  width: auto;
  height: auto;
  object-fit: cover;
  transform: rotate(90deg);
  margin-left: auto;
  margin-right: auto;
}

.project-tech {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.project-links {
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.project-links a:hover {
  color: var(--accent);
}

.project-install-line {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.project-install-cmd {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  background: var(--border);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.15s ease;
  width: 50%;
  min-width: 220px;
  box-sizing: border-box;
}

.project-install-cmd:hover {
  border-color: var(--accent);
}

.project-install-cmd:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-install-cmd code {
  font-family: var(--font-ui);
  font-size: inherit;
  background: none;
  padding: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-install-copy-label {
  font-style: normal;
  flex-shrink: 0;
}

.project-install-cmd.is-copied .project-install-copy-label {
  color: #22c55e;
}

/* About page */
.about-intro {
  margin-bottom: 2rem;
}

.about-intro p {
  margin-bottom: 1rem;
}

.about-work-entry {
  margin-bottom: 1.5rem;
}

.about-work-entry:last-child {
  margin-bottom: 0;
}

.about-work-heading {
  margin: 0 0 0.5rem 0;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.about-work-company {
  color: var(--accent);
  font-weight: 500;
}

.about-work-entry p:last-of-type {
  margin-bottom: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
}

.reading-section h3 {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: lowercase;
}

.reading-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

.reading-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.reading-list li:last-child {
  border-bottom: none;
}

.contact-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.contact-section a:hover {
  color: var(--accent);
}

/* Essay template — prose */
.essay-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.essay-header h1 {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 0.5rem 0;
}

.essay-meta-line {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.essay-body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  max-width: var(--max-content);
}

.essay-body p {
  margin: 0 0 1.25rem 0;
}

.essay-body h2 {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  margin: 2rem 0 1rem 0;
  color: var(--text);
}

.essay-body code {
  font-family: var(--font-ui);
  font-size: 0.9em;
  background: var(--border);
  padding: 0.15em 0.4em;
}

.essay-body pre {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  background: var(--border);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
}

.essay-body pre code {
  background: none;
  padding: 0;
}

.essay-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.essay-back {
  margin-top: 2rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--accent);
}

/* Mobile: sidebar becomes horizontal nav */
@media (max-width: 767px) {
  .layout {
    flex-direction: column;
    min-height: auto;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
  }

  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .main {
    padding: 1.5rem 1rem 2rem;
  }

  .essay-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .projects-intro-divider {
    margin: 0 -1rem 2rem -1rem;
    width: calc(100% + 2rem);
  }

  .project-item .project-divider {
    margin: 2rem -1rem 0 -1rem;
    width: calc(100% + 2rem);
  }
}
