/* ============================================
   gorto.xyz — design system
   Hand-crafted CSS. No frameworks. No JS.
   ============================================ */

/* --- Palette --- */
:root {
  --bg:          #f4efe6;
  --bg-subtle:   #ece5d8;
  --text:        #1a1a1a;
  --text-muted:  #5c5648;
  --accent:      #b8860b;
  --accent-hover:#9a7209;
  --accent-dim:  #d4b96a;
  --blue:        #2d5a7b;
  --blue-dim:    #a3c0d4;
  --border:      #cdc2aa;
  --code-bg:     #e8e0d0;
  --shadow:      rgba(45, 40, 30, 0.08);
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Base --- */
html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: "IBM Plex Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.4rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent);
}

code, pre {
  font-family: "IBM Plex Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
  font-size: 0.88rem;
}

code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem 1.2rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--accent);
}

pre code {
  background: none;
  padding: 0;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1;
  padding: 2.5rem 0;
}

/* --- Navigation --- */
nav {
  border-bottom: 2px solid var(--border);
  padding: 1rem 0;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

nav .site-name {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  border-bottom: none;
}

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

nav .nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

nav .nav-links a {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: lowercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

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

/* --- Footer --- */
footer {
  border-top: 2px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

/* --- Home page --- */
.hero {
  padding: 4rem 0 2rem;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 0.3rem;
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  margin-bottom: 2rem;
}

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

/* --- Project cards --- */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  background: var(--bg);
  box-shadow: 0 2px 8px var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.project:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 4px 16px var(--shadow);
}

.project h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.project .tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.project .tech span {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  background: var(--code-bg);
  color: var(--text-muted);
  padding: 0.2em 0.6em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.project .links {
  margin-top: 0.8rem;
  display: flex;
  gap: 1rem;
}

/* --- Blog list --- */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list .date {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Demos grid --- */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.demo-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  background: var(--bg);
  box-shadow: 0 2px 8px var(--shadow);
}

.demo-card h3 {
  color: var(--blue);
  margin-bottom: 0.4rem;
}

.demo-card canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--code-bg);
  border-radius: 4px;
  margin-top: 0.8rem;
}

/* --- Contact --- */
.contact-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}

.contact-links li {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.95rem;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.resume-link {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: var(--bg);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.9rem;
  border-radius: 5px;
  border-bottom: none;
  transition: background 0.2s;
}

.resume-link:hover {
  background: var(--accent-hover);
  color: var(--bg);
  border-bottom: none;
}

/* --- Page header --- */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.page-header p {
  color: var(--text-muted);
  margin-bottom: 0;
}

/* --- Details / Accordion --- */
details {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
}

details[open] {
  padding-bottom: 1rem;
}

summary {
  cursor: pointer;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  color: var(--accent);
}

summary:hover {
  color: var(--accent-hover);
}

/* --- Resume --- */
.resume {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.resume-section h2 {
  color: var(--accent);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.2rem;
}

.resume-entry {
  margin-bottom: 1.8rem;
}

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

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.15rem;
}

.resume-entry-header h3 {
  margin-bottom: 0;
}

.resume-entry-header .location {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.resume-entry .role {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.resume-entry .role .dates {
  font-style: normal;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
}

.resume-entry > p {
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.resume-entry ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.resume-entry li {
  font-size: 0.92rem;
  line-height: 1.6;
  padding-left: 1.2rem;
  position: relative;
}

.resume-entry li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--accent-dim);
  border-radius: 50%;
}

.resume-entry li strong {
  color: var(--text);
}

.resume-coursework {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}

.skill-category {
  font-size: 0.9rem;
  line-height: 1.5;
}

.skill-category strong {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.15rem;
}

.resume-download {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* --- Utility --- */
.muted { color: var(--text-muted); }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.small { font-size: 0.85rem; }

/* --- Responsive --- */
@media (width <= 600px) {
  html { font-size: 16px; }

  .hero h1 { font-size: 2rem; }
  .hero .tagline { font-size: 1rem; }

  nav .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  nav .nav-links {
    gap: 1rem;
  }

  .post-list li {
    flex-direction: column;
    gap: 0.2rem;
  }

  .demo-grid {
    grid-template-columns: 1fr;
  }
}
