/* ============================================================
   Suleman Ahmer — Static HTML/CSS/JS version
   Design tokens (HSL) ported from the React app's index.css
   ============================================================ */

   :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --secondary: 210 40% 96.1%;
    --secondary-fg: 222.2 47.4% 11.2%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;
    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;
    --destructive: 0 84.2% 60.2%;
    --radius: 0.5rem;
    --techwards-blue: 217 91% 60%;
  }
  
  * { box-sizing: border-box; }
  
  html, body {
    margin: 0;
    padding: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
  }
  
  a { color: inherit; text-decoration: none; }
  
  img { max-width: 100%; display: block; }
  
  /* ---------- Layout ---------- */
  .page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  .site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
  }
  @media (min-width: 640px) {
    .site-header { padding: 1.5rem 2.5rem; }
  }
  
  .brand { display: flex; flex-direction: column; }
  .brand-name {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
  }
  .brand-tag {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
  }
  
  /* ---------- Buttons ---------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: calc(var(--radius));
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s, transform 0.2s;
    border: 1px solid transparent;
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: hsl(var(--foreground));
    text-decoration: none;
  }
  .btn:hover { background: hsl(var(--secondary)); }
  .btn-outline {
    border-color: hsl(var(--border));
    background: hsl(var(--background));
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
  }
  .btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    border: none;
  }
  .btn-primary:hover { background: hsl(var(--primary) / 0.9); }
  .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
  
  /* ---------- Hero / Form ---------- */
  .hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
  }
  .hero-inner {
    max-width: 36rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--secondary));
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.75rem;
  }
  .powered {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin: 0 0 1.5rem;
  }
  .powered .tw-link {
    font-weight: 500;
    color: hsl(var(--techwards-blue));
    text-decoration: none;
  }
  .powered .tw-link:hover { opacity: 0.8; }
  
  h1.hero-title {
    font-size: 2.25rem;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    text-wrap: balance;
  }
  @media (min-width: 640px) { h1.hero-title { font-size: 3rem; } }
  @media (min-width: 768px) { h1.hero-title { font-size: 3.75rem; } }
  
  .hero-sub {
    margin-top: 1.25rem;
    max-width: 28rem;
    color: hsl(var(--muted-foreground));
    font-size: 1rem;
    text-wrap: balance;
  }
  @media (min-width: 640px) { .hero-sub { font-size: 1.125rem; } }
  
  .form-card {
    margin-top: 2.5rem;
    width: 100%;
    max-width: 48rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  }
  @media (min-width: 640px) { .form-card { padding: 2rem; } }
  
  /* ---------- Form fields ---------- */
  .field { margin-bottom: 1rem; }
  .field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  @media (min-width: 640px) {
    .field-row { grid-template-columns: 1fr 1fr; }
  }
  label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
  }
  .req { color: hsl(var(--destructive)); }
  
  input, select {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: calc(var(--radius));
    border: 1px solid hsl(var(--input));
    background: hsl(var(--background));
    font-size: 0.875rem;
    color: hsl(var(--foreground));
    font-family: inherit;
  }
  input:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.3);
  }
  .error-text {
    color: hsl(var(--destructive));
    font-size: 0.875rem;
    margin: 0.5rem 0 0;
    display: none;
  }
  .error-text.show { display: block; }
  .field.invalid input, .field.invalid select {
    border-color: hsl(var(--destructive));
  }
  
  /* ---------- Gallery preview (home) ---------- */
  .gallery-preview {
    margin: 0 auto;
    width: 100%;
    max-width: 64rem;
    padding: 1rem 1.5rem 4rem;
  }
  @media (min-width: 640px) { .gallery-preview { padding-left: 2.5rem; padding-right: 2.5rem; } }
  
  .grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  @media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
  
  .card {
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: box-shadow 0.2s;
  }
  .card:hover { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1); }
  
  .card-img-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: none;
    border: none;
    padding: 0;
    width: 100%;
    cursor: pointer;
    display: block;
  }
  .card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
  }
  .card-img-wrap:hover img { transform: scale(1.03); }
  .card-img-wrap .overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, hsl(var(--foreground) / 0.4), hsl(var(--foreground) / 0.05) 50%, transparent);
  }
  .card-body { padding: 1rem; }
  .card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
  }
  .card-desc {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
  
    /* 2-line clamp with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .center-row {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
  }
  
  /* ---------- Gallery page ---------- */
  .gallery-section {
    margin: 0 auto;
    width: 100%;
    max-width: 64rem;
    padding: 2rem 1.5rem;
    flex: 1;
  }
  @media (min-width: 640px) { .gallery-section { padding-left: 2.5rem; padding-right: 2.5rem; } }
  .gallery-heading { text-align: center; margin-bottom: 2.5rem; }
  .gallery-heading h1 {
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
  }
  @media (min-width: 640px) { .gallery-heading h1 { font-size: 3rem; } }
  .gallery-heading p {
    color: hsl(var(--muted-foreground));
    margin-top: 0.75rem;
  }
  
  .grid-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  @media (min-width: 640px) { .grid-gallery { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 1024px) { .grid-gallery { grid-template-columns: repeat(3, 1fr); } }
  
  /* ---------- Lightbox ---------- */
  .lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    background: hsl(var(--background) / 0.95);
    backdrop-filter: blur(4px);
  }
  .lightbox.open { display: flex; }
  .lb-btn {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-fg));
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s;
  }
  .lb-btn:hover { background: hsl(var(--secondary) / 0.8); }
  .lb-close { right: 1rem; top: 1rem; width: 2.5rem; height: 2.5rem; }
  .lb-prev, .lb-next { width: 3rem; height: 3rem; top: 50%; transform: translateY(-50%); }
  .lb-prev { left: 1rem; }
  .lb-next { right: 1rem; }
  @media (min-width: 640px) {
    .lb-prev { left: 2rem; }
    .lb-next { right: 2rem; }
  }
  .lb-figure {
    margin: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 64rem;
    max-height: 90vh;
  }
  .lb-figure img {
    max-height: 80vh;
    width: auto;
    border-radius: 0.5rem;
    object-fit: contain;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  }
  .lb-cap { text-align: center; margin-top: 1rem; }
  .lb-cap p { margin: 0; }
  .lb-cap .t { font-weight: 600; }
  .lb-cap .d { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
  
  /* ---------- Footer ---------- */
  .site-footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
  }
  @media (min-width: 640px) { .site-footer { padding: 1.5rem 2.5rem; } }
  .site-footer .stack { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
  .site-footer a { text-decoration: underline; }
  .site-footer a:hover { color: hsl(var(--foreground)); }
  
  /* ---------- Toast ---------- */
  .toast-wrap {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .toast {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    min-width: 16rem;
    animation: slide-in 0.2s ease;
  }
  .toast.success { border-left: 4px solid #16a34a; }
  .toast.error { border-left: 4px solid hsl(var(--destructive)); }
  .toast .t-title { font-weight: 600; font-size: 0.875rem; }
  .toast .t-desc { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); margin-top: 0.125rem; }
  @keyframes slide-in {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
  }
  
  /* ---------- Spinner ---------- */
  .spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  
  
  

  /* ---------- Folder cards ---------- */
.folder-card .card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.folder-badge {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  background: hsl(var(--foreground) / 0.75);
  color: hsl(var(--primary-foreground));
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  pointer-events: none;
}

/* ---------- Album nav header ---------- */
.album-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.album-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}