/* ==================================================
   HASHER AMIN — PORTFOLIO / 126
   Editorial, technical, Swiss-catalog aesthetic.

   Sections:
   1. Reset
   2. Variables
   3. Typography
   4. Frame (decorative registration marks)
   5. Navigation
   6. Hero
   7. Metadata
   8. Spec strip
   9. About
   10. Projects
   11. Skills
   12. Experience
   13. Contact + Footer
   14. Reveal / motion
   15. Responsive
   ================================================== */

/* --------------------------------------------------
   1. RESET
   -------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body,
h1, h2, h3, h4,
p, ul, ol, dl, dd,
figure { margin: 0; }

ul, ol { list-style: none; padding: 0; }

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

img { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* --------------------------------------------------
   2. VARIABLES
   -------------------------------------------------- */
:root {
  /* palette */
  --bg:        #E8E8E6;
  --bg-soft:   #EFEFED;
  --bg-alt:    #DEDEDA;
  --ink:       #131311;
  --ink-soft:  #4B4B46;
  --ink-mute:  #86867F;
  --line:      #C7C7C1;

  /* inverted "back cover" panel */
  --invert-bg:   #121210;
  --invert-ink:  #F3F2EE;
  --invert-mute: #8C8C84;
  --invert-line: #38382F;

  /* type */
  --font-display: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;

  /* hero photo treatment — tune freely */
  --hero-blur: 6px;
  --hero-opacity: 0.55;
  --hero-scale: 1.04;
  --hero-x: 14px;

  /* layout */
  --edge: clamp(20px, 4vw, 64px);
  --border: 1px solid var(--line);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------- */
body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
  overflow-x: hidden;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.meta-label--invert { color: var(--invert-mute); }

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
}

/* --------------------------------------------------
   4. FRAME — fixed registration marks (signature element)
   -------------------------------------------------- */
.frame {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(19, 19, 17, 0.08);
}

.frame__mark {
  position: absolute;
  width: 14px;
  height: 14px;
}

.frame__mark::before,
.frame__mark::after {
  content: "";
  position: absolute;
  background: rgba(19, 19, 17, 0.22);
}

.frame__mark::before { width: 100%; height: 1px; top: 50%; }
.frame__mark::after { height: 100%; width: 1px; left: 50%; }

.frame__mark--tl { top: 3px; left: 3px; }
.frame__mark--tr { top: 3px; right: 3px; }
.frame__mark--bl { bottom: 3px; left: 3px; }
.frame__mark--br { bottom: 3px; right: 3px; }

.frame__edge {
  position: absolute;
  top: 50%;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(19, 19, 17, 0.28);
  white-space: nowrap;
  transform-origin: center;
}

.frame__edge--left {
  left: -6px;
  transform: translateY(-50%) rotate(-90deg);
}

.frame__edge--right {
  right: -6px;
  transform: translateY(-50%) rotate(90deg);
}

@media (max-width: 720px) {
  .frame__edge { display: none; }
}

/* --------------------------------------------------
   5. NAVIGATION
   -------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--edge);
  background: rgba(232, 232, 230, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: var(--border);
}

.nav__name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav__links {
  display: flex;
  gap: 36px;
}

.nav__links a,
.nav__contact {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s var(--ease);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width 0.35s var(--ease);
}

.nav__links a:hover,
.nav__links a.is-active,
.nav__contact:hover {
  color: var(--ink);
}

.nav__links a:hover::after,
.nav__links a.is-active::after {
  width: 100%;
}

.nav__contact {
  border: var(--border);
  padding: 8px 16px;
}

.nav__toggle {
  display: none;
  width: 28px;
  height: 18px;
  position: relative;
}

.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav__toggle span { top: 50%; }
.nav__toggle span::before { top: -7px; }
.nav__toggle span::after { top: 7px; }

.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { transform: rotate(45deg) translate(5px, 5px); }
.nav__toggle[aria-expanded="true"] span::after { transform: rotate(-45deg) translate(5px, -5px); }

/* --------------------------------------------------
   6. HERO
   -------------------------------------------------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--edge) 96px;
  overflow: hidden;
}

.hero__title {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  font-size: clamp(48px, 11vw, 148px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.92;
  opacity: 0;
  transform: translateY(24px);
}

.hero__title-code {
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: 0;
}

.hero__sub {
  position: relative;
  z-index: 3;
  max-width: 34ch;
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(16px);
}

.is-loaded .hero__title {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.9s var(--ease) 0.15s, transform 0.9s var(--ease) 0.15s;
}

.is-loaded .hero__sub {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.9s var(--ease) 0.4s, transform 0.9s var(--ease) 0.4s;
}

/* hero photo — layered blur/motion treatment */
.hero__photo {
  position: absolute;
  right: 4%;
  top: 8%;
  width: min(38vw, 420px);
  height: 78%;
  z-index: 1;
}

.hero__photo-img,
.hero__photo-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(0.35) contrast(0.96);
}

.hero__photo-trail {
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  filter: blur(var(--hero-blur));
  opacity: var(--hero-opacity);
  transform: translateX(var(--hero-x)) scale(var(--hero-scale));
  mask-image: linear-gradient(to bottom, black 55%, transparent 96%);
  -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 96%);
}

.hero__photo-img {
  opacity: 0;
  mask-image: linear-gradient(to bottom, black 70%, transparent 98%);
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 98%);
  transition: opacity 1.1s var(--ease) 0.5s;
}

.is-loaded .hero__photo-img { opacity: 1; }

.hero__photo-img[data-broken="true"] { display: none; }

.hero__photo-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  border: 1px dashed var(--line);
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 20px;
}

#heroPhoto.no-photo .hero__photo-placeholder { display: flex; }
#heroPhoto.no-photo .hero__photo-trail { opacity: calc(var(--hero-opacity) * 0.5); }

.hero__scroll {
  position: absolute;
  left: var(--edge);
  bottom: 36px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
}

.hero__scroll-line {
  width: 40px;
  height: 1px;
  background: var(--ink-mute);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateX(-100%);
  animation: scrollLine 2.2s var(--ease) infinite;
}

@keyframes scrollLine {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* --------------------------------------------------
   7. METADATA (hero corners)
   -------------------------------------------------- */
.hero__meta {
  position: absolute;
  top: 100px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero__meta--left { left: var(--edge); }
.hero__meta--right { right: var(--edge); text-align: right; }

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(10px);
}

.is-loaded .meta-item {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s var(--ease) var(--d, 0.6s), transform 0.7s var(--ease) var(--d, 0.6s);
}

.hero__meta--left .meta-item:nth-child(1) { --d: 0.55s; }
.hero__meta--left .meta-item:nth-child(2) { --d: 0.62s; }
.hero__meta--left .meta-item:nth-child(3) { --d: 0.69s; }
.hero__meta--left .meta-item:nth-child(4) { --d: 0.76s; }
.hero__meta--left .meta-item:nth-child(5) { --d: 0.83s; }
.hero__meta--right .meta-item:nth-child(1) { --d: 0.6s; }
.hero__meta--right .meta-item:nth-child(2) { --d: 0.67s; }
.hero__meta--right .meta-item:nth-child(3) { --d: 0.74s; }
.hero__meta--right .meta-item:nth-child(4) { --d: 0.81s; }

.meta-value {
  font-size: 12px;
  color: var(--ink);
}

/* --------------------------------------------------
   8. SPEC STRIP
   -------------------------------------------------- */
.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: var(--border);
  border-bottom: var(--border);
}

.strip__item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px var(--edge);
  border-right: var(--border);
  transition: background 0.3s var(--ease);
}

.strip__item:last-child { border-right: none; }

.strip__item:hover { background: var(--bg-soft); }

.strip__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
}

.strip__label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#about, #work, #experience, #contact, #strip {
  scroll-margin-top: 76px;
}

/* --------------------------------------------------
   9. ABOUT
   -------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  padding: 120px var(--edge);
  border-bottom: var(--border);
}

.about__eyebrow { grid-column: 1 / -1; margin-bottom: 8px; }

.about__headline {
  font-size: clamp(30px, 4.4vw, 58px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.about__body { align-self: end; }

.about__bio {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 32px;
}

.about__facts {
  display: grid;
  gap: 12px;
  border-top: var(--border);
  padding-top: 16px;
}

.about__facts > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}

.about__facts dt {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* --------------------------------------------------
   10. PROJECTS
   -------------------------------------------------- */
.work { padding: 120px var(--edge) 40px; }

.work__head { margin-bottom: 56px; }

.project {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: center;
  padding: 44px 0;
  border-top: var(--border);
}

.work__list .project:last-child { border-bottom: var(--border); }

.project__visual {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-alt);
  overflow: hidden;
}

.project__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  filter: blur(0px);
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
}

.project__visual[data-pattern="grid"]::before {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
}

.project__visual[data-pattern="scan"]::before {
  background-image: repeating-linear-gradient(
    115deg, var(--line) 0 1px, transparent 1px 14px
  );
}

.project__visual[data-pattern="node"]::before {
  background-image:
    radial-gradient(circle at 20% 30%, var(--ink-mute) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 20%, var(--ink-mute) 0 2px, transparent 3px),
    radial-gradient(circle at 45% 65%, var(--ink-mute) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 75%, var(--ink-mute) 0 2px, transparent 3px),
    linear-gradient(115deg, transparent 49%, var(--line) 49.5%, var(--line) 50.5%, transparent 51%);
  background-size: 100% 100%;
}

.project:hover .project__visual::before {
  transform: scale(1.06);
}

.project__visual-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  background: var(--bg);
  padding: 3px 6px;
}

.project__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
}

.project__title {
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 6px 0 12px;
  transition: transform 0.5s var(--ease);
}

.project:hover .project__title { transform: translateX(6px); }

.project__desc {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 48ch;
  margin-bottom: 18px;
}

.project__meta {
  display: flex;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.project__visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.project__visual-tag {
  z-index: 2;
}

/* --------------------------------------------------
   11. SKILLS
   -------------------------------------------------- */
.skills {
  padding: 100px var(--edge) 120px;
  border-bottom: var(--border);
}

.skills__head { margin-bottom: 44px; }

.skills__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: var(--border);
  border-left: var(--border);
}

.skills__list li {
  padding: 20px 18px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-right: var(--border);
  border-bottom: var(--border);
  transition: background 0.3s var(--ease), padding-left 0.3s var(--ease);
}

.skills__list li:hover {
  background: var(--bg-soft);
  padding-left: 24px;
}

/* --------------------------------------------------
   12. EXPERIENCE
   -------------------------------------------------- */
.experience { padding: 120px var(--edge); }

.experience__head { margin-bottom: 56px; }

.timeline__item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 40px;
  padding: 36px 0;
  border-top: var(--border);
}

.timeline li:last-child { border-bottom: var(--border); }

.timeline__year {
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 700;
  color: var(--ink-mute);
}

.timeline__body h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.timeline__body p {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 52ch;
}

/* --------------------------------------------------
   13. CONTACT + FOOTER
   -------------------------------------------------- */
.contact {
  background: var(--invert-bg);
  color: var(--invert-ink);
  padding: 120px var(--edge) 40px;
}

.contact__headline {
  font-size: clamp(52px, 10vw, 128px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.94;
  margin: 20px 0 64px;
}

.contact__links {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--invert-line);
}

.contact__links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--invert-line);
  transition: padding-left 0.35s var(--ease), opacity 0.35s var(--ease);
}

.contact__links a:hover {
  padding-left: 14px;
  opacity: 0.75;
}

.contact__value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--invert-ink);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 32px 0 8px;
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--invert-mute);
}

/* --------------------------------------------------
   14. REVEAL / MOTION
   -------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .hero__title, .hero__sub, .meta-item, .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero__photo-img { opacity: 1 !important; }
  .hero__scroll-line::after { animation: none; }
}

/* --------------------------------------------------
   15. RESPONSIVE
   -------------------------------------------------- */
@media (max-width: 1024px) {
  .hero { min-height: 100vh; padding-bottom: 120px; }
  .hero__photo { width: 46vw; top: auto; bottom: 0; height: 60%; right: var(--edge); }
  .hero__meta { top: 92px; gap: 10px; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about__body { align-self: start; }
  .project { grid-template-columns: 1fr; gap: 20px; }
  .skills__list { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  :root { --edge: 20px; }

  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .nav__contact { padding: 6px 12px; }

  .nav__links.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: var(--border);
    padding: 20px var(--edge) 28px;
    gap: 18px;
  }

  .hero { min-height: auto; padding-top: 48px; padding-bottom: 64px; }

  .hero__meta {
    position: static;
    order: 2;
    gap: 10px;
    padding-top: 20px;
    border-top: var(--border);
  }
  .hero__meta--left { margin-bottom: 20px; }
  .hero__meta--right { text-align: left; }

  .meta-item { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; }

  .hero__photo { position: relative; width: 100%; height: 46vh; right: 0; top: 0; margin-bottom: 28px; order: -1; }
  .hero__title { flex-direction: column; gap: 6px; order: 0; margin-top: 8px; }
  .hero__sub { order: 1; }
  .hero__scroll { display: none; }

  .strip { grid-template-columns: 1fr 1fr; }
  .strip__item:nth-child(2) { border-right: none; }
  .strip__item:nth-child(3) { border-top: var(--border); }
  .strip__item:nth-child(4) { border-top: var(--border); border-right: none; }

  .about, .work, .skills, .experience, .contact { padding-left: var(--edge); padding-right: var(--edge); }

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

  .timeline__item { grid-template-columns: 1fr; gap: 12px; }

  .contact__links a { flex-direction: column; align-items: flex-start; gap: 6px; }

  .footer { flex-direction: column; gap: 6px; }
}
