/* style.css
   - Mobile-first, clean typography, light/dark via prefers-color-scheme
   - Safe-area / iPhone notch aware (viewport-fit=cover)
*/

:root{
  --bg:#f9f8ff;
  --text:#101114;
  --muted: rgba(16,17,20,.68);
  --muted2: rgba(16,17,20,.50);
  --line: rgba(16,17,20,.10);

  --accent:#6d5efc;
  --accentSoft: rgba(109,94,252,.12);

  --card:#ffffff;
  --shadow: 0 2px 12px rgba(0,0,0,.05), 0 12px 36px rgba(0,0,0,.06);

  --max: 940px;

  --serif: "Playfair Display", ui-serif, Georgia, "Times New Roman", Times, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;

  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);

  color-scheme: light dark;
  scroll-behavior: smooth;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b0c10;
    --text:#f3f4f6;
    --muted: rgba(243,244,246,.72);
    --muted2: rgba(243,244,246,.55);
    --line: rgba(255,255,255,.12);

    --accent:#8b7bff;
    --accentSoft: rgba(139,123,255,.14);

    --card: rgba(255,255,255,.04);
    --shadow: 0 2px 8px rgba(0,0,0,.3), 0 18px 60px rgba(0,0,0,.35);
  }
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Subtle noise texture overlay — adds depth without noise CDN */
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  opacity:.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px;
}
@media (prefers-color-scheme: dark){
  body::before{ opacity:.035; }
}

a{ color: inherit; text-decoration: none; }

/* Main container */
.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding-top: calc(60px + var(--safe-top));
  padding-right: calc(24px + var(--safe-right));
  padding-bottom: calc(100px + var(--safe-bottom));
  padding-left: calc(24px + var(--safe-left));
  position: relative;
  z-index: 1;
}

/* Header row */
.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.id{
  display:flex;
  align-items:center;
  gap:16px;
  min-width:0;
}

/* Avatar */
.avatar{
  width:52px;
  height:52px;
  border-radius:999px;
  border:1px solid var(--line);
  overflow:hidden;
  position:relative;
  flex:0 0 auto;
  background: rgba(0,0,0,.03);
}
@media (prefers-color-scheme: dark){
  .avatar{ background: rgba(255,255,255,.05); }
}

.avatar-img{
  width:100%;
  height:100%;
  display:block;
  object-fit: cover;
  border-radius:999px;
}

.avatar-overlay{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  font-family:"Amiri", serif;
  font-weight:700;
  font-size:15px;
  background: rgba(0,0,0,.65);
  color:#fff;
  opacity:0;
  transition: opacity .25s ease;
  text-align:center;
  padding: 6px;
}
.avatar:hover .avatar-overlay{ opacity:1; }
.avatar:active .avatar-overlay{ opacity:1; }

/* Main name */
.name{
  font-family: var(--serif);
  font-weight: 700;
  font-size: 48px;
  letter-spacing: -0.5px;
  line-height: 1.05;
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Icon-only button (top-right) */
.iconbtn{
  width:48px;
  height:48px;
  border-radius:999px;
  border:1px solid var(--line);
  background: transparent;
  display:grid;
  place-items:center;
  transition: all .15s ease;
  flex:0 0 auto;
}
.iconbtn:hover{
  transform: translateY(-2px);
  background: rgba(0,0,0,.05);
  border-color: rgba(0,0,0,.2);
}
@media (prefers-color-scheme: dark){
  .iconbtn:hover{
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.25);
  }
}
.iconbtn svg{
  width:20px;
  height:20px;
  opacity:.85;
  display:block;
}

/* Intro */
.intro{ margin-top: 24px; }

.intro-text{
  font-size: 19px;
  line-height: 1.75;
  letter-spacing: -0.1px;
  margin: 0 0 28px;
  color: var(--muted);
  font-weight: 500;
}

/* Action buttons row */
.pills{
  margin-top: 24px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:9px;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  transition: all .2s ease;
  cursor:pointer;
  background: transparent;
  max-width: 100%;
}

.pill svg{
  display:inline-block !important;
  width:18px !important;
  height:18px !important;
  opacity:.9;
  flex:0 0 auto;
  visibility: visible !important;
}

.pill span{ display:inline-block; }

.pill.primary{
  background: var(--accentSoft);
  color: var(--accent);
  border-color: rgba(109,94,252,.18);
}
.pill.secondary{
  color: var(--muted);
  border: 1px solid var(--line);
}
.pill:hover{
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

hr{
  border:0;
  border-top:1px solid var(--line);
  margin: 40px 0 48px;
}

.section-title{
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted2);
  margin: 0 0 20px;
  font-weight: 600;
}

/* Cards grid — 1 column mobile, 2 col on wide screens */
.projects{
  display:grid;
  gap: 18px;
  margin-top: 8px;
}

/* Hobbies always 2 columns (they're shorter cards) */
@media (min-width: 600px){
  .hobbies-grid{
    grid-template-columns: 1fr 1fr;
  }
}

/* Projects 2-up on wider screens */
@media (min-width: 700px){
  .projects:not(.hobbies-grid){
    grid-template-columns: 1fr 1fr;
  }
  /* First project card spans full width — makes the hero card stand out */
  .projects:not(.hobbies-grid) .project:first-child{
    grid-column: 1 / -1;
  }
}

/* Card */
.project{
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: 20px;
  padding: 24px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  overflow:hidden;
}
.project:hover{
  transform: translateY(-4px);
  border-color: rgba(109,94,252,.28);
  box-shadow: 0 4px 16px rgba(0,0,0,.06), 0 24px 56px rgba(0,0,0,.12);
}

.project-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.project-title{
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: -0.2px;
  transition: color .25s ease;
  overflow-wrap: anywhere;
}
.project:hover .project-title{ color: var(--accent); }

.project-desc{
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

/* Tag pills */
.tags{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  min-width: 0;
  max-width: 100%;
}
.tag{
  font-size: 12px;
  font-weight: 600;
  color: var(--muted2);
  border: 1px solid var(--line);
  background: rgba(0,0,0,.02);
  padding: 5px 11px;
  border-radius: 999px;
  transition: all .2s ease;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.tag:hover{
  background: rgba(109,94,252,.08);
  border-color: rgba(109,94,252,.2);
}

.live{
  color: var(--muted2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.project-link{
  color: var(--muted2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: all .25s ease;
}
.project-link:hover{
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Hobby image pill */
.gifpill{
  display: inline-block;
  width: 100px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  vertical-align: middle;
  margin-left: 12px;
  transform: translateY(3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  background: rgba(255,255,255,.04);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.gifpill img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
}
.gifpill:hover{
  border-color: rgba(109,94,252,.5);
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
@media (prefers-color-scheme: dark){
  .gifpill{
    box-shadow: 0 12px 40px rgba(0,0,0,.6);
  }
}

/* Connect / footer */
.connect{ margin-top: 48px; }

.links{
  display:flex;
  gap:24px;
  flex-wrap:wrap;
  font-weight: 600;
  font-size: 16px;
}
.links a{
  position: relative;
  transition: color .25s ease;
}

.links a::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 8px;
  background: var(--accentSoft);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
  border-radius: 4px;
}
.links a:hover{ color: var(--accent); }
.links a:hover::after{ transform: scaleX(1); }

footer{
  margin-top: 32px;
  color: var(--muted2);
  font-size: 14px;
}

/* Responsive tuning */
@media (max-width: 760px){
  .wrap{
    padding-top: calc(44px + var(--safe-top));
    padding-right: calc(18px + var(--safe-right));
    padding-bottom: calc(80px + var(--safe-bottom));
    padding-left: calc(18px + var(--safe-left));
  }
  .name{ font-size: 38px; }
  .intro-text{ font-size: 18px; }
  .gifpill{ width: 92px; height: 34px; }
  .live{ display:none; }
}

@media (max-width: 420px){
  .wrap{
    padding-top: calc(40px + var(--safe-top));
    padding-right: calc(16px + var(--safe-right));
    padding-bottom: calc(76px + var(--safe-bottom));
    padding-left: calc(16px + var(--safe-left));
  }
  .name{ font-size: 34px; }
  .pills{ gap:10px; }
  .pill{ padding: 11px 15px; }
}

::selection{ background: rgba(109,94,252,.18); }

@media (prefers-reduced-motion: reduce){
  .project, .pill, .iconbtn, .tag, .gifpill{ transition:none !important; }
}
