/* phtiv.dev — styles. Dark by default; light via [data-theme="light"]
   (set in js/main.js, initialized from the OS preference). */

:root {
  --bg:        #0d1117;
  --bg-soft:   #161b22;
  --bg-card:   #161b22;
  --border:    #262c36;
  --text:      #e6edf3;
  --text-dim:  #9aa7b4;
  --accent:    #3fb950;
  --accent-2:  #34d399;
  --radius:    8px;
  --maxw:      940px;
}

[data-theme="light"] {
  --bg:        #ffffff;
  --bg-soft:   #f6f8fa;
  --bg-card:   #ffffff;
  --border:    #e2e6ea;
  --text:      #1b2733;
  --text-dim:  #5a6672;
  --accent:    #1f883d;
  --accent-2:  #10b981;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-dot { color: var(--accent); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-menu a { color: var(--text-dim); font-size: 0.95rem; }
.nav-menu a:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px; height: 34px;
  border-radius: var(--radius);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.theme-toggle:hover { border-color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* hero */
.hero { padding-block: clamp(3rem, 12vh, 6.5rem) clamp(2.5rem, 8vh, 4.5rem); }
.hero-title {
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--text);
}
.hero-tagline {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  color: var(--text-dim);
  max-width: 40ch;
  margin: 0 0 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }

/* sections */
.section { padding-block: clamp(2.5rem, 8vh, 4rem); }
.section-title {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}
.section-lead { color: var(--text-dim); max-width: 52ch; margin: 0 0 1.5rem; }

/* about */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.5rem; }
.about-body p { margin: 0 0 1rem; color: var(--text-dim); }
.about-body p:first-child { color: var(--text); }
.about-side h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-list li {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 460px;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card-top { display: flex; align-items: center; gap: 0.85rem; }
.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}
.card-heading { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.card-title { margin: 0; font-size: 1.15rem; }
.card-badge { font-size: 0.78rem; color: var(--text-dim); }
.card-desc { margin: 0; color: var(--text-dim); font-size: 0.95rem; }
.card-links { display: flex; gap: 1.1rem; font-size: 0.9rem; font-weight: 600; }

/* contact */
.contact-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.contact-link {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 1.1rem;
  color: var(--text);
  font-weight: 600;
}
.contact-link:hover { border-color: var(--accent); text-decoration: none; }

/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding-block: 1.5rem; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.to-top { color: var(--text-dim); }
.to-top:hover { color: var(--accent); }

/* responsive */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem;
    display: none;
  }
  .nav-menu.open { display: flex; }
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

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