/* ============================================================
   d4n.io — stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

/* --- Custom properties --- */
:root {
  --bg:      #1a1b26;
  --surface: #22243a;
  --border:  #343654;
  --text:    #e8e8f2;
  --muted:   #7878a0;
  --accent:  #4ade80;
  --font:    'JetBrains Mono', monospace;
  --radius:  4px;
  --max-w:   1100px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* --- Nav --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
}
.nav__logo {
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  flex: 1;
}
.nav__logo:hover { text-decoration: none; opacity: 0.8; }
.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav__links a {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.nav__links a::before { content: '[ '; }
.nav__links a::after  { content: ' ]'; }
.nav__links a:hover,
.nav__links a.active  { color: var(--accent); text-decoration: none; }

/* --- Page wrapper --- */
.page { padding-top: 56px; }

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
}
.hero__prompt {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}
.hero__name {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.hero__name::before { content: '> '; }
.hero__tagline {
  margin-top: 1rem;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text);
  max-width: 520px;
}
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.hero__cta {
  margin-top: 3rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  background: transparent;
}
.btn:hover { background: var(--accent); color: var(--bg); text-decoration: none; }
.btn--ghost { border-color: var(--border); color: var(--muted); }
.btn--ghost:hover { background: var(--surface); color: var(--text); }

/* --- About section (home page) --- */
.about {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  border-top: 1px solid var(--border);
}
.section-label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.section-label::before { content: '// '; }
.about__body {
  max-width: 620px;
  color: var(--text);
}
.about__body p + p { margin-top: 1rem; }

/* --- Projects page --- */
.projects-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}
.projects-page h1 {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.projects-page h1::before { content: '> '; }
.projects-page .lead {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 3rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.07);
}
.card__img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
}
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.card__title::before { content: '> '; color: var(--accent); }
.card__desc {
  font-size: 0.85rem;
  color: var(--muted);
  flex: 1;
  margin-bottom: 1rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius);
}
.card__link {
  font-size: 0.8rem;
  color: var(--accent);
  align-self: flex-start;
}
.card__link::after { content: ' →'; }

/* --- Contact page --- */
.contact-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}
.contact-page h1 {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.contact-page h1::before { content: '> '; }
.contact-page .lead {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 3rem;
}
.form { display: flex; flex-direction: column; gap: 1.25rem; }
.form__group { display: flex; flex-direction: column; gap: 0.4rem; }
.form__label {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.form__label::before { content: '$ '; color: var(--accent); }
.form__input,
.form__textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.form__input:focus,
.form__textarea:focus { border-color: var(--accent); }
.form__textarea { min-height: 140px; resize: vertical; }
.form__status {
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  display: none;
}
.form__status.success { display: block; color: var(--accent); border: 1px solid var(--accent); }
.form__status.error   { display: block; color: #ff4444; border: 1px solid #ff4444; }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }

/* --- Responsive --- */
@media (max-width: 600px) {
  .nav { padding: 0 1rem; }
  .nav__links { gap: 1rem; }
  .hero, .about, .projects-page, .contact-page { padding-left: 1rem; padding-right: 1rem; }
  .grid { grid-template-columns: 1fr; }
}
