/* ================================================
   ZEN IT PORTFOLIO — Base Styles
   Reset + Global + Grid Background
   ================================================ */

/* ── Modern CSS Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

body {
  min-height: 100vh;
  background-color: var(--surface);
  color: var(--on-surface-variant);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Subtle Grid Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    repeating-linear-gradient(
      0deg,
      var(--grid-color) 0px,
      var(--grid-color) 1px,
      transparent 1px,
      transparent var(--grid-size)
    ),
    repeating-linear-gradient(
      90deg,
      var(--grid-color) 0px,
      var(--grid-color) 1px,
      transparent 1px,
      transparent var(--grid-size)
    );
  pointer-events: none;
}

/* ── Selection ── */
::selection {
  background-color: var(--primary-container);
  color: var(--on-primary);
}

::-moz-selection {
  background-color: var(--primary-container);
  color: var(--on-primary);
}

/* ── Links ── */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-default);
}

a:hover {
  color: var(--primary-fixed);
}

/* ── Images ── */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  color: var(--on-surface);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  color: var(--on-surface-variant);
  line-height: var(--leading-relaxed);
  max-width: 65ch;
}

/* ── Lists ── */
ul, ol {
  list-style: none;
}

/* ── Inputs & Buttons ── */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
}

/* ── Table ── */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ── Scrollbar Styling ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
}

::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--outline);
}

/* ================================================
   Utility Classes
   ================================================ */

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--section-gap);
}

/* ── Accessibility ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--primary-container);
  color: var(--on-primary);
  border-radius: var(--radius-md);
  z-index: var(--z-toast);
  transition: top var(--duration-normal) var(--ease-default);
}

.skip-link:focus {
  top: var(--space-2);
}

/* ── Text ── */
.text-primary     { color: var(--primary); }
.text-muted       { color: var(--on-surface-variant); }
.text-heading     { color: var(--on-surface); }
.text-tertiary    { color: var(--tertiary); }
.text-error       { color: var(--error); }
.text-success     { color: var(--success); }
.text-center      { text-align: center; }

/* ── Display ── */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2        { gap: var(--space-2); }
.gap-4        { gap: var(--space-4); }
.gap-6        { gap: var(--space-6); }
.gap-8        { gap: var(--space-8); }

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive Headings ── */
@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

  .section {
    padding-block: var(--space-16);
  }
}
