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

:root {
  --ink:       #111111;
  --paper:     #faf8f2;
  --white:     #ffffff;
  --yellow:    #ffe135;
  --border:    2px solid var(--ink);
  --shadow:    5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
}

body {
  background-color: var(--paper);
  background-image: radial-gradient(circle, rgba(0,0,0,0.12) 1px, transparent 1px);
  background-size: 22px 22px;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  min-height: 100svh;
  padding: 56px 20px 80px;
}

/* Centered single-card pages: home, hub, 404 */
body.center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

main { width: 100%; max-width: 540px; margin: 0 auto; }
body.center main { position: relative; max-width: 480px; }

p { font-size: 0.9rem; line-height: 1.7; color: #333; }
strong, b { font-weight: 500; }

/* Buttons: nav links, contact links, back link */
nav a, .actions a, .back, .btn {
  display: inline-block;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.08s, box-shadow 0.08s, background 0.08s;
}
nav a:hover, .actions a:hover, .back:hover, .btn:hover {
  background: var(--yellow);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}
nav a:active, .actions a:active, .btn:active { transform: translate(3px, 3px); box-shadow: none; }

nav a, .btn {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  padding: 8px 20px;
}
nav { display: flex; gap: 12px; flex-wrap: wrap; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions a { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.04em; padding: 6px 14px; }
.actions a:hover { transform: translate(-1px, -1px); }

.back {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  margin-bottom: 36px;
}

/* Card: home, hub, 404 */
article {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 44px 48px 36px;
  position: relative;
  z-index: 1;
}
article::before {
  content: "";
  position: absolute;
  top: -2px; left: -2px; right: -2px;
  height: 6px;
  background: var(--yellow);
  border: var(--border);
  border-bottom: none;
}
.lost article::before { background: var(--ink); }

.name {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-size: clamp(3rem, 10vw, 4.8rem);
  letter-spacing: 0.03em;
  line-height: 0.95;
  margin: 8px 0 10px;
}
.role {
  display: inline-block;
  background: var(--yellow);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.5;
  padding: 4px 10px;
  margin-bottom: 32px;
}
article hr { border: none; border-top: var(--border); margin-bottom: 28px; }
article > footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px dashed #ccc;
}

/* Subpage header */
body > main > header {
  background: var(--ink);
  color: var(--white);
  border: var(--border);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 18px 24px 16px;
  position: relative;
}
body > main > header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--yellow);
}
h1.title {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-size: 2.8rem;
  letter-spacing: 0.06em;
  line-height: 1;
  padding-top: 2px;
}
body > main > header p { font-size: 0.72rem; letter-spacing: 0.08em; color: inherit; opacity: 0.6; margin-top: 6px; line-height: 1.5; }

/* Sections: heading bar plus body */
main { counter-reset: section; }
section {
  background: var(--white);
  border: var(--border);
  box-shadow: 4px 4px 0 var(--ink);
  margin-top: 16px;
}
body > main > header + section { margin-top: 28px; }

section > h2 {
  counter-increment: section;
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--yellow);
  border-bottom: var(--border);
  padding: 8px 20px;
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.1em;
}
section > h2::before {
  content: counter(section, decimal-leading-zero);
  font-size: 0.95rem;
  opacity: 0.45;
}
section > h2 small {
  margin-left: auto;
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  padding: 2px 7px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
section > div { padding: 20px 20px 22px; }
section > div > * + * { margin-top: 12px; }

/* Lists */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  padding: 3px 8px;
}

.rows { list-style: none; }
.rows li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px dashed #ddd;
}
.rows li:first-child { border-top: none; padding-top: 0; }
.rows li:last-child { padding-bottom: 0; }
.rows b { font-size: 0.88rem; min-width: 130px; flex-shrink: 0; }
.rows span { font-size: 0.82rem; color: #666; line-height: 1.5; }
.rows a { color: var(--ink); text-decoration: none; }
.rows a:hover { text-decoration: underline; }

.skills {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.skills li {
  border: var(--border);
  background: var(--paper);
  padding: 10px 14px;
  font-size: 0.72rem;
  color: #666;
  line-height: 1.5;
}
.skills b {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 3px;
}
.langs { font-size: 0.8rem; color: #555; }

.timeline { list-style: none; }
.timeline li {
  position: relative;
  padding: 12px 0 12px 16px;
  border-left: 2px solid var(--ink);
  font-size: 0.78rem;
  color: #555;
  line-height: 1.4;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px; top: 17px;
  width: 8px; height: 8px;
  background: var(--yellow);
  border: 2px solid var(--ink);
}
.timeline time {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 2px;
}
.timeline b {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--ink);
}

section > div > h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

/* Code */
pre {
  background: var(--ink);
  color: #e8e8e8;
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.6;
  font-family: 'Courier New', Courier, monospace;
}

/* Footer */
footer { font-size: 0.68rem; color: #999; letter-spacing: 0.04em; }
body > main > footer { margin-top: 32px; padding-top: 20px; border-top: 1px dashed #bbb; }

/* 404 */
.lost article { text-align: center; }
.lost h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-size: clamp(5rem, 20vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin-top: 8px;
}
.lost .role { margin: 14px 0 28px; }
.lost p { color: #777; font-size: 0.85rem; margin-bottom: 32px; }

/* Hub gate */
.gate article { padding: 0; overflow: hidden; }
.gate article > header { background: var(--ink); color: var(--white); padding: 20px 28px 18px; }
.gate h1 { font-family: 'Bebas Neue', sans-serif; font-weight: 400; font-size: 3rem; letter-spacing: 0.06em; line-height: 1; }
.gate article > div { padding: 28px 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.gate .enter {
  display: flex;
  justify-content: space-between;
  background: var(--ink);
  color: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  padding: 14px 20px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  transition: transform 0.08s, box-shadow 0.08s, background 0.08s, color 0.08s;
}
.gate .enter:hover { background: var(--yellow); color: var(--ink); transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.gate .enter:active { transform: translate(3px, 3px); box-shadow: none; }
.gate small { font-size: 0.72rem; color: #999; text-align: center; letter-spacing: 0.03em; }
.gate .back { align-self: center; margin: 20px 0 0; }

@media (max-width: 520px) {
  article { padding: 36px 28px 30px; }
  .skills { grid-template-columns: 1fr; }
  .rows li { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
