/* =========================================================
   Base / Theme
   ========================================================= */
:root{
  --bg: #0b0c0f;
  --surface: #12141a;
  --surface-2: #0f1116;
  --text: #e9ecf1;
  --muted: #a8b0bf;
  --border: rgba(255,255,255,.10);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --max: 1100px;

  /* Optional link color (kept subtle on dark bg) */
  --link: #7db3ff;
}

*{ box-sizing: border-box; }

html{
  background: var(--bg); /* prevents html showing through */
}

body{
  min-height: 100vh;     /* always fill full viewport */
  display: flex;
  flex-direction: column;

  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255,255,255,.05), transparent 55%),
    var(--bg);

  color: var(--text);
  line-height: 1.55;
}

main{ flex: 1; }

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

code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .95em;
  color: #d7def0;
}

/* =========================================================
   Layout helpers
   ========================================================= */
.container{
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.narrow{ width: min(100% - 2rem, 760px); }

.section{ padding: 0.2rem 0; }

.section-alt{
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.03));
}

/* =========================================================
   Accessibility
   ========================================================= */
.skip-link{
  position: absolute;
  left: -999px;
  top: 8px;
  padding: .5rem .75rem;
  background: #fff;
  color: #000;
  border-radius: 10px;
}
.skip-link:focus{ left: 12px; z-index: 9999; }

/* =========================================================
   Header / Nav
   ========================================================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 10;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
}

.header-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 0;
}

.brand-link{
  display: flex;
  align-items: center;
  gap: .8rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark{
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  letter-spacing: .08em;
  font-weight: 700;
}

.brand-title{ display: block; font-weight: 700; color: var(--text); }
.brand-subtitle{ display: block; color: var(--muted); font-size: .92rem; }

.site-nav{
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  align-items: center;
  justify-content: flex-end;
}

.nav-link{
  text-decoration: none;
  padding: .55rem .75rem;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
}

.nav-link:hover{
  color: var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,.04);
}

.nav-link.active{
  color: var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,.06);
}

/* =========================================================
   Hero
   ========================================================= */
.hero{ padding: 1.4rem 0 1rem; }

.hero-grid{
  display: grid;
  grid-template-columns: 1.25fr .9fr;
  grid-template-areas:
    "intro ."
    "log   media";
  gap: 1rem;
  align-items: start;
}

.hero-intro{ grid-area: intro; }
.hero-log{ grid-area: log; }
.hero-media{ grid-area: media; }

.hero h1{
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  margin: 0 0 .4rem;
}

.lead{
  font-size: 1.05rem;
  margin: 0 0 .8rem;
  color: var(--muted);
}

.hero-media{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  overflow: hidden;

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 1rem;
  min-height: 200px;
  box-shadow: var(--shadow);
}

.hero-media img.current-project{
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.hero-placeholder{
  height: 100%;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  color: var(--muted);
  text-align: center;
}

/* =========================================================
   Components
   ========================================================= */
.grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  padding: .8rem;
  box-shadow: var(--shadow);
}

.card h3{ margin-top: 0; }

h2{ margin: 0 0 .75rem; font-size: 1.4rem; }
.h3{ font-size: 1.05rem; margin-bottom: .4rem; }

.card p{
  font-size: .9rem;
  margin: 0 0 .5rem;
}

.muted{ color: var(--muted); }

.note{ margin-top: 1.25rem; }
.mini-card{ margin-top: 0; }

.bullets{
  margin: .75rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.text-link{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.25);
}
.text-link:hover{ border-bottom-color: rgba(255,255,255,.6); }

.button-row{
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
  align-items: center;
}

.button{
  display: inline-block;
  text-decoration: none;
  color: var(--text);

  padding: .7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.08);
}

.button:hover{ background: rgba(255,255,255,.12); }
.button-ghost{ background: transparent; }

/* Pills (kept from later blocks; useful for nav/tag chips) */
.pill{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
}

/* =========================================================
   Projects
   ========================================================= */
.projects{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* One clean definition (dark theme friendly) */
.project-card{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.project-card:hover{
  border-color: rgba(255,255,255,.25);
}

.project-card img{
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.project-info{
  padding: 1rem;
}

.project-card h3{ margin-top: 0; }

/* Optional helper for a “back” link area */
.back-home{
  text-align: center;
  margin: 2rem 0 3rem;
}

/* =========================================================
   Gallery / Photos
   ========================================================= */
.photo-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .85rem;
  margin-top: 1.25rem;
}

.photo{
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  text-decoration: none;
}

.photo img{
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.caption{
  display: block;
  padding: .65rem .8rem;
  color: var(--muted);
  font-size: .95rem;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer{
  border-top: 1px solid var(--border);
  padding: .15rem 0;
  background: transparent;
}

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

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px){
  .hero-grid{
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "media"
      "log";
  }

  .grid{ grid-template-columns: 1fr; }
  .photo-grid{ grid-template-columns: repeat(2, 1fr); }

  .footer-row{
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px){
  .photo-grid{ grid-template-columns: 1fr; }
  .photo img{ height: 220px; }
}